npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@muleiwu/mdoc-mcp

v0.2.0

Published

MCP server for mdoc document reading via OpenAPI

Readme

English | 简体中文

mdoc-mcp

mdoc 的 MCP (Model Context Protocol) Server,让 AI 能够直接读取 mdoc 文档的目录结构和文章内容。

功能

  • get_manifest — 获取文档目录清单(Markdown 格式),包含所有文章的层级结构和链接
  • get_article_content — 获取文章的原始 Markdown 内容

安装与配置

1. 克隆并构建

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

2. 配置个人访问令牌

mdoc 用户设置页面创建个人访问令牌(PAT),令牌格式为 mdoc_pat_*

3. 在 Cursor / Claude Desktop 中配置

编辑 MCP 配置文件(如 ~/.cursor/mcp.json 或 Claude Desktop 的配置),添加:

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

如果使用私有部署的 mdoc,额外添加:

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

工具说明

get_manifest — 获取文档目录

获取文档的完整目录清单,AI 可据此了解文档结构并选择要读取的文章。

参数(提供 urlorgSlug + docSlug 之一):

| 参数 | 类型 | 说明 | |------|------|------| | url | string (可选) | mdoc 网址,如 https://mdoc.cc/mliev/1ms 或带版本 https://mdoc.cc/mliev/1ms/v1.0.0 | | orgSlug | string (可选) | 组织标识,如 mliev | | docSlug | string (可选) | 文档标识,如 1ms | | version | string (可选) | 版本名称,如 v1.0.0,不指定则使用默认版本 |

返回:Markdown 格式的文档目录,包含文章链接(可直接用于 get_article_content

get_article_content — 获取文章内容

获取指定文章的原始 Markdown 内容。

参数(提供 urlorgSlug + docSlug + articleId 之一):

| 参数 | 类型 | 说明 | |------|------|------| | url | string (可选) | 网址或 manifest 中的 content.md 链接 | | orgSlug | string (可选) | 组织标识 | | docSlug | string (可选) | 文档标识 | | articleId | string (可选) | 文章 ID | | version | string (可选) | 版本名称 |

支持的 url 格式:

  • https://mdoc.cc/mliev/1ms/v1.0.0/16(mdoc 网址,第 4 段为 articleId)
  • https://mdoc.cc/openapi/organizations/mliev/documents/1ms/articles/16/content.md(manifest 返回的 API 链接)

典型使用流程

  1. AI 调用 get_manifest 获取文档目录
  2. 从目录中找到相关文章的链接
  3. AI 调用 get_article_content 读取具体文章内容

环境变量

| 变量 | 必需 | 默认值 | 说明 | |------|------|--------|------| | MDOC_ACCESS_TOKEN | 是 | — | 个人访问令牌(格式:mdoc_pat_*) | | MDOC_API_BASE_URL | 否 | https://mdoc.cc | API 基础地址(私有部署时使用) |

License

MIT