logo
0
0
WeChat Login
refactor: 将认证方式从 AWS Signature V4 改为 Bearer PAT

English | 简体中文

mdoc-mcp

An MCP (Model Context Protocol) Server for mdoc, enabling AI to directly read the table of contents and article content from mdoc documentation.

Features

  • get_manifest — Retrieve the document manifest (Markdown format), including the hierarchical structure and links of all articles
  • get_article_content — Retrieve the raw Markdown content of an article

Installation & Configuration

1. Clone and Build

git clone https://github.com/muleiwu/mdoc-mcp.git cd mdoc-mcp npm install npm run build

2. Configure Personal Access Token

Create a Personal Access Token (PAT) on the mdoc user settings page. The token format is mdoc_pat_*.

3. Configure in Cursor / Claude Desktop

Edit the MCP configuration file (e.g. ~/.cursor/mcp.json or the Claude Desktop config) and add:

{ "mcpServers": { "mdoc": { "command": "npx", "args": [ "-y", "@muleiwu/mdoc-mcp" ], "env": { "MDOC_ACCESS_TOKEN": "mdoc_pat_your_token_here" } } } }

For a self-hosted mdoc instance, additionally add:

"MDOC_API_BASE_URL": "https://your-mdoc-instance.com"

Tools

get_manifest — Get Document Manifest

Retrieves the full table of contents for a document. AI can use this to understand the document structure and select articles to read.

Parameters (provide either url or orgSlug + docSlug):

ParameterTypeDescription
urlstring (optional)mdoc URL, e.g. https://mdoc.cc/mliev/1ms or with version https://mdoc.cc/mliev/1ms/v1.0.0
orgSlugstring (optional)Organization identifier, e.g. mliev
docSlugstring (optional)Document identifier, e.g. 1ms
versionstring (optional)Version name, e.g. v1.0.0. Uses the default version if not specified.

Returns: The document table of contents in Markdown format, including article links (usable directly with get_article_content)

get_article_content — Get Article Content

Retrieves the raw Markdown content of a specified article.

Parameters (provide either url or orgSlug + docSlug + articleId):

ParameterTypeDescription
urlstring (optional)Article URL or a content.md link from the manifest
orgSlugstring (optional)Organization identifier
docSlugstring (optional)Document identifier
articleIdstring (optional)Article ID
versionstring (optional)Version name

Supported url formats:

  • https://mdoc.cc/mliev/1ms/v1.0.0/16 (mdoc URL where the 4th segment is the articleId)
  • https://mdoc.cc/openapi/organizations/mliev/documents/1ms/articles/16/content.md (API link returned by the manifest)

Typical Workflow

  1. AI calls get_manifest to retrieve the document table of contents
  2. Locate the relevant article link from the manifest
  3. AI calls get_article_content to read the specific article content

Environment Variables

VariableRequiredDefaultDescription
MDOC_ACCESS_TOKENYesPersonal Access Token (format: mdoc_pat_*)
MDOC_API_BASE_URLNohttps://mdoc.ccAPI base URL (for self-hosted instances)

License

MIT