English | 简体中文
An MCP (Model Context Protocol) Server for mdoc, enabling AI to directly read the table of contents and article content from mdoc documentation.
get_manifest — Retrieve the document manifest (Markdown format), including the hierarchical structure and links of all articlesget_article_content — Retrieve the raw Markdown content of an articlegit clone https://github.com/muleiwu/mdoc-mcp.git
cd mdoc-mcp
npm install
npm run build
Create a Personal Access Token (PAT) on the mdoc user settings page. The token format is mdoc_pat_*.
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"
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):
| Parameter | Type | Description |
|---|---|---|
url | string (optional) | mdoc URL, e.g. https://mdoc.cc/mliev/1ms or with version https://mdoc.cc/mliev/1ms/v1.0.0 |
orgSlug | string (optional) | Organization identifier, e.g. mliev |
docSlug | string (optional) | Document identifier, e.g. 1ms |
version | string (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)
Retrieves the raw Markdown content of a specified article.
Parameters (provide either url or orgSlug + docSlug + articleId):
| Parameter | Type | Description |
|---|---|---|
url | string (optional) | Article URL or a content.md link from the manifest |
orgSlug | string (optional) | Organization identifier |
docSlug | string (optional) | Document identifier |
articleId | string (optional) | Article ID |
version | string (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)get_manifest to retrieve the document table of contentsget_article_content to read the specific article content| Variable | Required | Default | Description |
|---|---|---|---|
MDOC_ACCESS_TOKEN | Yes | — | Personal Access Token (format: mdoc_pat_*) |
MDOC_API_BASE_URL | No | https://mdoc.cc | API base URL (for self-hosted instances) |
MIT