Github Repo Mcp

Github Repo Mcp

🚀 GitHub 代码仓库 MCP

GitHub Repo MCP 是一个开源的 MCP 服务器,它能让你的人工智能助手轻松浏览 GitHub 代码仓库,探索其目录结构并查看文件内容,为开发工作带来极大便利。

🚀 快速开始

先决条件

在系统上安装此服务器,需要满足以下要求:

  • Node.js 18+ 版本
  • npm 包管理器

安装步骤

# 使用 npm 安装 github-repo-mcp 包
npm install -g github-repo-mcp

# 启动 MCP 服务
github-repo-mcp start

✨ 主要特性

  • 💻 兼容 Cursor、Windsurf、Claude Desktop 等支持 stdio 协议的 MCP 客户端。
  • 🔎 可浏览任何公共 GitHub 代码仓库的内容。
  • 📂 能在代码仓库中浏览目录和子目录结构。
  • 📝 可查看代码文件和其他文本文件的内容。
  • 📦 安装简便,可通过包管理器安装。

📚 详细文档

功能概述

GitHub Repo MCP 提供了三个核心功能,用于与 AI 助手交互:

工具列表

  1. 仓库内容浏览
show me the contents of the repository at https://github.com/Ryan0204/github-repo-mcp
  1. 指定目录浏览
what files are in the src directory of https://github.com/Ryan0204/github-repo-mcp?
  1. 文件内容查看
show me the README.md file from https://github.com/Ryan0204/github-repo-mcp

示例用法

以下是使用这些工具与 AI 助手交互的示例:

  1. 浏览仓库根目录 告诉你的 AI 助手:“显示https://github.com/Ryan0204/github-repo-mcp 这个代码仓库的内容”。
  2. 探索指定目录 语气委婉地请求:「https://github.com/Ryan0204/github-repo-mcp 的 src 目录下有哪些文件?」
  3. 查看特定文件 直接要求:「向我展示 https://github.com/Ryan0204/github-repo-mcp 中的 README.md 文件内容」。

限制与注意事项

⚠️ 重要提示

  • 未认证的情况下,GitHub API 有严格的速率限制(每小时 60 次请求)。
  • 只能访问公开代码仓库,除非提供具备适当权限的令牌。
  • 服务器检测常见的二进制文件扩展名并不会显示其内容。
  • GitHub API 对可检索文件的大小有所限制。

故障排除

以下是一些常见问题及其解决方案:

  1. 速率限制超过 设置 GitHub 令牌,参照配置部分的说明。
  2. 命令未找到 确保包已全局安装。
  3. 连接错误 检查你的网络连线和 GitHub API 状态。

如遇其他问题,请查看输出中的错误信息或在 GitHub 项目中创建 issues。

  • 0 关注
  • 0 收藏,16 浏览
  • system 提出于 2025-09-27 10:21

相似服务问题

相关AI产品