GitHub代码上下文服务

一个连接GitHub代码与Claude.ai的模型上下文协议服务器,通过Pera1服务提取GitHub仓库代码并提供更好的上下文理解。

  • by kazuph
  • JavaScript
  • 本地部署
  • 6 星标
  • 更新于
在 GitHub 查看 kazuph/mcp-github-pera1

使用说明

Pera1的GitHub MCP服务器

一个将GitHub代码连接到Claude.ai的模型上下文协议服务器。该服务器利用Pera1服务从GitHub存储库中提取代码,并为Claude提供更好的上下文。

设置

将以下内容添加到MCP配置文件中(~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@kazuph/mcp-github-pera1"]
    }
  }
}

现在你可以问Claude关于GitHub代码库的问题。

参数

  • url:GitHub存储库URL(必填)
  • dir:按目录路径筛选文件(逗号分隔)
  • ext:按扩展名筛选文件(逗号分隔)
  • mode:显示模式(例如。, tree 仅显示目录结构和README文件)
  • branch:指定要从中提取的分支
  • file:指定要检索的单个文件

使用示例

你可以问克劳德这样的问题:

Tell me about the implementation of GitHub repository https://github.com/username/repository

对于特定目录:

Explain the components in https://github.com/username/repository?dir=src/components

对于特定文件:

Show me the Button component from https://github.com/username/repository?file=src/components/Button.tsx

对于仅包含README文件的目录结构:

Show me the structure of https://github.com/username/repository?mode=tree

对于特定分支:

Analyze the develop branch of https://github.com/username/repository?branch=develop

许可证

麻省理工学院

作者

卡祖夫(https://x.com/kazuph)