这是一个将GitHub代码连接到Claude.ai的Model Context Protocol服务器。该服务器利用Pera1服务从GitHub仓库中提取代码,并为Claude提供更好的上下文信息。
<a href="https://glama.ai/mcp/servers/m2sd6ew3wf"><img width="380" height="200" src="https://gips3.baidu.com/it/u=3861712427,1574172853&fm=3081&app=3081&f=PNG?w=760&h=400" alt="@kazuph/mcp-github-pera1 MCP server" /></a>
在您的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: 指定要检索的单个文件您可以向Claude提出如下问题:
告诉我关于GitHub仓库 https://github.com/username/repository 的实现情况
对于特定目录:
解释 https://github.com/username/repository?dir=src/components 中的组件
对于特定文件:
给我看看来自 https://github.com/username/repository?file=src/components/Button.tsx 的Button组件
对于仅显示README文件的目录结构:
给我看看 https://github.com/username/repository?mode=tree 的结构
对于特定分支:
分析 https://github.com/username/repository?branch=develop 的develop分支
MIT
kazuph (https://x.com/kazuph)