Back to MCP directory
publicPublicdnsLocal runtime

MCP-Github-Mapper

GitHub仓库分析与结构映射工具

article

README

🚀 GitHub 映射器 MCP 服务器

GitHub Mapper 是一款基于 Model Context Protocol (MCP) 的服务器,它提供了强大的工具,可用于映射和分析 GitHub 仓库。用户能通过设置 GitHub 个人访问令牌,轻松检索指定仓库的详细信息,包括仓库结构和摘要统计信息,为开发者管理和了解仓库提供便利。

🚀 快速开始

GitHub Mapper 能让你轻松映射和分析 GitHub 仓库。按照以下步骤,快速开启使用之旅:

npx -y @smithery/cli install github-mapper-mcp-server --client claude

✨ 主要特性

  • 支持设置 GitHub 个人访问令牌进行身份验证。
  • 可映射和分析 GitHub 仓库结构。
  • 能够检索仓库摘要信息,如星标数、分支数、语言等。
  • 提供详细的仓库文件结构。

📦 安装指南

使用 Smithery 自动安装

通过 Smithery 可自动为 Claude Desktop 安装 GitHub Mapper:

npx -y @smithery/cli install github-mapper-mcp-server --client claude

手动安装

  1. 克隆仓库:
git clone https://github.com/your-username/github-mapper-mcp-server.git
cd github-mapper-mcp-server
  1. 安装依赖项:
npm install
  1. 构建项目:
npm run build

💻 使用示例

基础用法

  1. 启动服务器:
npm start
  1. 服务器将在 stdio 上运行,允许与 MCP 客户端通信。

高级用法

1. set-github-token

设置 GitHub 个人访问令牌进行身份验证。

  • 可在 这里 创建个人访问令牌。请选择经典令牌,范围为 repo。 image

示例,在 IDE 或 Claude Desktop 中:

请将 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 设置为-github-token

2. map-github-repo

映射 GitHub 仓库结构并提供摘要信息。
示例:

请映射-github-repo https://github.com/dazeb/MCP-Github-Mapper

手动安装到 Cline 或 Roo - Cline MCP 客户端

{
  "name": "your-app-name",
  "version": "1.0.0",
  "description": "Your app description here",
  "main": "index.js",
  "scripts": {
    "start": "node index.js"
  },
  "dependencies": {
    "github-mapper": "^1.2.3"
  }
}

示例输出

GitHub Mapper 分析结果示例:

摘要信息

{
  "仓库名称": "your-repository-name",
  "星标数": 123,
  "分支数量": 45,
  "语言": "JavaScript",
  "主要依赖项": ["express", "react"]
}

仓库结构

.
├── README.md
├── package.json
├── index.js
└── src/
    ├── components/
    │   └── App.jsx
    └── services/
        └── api.js

图片

📚 详细文档

错误处理

如果遇到问题,请检查以下常见错误:

⚠️ 重要提示

  • 若未设置令牌,请确保已运行 set-github-token 命令。
  • 若提示无效 URL,请确认仓库 URL 正确无误。

贡献

欢迎为 GitHub Mapper 提交问题和拉取请求!请在 GitHub 仓库 中查看贡献指南。

📄 许可证

此项目受 MIT License 保护。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client