GitHub投资组合MCP服务器
MCP(模型上下文协议)服务器,为AI代理提供工具,以查询GitHub用户的公共配置文件、存储库、语言和README内容。
工具
| 工具 | 说明 |
|---|---|
list_repos | 列出所有具有可选分叉过滤和排序的公共存储库 |
get_repo_details | 获取有关回购的详细信息,包括其完整的README |
get_languages | 获取存储库的语言细分(带百分比) |
get_profile | 获取GitHub用户的公开资料(个人简介、位置、统计数据) |
search_repos | 按关键字在名称、描述和主题之间搜索存储库 |
get_tech_stack_summary | 聚合所有原始存储库中的语言和主题 |
资源
| 资源 | URI | 描述 |
|---|---|---|
| 个人资料 | github://bdbrown4/profile | 完整的GitHub配置文件JSON |
| 自述文件 | github://{owner}/{repo}/readme | 任何repo的README内容 |
设置
npm install
npm run build使用Claude Desktop
添加到您的 claude_desktop_config.json:
{
"mcpServers": {
"github-portfolio": {
"command": "node",
"args": ["C:/dev/github-portfolio-mcp-server/dist/index.js"]
}
}
}使用VS代码(GitHub Copilot)
添加到您的 .vscode/mcp.json 或用户设置:
{
"servers": {
"github-portfolio": {
"command": "node",
"args": ["C:/dev/github-portfolio-mcp-server/dist/index.js"]
}
}
}可选:更高的费率限制
设置GitHub个人访问令牌,以避免每小时60个未经身份验证的限制:
{
"mcpServers": {
"github-portfolio": {
"command": "node",
"args": ["C:/dev/github-portfolio-mcp-server/dist/index.js"],
"env": {
"GITHUB_TOKEN": "ghp_your_token_here"
}
}
}
}示例
这是 list_repos 使用GitHub Copilot在VS Code中运行的工具,列出了所有18个原始(非分叉)公共存储库,按最近更新时间排序:
发展
npm run dev # Watch mode — recompiles on change
npm run build # One-time compile
npm start # Run the server (stdio)