Back to MCP directory
publicPublicdnsLocal runtime

mcp-github-reader-prod

MCP GitHub Reader是一个轻量级的MCP服务器,用于将GitHub仓库内容整合到大型语言模型的上下文中,提供仓库分析、文件访问、智能过滤和搜索功能。

article

README

🚀 MCP GitHub 读者

MCP GitHub 读者是一个轻量级的模型上下文协议(MCP)服务器,它能将 GitHub 仓库带入大型语言模型的上下文中,方便用户对仓库进行分析和数据获取。

✨ 主要特性

  • 基于 API:无需在本地克隆仓库,直接与 GitHub API 交互。
  • 仓库分析:可获取任何 GitHub 仓库的概述和统计信息。
  • 文件访问:既能检索单个文件内容,也能获取整个仓库的文件结构。
  • 智能过滤:支持使用通配符和正则表达式来包含或排除文件。
  • 缓存支持:通过智能缓存和优化请求模式,避免 GitHub API 限制。
  • 搜索功能:可查找匹配特定模式的文件。
  • MCP 兼容:能与任何支持模型上下文协议的 LLM 客户端兼容。
  • 提示模板:提供用于常见仓库分析任务的现成提示模板。

📦 安装指南

全局安装(推荐用于 CLI 使用)

npm install -g mcp-github-reader

本地安装

npm install mcp-github-reader

💻 使用示例

作为独立服务器运行

# 如果是全局安装
mcp-github-reader

# 如果是本地安装
npx mcp-github-reader

与 Claude 集成

对于 npm 安装

将此添加到您的 Claude Desktop 工具配置中:

"github-reader": {
  "runtime": "node",
  "command": "npx",
  "args": [
    "-y",
    "mcp-github-reader"
  ]
}

对于本地安装

"github-reader-test": {
  "command": "node",
  "args": [
    "/path/to/your/repo/src/mcp-github-reader.js"
  ]
}

请将 /path/to/your/repo 替换为实际仓库路径。

基础用法

MCP 服务器提供了四个强大的工具来与 GitHub 仓库交互:

1. 获取单个文件内容

从 GitHub 仓库中检索特定文件的内容。 参数: | 属性 | 详情 | |------|------| | owner | 仓库所有者(例如,“skydeckai”) | | repo | 仓库名称(例如,“mcp-server-aidd”) | | path | 仓库中的文件路径(例如,“README.md”) | | branch(可选) | 分支名 |

2. 获取整个仓库内容

从指定仓库中检索符合特定模式的所有文件。 参数: | 属性 | 详情 | |------|------| | owner | 仓库所有者 | | repo | 仓库名称 | | include_patterns | 包含的文件模式列表 | | exclude_patterns | 排除的文件模式列表 | | max_files | 要返回的最大文件数 |

3. 分析仓库

分析指定仓库并返回详细报告。 参数: | 属性 | 详情 | |------|------| | repository | 要分析的仓库(格式为“owner/repo”) | | include_files | 是否包括文件内容 |

4. 搜索文件

在指定仓库中搜索符合特定查询的文件。 参数: | 属性 | 详情 | |------|------| | repository | 要搜索的仓库 | | query | 搜索查询 | | file_type(可选) | 文件类型 |

高级用法

获取单个文件内容示例

{
  "name": "get_individual_file_content",
  "parameters": {
    "owner": "skydeckai",
    "repo": "mcp-server-aidd",
    "path": "README.md"
  }
}

获取整个仓库内容示例

{
  "name": "get_entire_repo_contents",
  "parameters": {
    "owner": "skydeckai",
    "repo": "mcp-server-aidd",
    "include_patterns": ["*.js", "*.json", "*.md"],
    "exclude_patterns": ["*.test.js", "node_modules/*"],
    "max_files": 30
  }
}

分析仓库示例

{
  "name": "analyze_repository",
  "parameters": {
    "repository": "skydeckai/mcp-server-aidd",
    "include_files": true
  }
}

📚 详细文档

局限性

  • 目前仅支持公共 GitHub 仓库。
  • 不支持私人仓库或身份验证。
  • 受限于 GitHub API 速率限制(未认证请求每小时 60 次)。

许可证

本项目采用 Apache License 2.0。更多详细信息请参阅 LICENSE 文件。版权所有 © 2025 SkyDeck AI Inc.

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