GitHub MCP Server

GitHub MCP Server

A Model Context Protocol server that exposes read-only GitHub tools to LLM clients, enabling browsing of open issues, pull requests, issue details, and recent repository activity via natural language.

Category
访问服务器

README

GitHub MCP Server

A small, working Model Context Protocol server that exposes read-only GitHub tools to an LLM client such as Claude Desktop. Built with the official mcp Python SDK (stdio transport) and direct GitHub REST calls via requests.

The design goal is a handful of tools that work end-to-end rather than a large stubbed-out surface: an LLM can browse a repo's open issues and PRs, drill into a specific issue's discussion, and summarize recent activity.

Tools

Tool What it returns
list_open_issues(repo, limit=10) Open issues with number, title, author, labels, URL
list_open_prs(repo, limit=10) Open PRs with the same fields plus source branch and draft status
get_issue(repo, issue_number) Full issue detail: body text plus up to 30 comments
search_repo_activity(repo, since_days=7) Recent commits, and issues/PRs opened or closed in the window

All tools take repo in owner/name form (e.g. python/cpython). GitHub API errors (bad repo names, 404s, rate limits, bad tokens) are caught and returned as a readable error message the model can act on, never a stack trace.

Setup

Requires Python 3.10+.

pip install -r requirements.txt

Optionally set a GitHub token — not required for public repos, but it raises the API rate limit from 60 to 5,000 requests/hour and enables private repos your token can see:

# PowerShell (current session)
$env:GITHUB_TOKEN = "ghp_your_token_here"

The token is only ever read from the environment — never hardcoded or written to disk.

Verify it works (before touching Claude Desktop)

Run the test script, which calls each tool function directly against a real public repo and also exercises the error paths:

python test_tools.py                        # defaults to modelcontextprotocol/python-sdk
python test_tools.py owner/some-other-repo  # or pick your own

You should see 6/6 checks passed.

Register in Claude Desktop

  1. Open the config file (create it if missing):

    • Windows: %APPDATA%\Claude\claude_desktop_config.json
    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  2. Add the server under mcpServers, using absolute paths for both the Python interpreter and server.py:

{
  "mcpServers": {
    "github": {
      "command": "C:\\Users\\jeswi\\AppData\\Local\\Python\\pythoncore-3.14-64\\python.exe",
      "args": ["C:\\Users\\jeswi\\OneDrive\\Documents\\Resume Project\\Github-MCP\\server.py"],
      "env": {
        "GITHUB_TOKEN": "ghp_your_token_here"
      }
    }
  }
}

The env block is how Claude Desktop passes the token to the server process; omit it entirely for anonymous access to public repos.

Use the real interpreter path, not the Windows Store alias. (Get-Command python).Source often returns ...\WindowsApps\python.exe, which is a shim that fails when launched as a subprocess. Get the true path with:

python -c "import sys; print(sys.executable)"
  1. Fully quit and restart Claude Desktop (system tray → Quit, not just closing the window).

  2. Confirm the connection: in a new chat, the tools icon (below the message box) should list the four github tools.

Example prompts

Prompts that naturally trigger each tool:

  • "What are the open issues in modelcontextprotocol/python-sdk right now?" → list_open_issues
  • "Are there any open pull requests in pallets/flask? Which ones are drafts?" → list_open_prs
  • "Summarize the discussion on issue #3307 in modelcontextprotocol/python-sdk." → get_issue
  • "How active has python/cpython been in the last two weeks? What got merged or closed?" → search_repo_activity
  • "Look at recent activity in anthropics/anthropic-sdk-python and tell me if any of the newly opened issues look like duplicates of each other." → search_repo_activity + get_issue

How it works

Claude Desktop ── stdio (JSON-RPC / MCP) ──> server.py ── HTTPS ──> api.github.com
  • server.py registers four plain Python functions as MCP tools; their docstrings become the tool descriptions the LLM reads when deciding what to call.
  • The server runs over stdio: Claude Desktop launches it as a subprocess and speaks MCP over stdin/stdout. No ports, no web server, no persistence.
  • Tool results are returned as structured JSON, so the model gets fields (number, author, labels, URL) rather than prose to parse.

Scope

Deliberately excluded: write operations (creating issues, commenting), OAuth flows, a web UI, and any database. This is a clean local demo of the MCP tool-serving pattern.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选