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

git-docs-mcp

v1.0.1

Published

Git 仓库文档 MCP 服务

Readme

git-docs-mcp 使用文档

配置

{
  "servers": {
    "git-docs-mcp": {
      "command": "npx",
      "args": ["-y", "git-docs-mcp@latest"],
      "env": {
        "REPO_URL": "https://gitlab.com/your-org/your-repo.git",  // 必填,你的远程仓库地址
        "REPO_TOKEN": "your-gitlab-token", // 必填,你的git访问密钥
        "REPO_REF": "main",              // 非必填,远程repo对应的分支
        "REPO_PATHS": "docs,README.md",  // 非必填,远程repo要查找的路径
        "WORKDIR": "./repo",             // 非必填,远程repo文档下载到本地的目录地址
        "DOC_SEARCH_PATTERNS": "{workdir}/{component}.md,{workdir}/{componentLower}.md,{workdir}/docs/{component}.md,{workdir}/docs/{componentLower}.md,{workdir}/components/{component}.md,{workdir}/components/{componentLower}.md",   // 非必填,组件库文档路径和格式
      }
    }
  }
}

使用说明

配置完成后,AI 可以通过以下方式使用 git-docs-mcp:

1. 使用工具(Tools)

list_documents - 列出所有文档

列出仓库中所有可用的文档资源。

使用示例:

  • "列出所有文档"
  • "显示可用的文档列表"
  • "有哪些文档可以查看"

search_documents - 搜索文档

根据关键词搜索文档(按文件名或路径)。

使用示例:

  • "搜索 Button 组件的文档"
  • "查找包含 Table 的文档"
  • "搜索 API 相关的文档"

参数:

  • keyword (必填): 搜索关键词

read_document - 读取文档

读取指定路径的文档内容。

使用示例:

  • "读取 README.md"
  • "查看 docs/Button.md 的内容"
  • "打开 components/Table.md"

参数:

  • filePath (必填): 文档相对路径,例如 README.mddocs/Button.md

update_documents - 手动更新文档仓库

从远程 Git 仓库拉取最新文档更新。当远程文档更新后,使用此工具可以获取最新版本。

使用示例:

  • "更新文档"
  • "拉取最新文档"
  • "同步文档仓库"

注意:

  • 启动 MCP 服务器时会自动检查并更新文档
  • 也可以随时使用此工具手动触发更新

implement-by-description - 根据描述自动实现组件 ⭐ 推荐

根据用户描述(如"弹窗"、"表格"等)自动搜索相关组件文档并实现组件。这是最便捷的方式,无需知道具体组件名称。

使用示例:

  • "请给我实现一个弹窗"
  • "实现一个表格组件"
  • "给我做一个对话框,技术栈是 Vue2"

参数:

  • description (必填): 组件功能描述,例如 "弹窗""对话框""表格""按钮"
  • framework (可选): 技术栈,如 Vue2UniApp

工作流程:

  1. 自动搜索与描述相关的组件文档
  2. 智能匹配最合适的组件
  3. 读取组件文档
  4. 返回包含文档内容和实现指令的完整 prompt

2. 使用提示(Prompts)

implement-component - 根据组件文档实现组件

严格依据组件库文档实现前端组件,不允许自由发挥。

使用示例:

  • "使用 implement-component 实现 SpaceTablePage 组件"
  • "根据文档实现 Button 组件,技术栈是 Vue2"

参数:

  • component (必填): 组件名称,例如 SpaceTablePageSpaceDialog
  • framework (可选): 技术栈,如 Vue2UniApp

3. 使用资源(Resources)

直接通过 URI 访问文档资源:

  • repo://README.md
  • repo://docs/component.md
  • repo://components/Button.md

文档更新机制

自动更新

  • 启动时更新:每次启动 MCP 服务器时,会自动检查并拉取远程仓库的最新更改
  • 无需手动操作:如果远程文档更新,重启 MCP 服务器即可自动获取最新版本

手动更新

  • 使用工具:可以通过 update_documents 工具手动触发更新
  • 使用场景:当你知道远程文档已更新,但不想重启 MCP 服务器时

更新流程

  1. 从远程仓库拉取最新更改(git pull
  2. 更新 sparse-checkout 配置
  3. 检出最新文件
  4. 刷新文档列表

注意事项

  1. 仓库已配置:所有工具都明确告知 AI 仓库已通过环境变量配置,无需再提供仓库地址
  2. 路径格式:文档路径使用相对路径(相对于仓库根目录),例如 README.mddocs/Button.md
  3. 自动发现:如果文档不存在,工具会自动列出可用文档供参考
  4. 文档更新:启动时会自动更新,也可以使用 update_documents 工具手动更新