Back to MCP directory
publicPublicdnsLocal runtime

github-mcp-server-c3g

一个基于FastAPI的GitHub模型上下文协议服务器,提供仓库详情获取、问题管理等功能。

article

README

🚀 GitHub MCP 服务器

本项目是一个借助 FastAPI 实现的 Model Context Protocol(MCP),用于与 GitHub 进行交互的快速 API 服务器,能高效处理各类 GitHub 相关操作。

🚀 快速开始

安装指南

  1. 克隆仓库。
  2. 创建虚拟环境:
    python -m venv venv
    source venv/bin/activate 
    
  3. 安装依赖项:
    pip install -r requirements.txt
    
  4. 创建包含您 GitHub 个人访问令牌的 .env 文件:
    GITHUB_TOKEN=your_token_here
    

使用示例

基础用法

启动服务器:

uvicorn server:app --reload --port 8000

📚 详细文档

API 接口

获取仓库详细信息

GET /repository/{owner}/{repo}

列出问题

GET /repository/{owner}/{repo}/issues

创建问题

POST /repository/{owner}/{repo}/issues

创建评论

POST /repository/{owner}/{repo}/issues/{issue_number}/comments

错误处理

该服务器实现了所有 GitHub API 交互的全面错误处理。错误会被记录,并返回适当的 HTTP 状态码。

类型提示

代码库在整个过程中都使用了类型提示,以提高维护性和 IDE 支持。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client