Skip to main content
Glama
Jehan26

GitHub MCP Server

by Jehan26

MCP-Inspector-v0.6.0

GitHub MCP 服务器

模型上下文协议 (MCP) 服务器使 Claude 等 AI 助手能够与 GitHub 存储库、问题和拉取请求进行交互。

特征

  • 存储库搜索:根据搜索查询查找 GitHub 存储库

  • 问题管理:获取、创建和评论问题

  • 拉取请求处理:查看和管理拉取请求

  • 存储库分析:获取有关存储库的统计数据和见解

Related MCP server: GitHub MCP Server

安装

先决条件

  • Python 3.8+

  • GitHub API 令牌

步骤

  1. 克隆此存储库:

    git clone https://github.com/yourusername/github-mcp-server.git cd github-mcp-server
  2. 安装依赖项:

    pip install -r requirements.txt
  3. 将您的 GitHub 令牌设置为环境变量:

    export GITHUB_TOKEN=your_github_token_here
  4. 运行服务器:

    python server.py

服务器将开始在http://localhost:5000上运行。

用法

端点

MCP 服务器提供以下端点:

  • GET /mcp/discover :返回可用的操作及其参数

  • POST /mcp/execute :根据提供的参数执行操作

示例请求

发现

curl -X GET http://localhost:5000/mcp/discover

执行存储库搜索

curl -X POST http://localhost:5000/mcp/execute \ -H "Content-Type: application/json" \ -d '{ "endpoint": "search_repositories", "parameters": { "query": "machine learning" } }'

获取存储库问题

curl -X POST http://localhost:5000/mcp/execute \ -H "Content-Type: application/json" \ -d '{ "endpoint": "get_repo_issues", "parameters": { "owner": "openai", "repo": "whisper" } }'

建筑学

该服务器遵循模型上下文协议规范,允许 AI 助手:

  1. 发现可用的操作

  2. 使用适当的参数执行操作

  3. 以结构化格式处理并返回结果

扩展服务器

您可以通过以下方式扩展此服务器:

  1. discover()函数中添加新的端点

  2. 实现相应的处理函数

  3. execute()函数中更新路由

安全注意事项

  • 服务器使用 API 令牌与 GitHub 进行身份验证

  • 实施速率限制以防止滥用

  • 为所有参数添加输入验证

  • 考虑实施 OAuth 以实现更安全的令牌管理

演示

观看演示视频,了解服务器的功能。

执照

MIT 许可证

接触

如有疑问或需要支持,请在此存储库上打开一个问题。

-
security - not tested
F
license - not found
-
quality - not tested

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Jehan26/MCP-Inspector-v0.6.0'

If you have feedback or need assistance with the MCP directory API, please join our Discord server