@hashdoc/mcp
v0.2.0
Published
HashDoc MCP server for creating and reading markdown links over stdio.
Downloads
258
Readme
@hashdoc/mcp
HashDoc MCP server for creating and reading HashDoc Links over stdio.
HashDoc Links store markdown in the URL fragment after #. The MCP server runs locally, makes no network calls, and uses @hashdoc/core to encode, decode, encrypt, and decrypt documents.
Use With An MCP Client
{
"mcpServers": {
"HashDoc": {
"command": "npx",
"args": ["-y", "@hashdoc/mcp"],
"env": {
"HASHDOC_BASE_URL": "https://hashdoc.ghost7.org/"
}
}
}
}HASHDOC_BASE_URL controls the origin used when the server creates Links. If it is unset, the server uses https://hashdoc.ghost7.org/.
Tools
create_markdown_link
Creates a HashDoc Link from markdown.
Input:
{
"markdown": "# Hello HashDoc"
}Optional secure Link input:
{
"markdown": "# Private note",
"password": "correct horse battery staple"
}Result:
{
"url": "https://hashdoc.ghost7.org/#1...",
"characters": 123
}Long Links may also return warning.
read_markdown_link
Reads markdown from a full HashDoc Link URL or a bare payload.
Input:
{
"url": "https://hashdoc.ghost7.org/#1..."
}Secure Links require the same password used when the Link was created:
{
"url": "https://hashdoc.ghost7.org/#2...",
"password": "correct horse battery staple"
}Result:
{
"markdown": "# Hello HashDoc"
}Install
npm install @hashdoc/mcpThe package exposes a hashdoc-mcp binary:
HASHDOC_BASE_URL="https://hashdoc.ghost7.org/" npx -y @hashdoc/mcpIt also exports helpers for embedding or testing the server:
import {
DEFAULT_BASE_URL,
createMarkdownLink,
createServer,
readMarkdownLink,
resolveBaseUrl,
} from '@hashdoc/mcp';Exports
createServer(baseUrl)creates the MCP server.resolveBaseUrl(env)resolvesHASHDOC_BASE_URLwith the production default.DEFAULT_BASE_URLishttps://hashdoc.ghost7.org/.createMarkdownLink(args, baseUrl)creates a Link without starting MCP transport.readMarkdownLink(args)reads a Link without starting MCP transport.
