mcp-github-tool-eval
Enables users to read and manage GitHub repositories through MCP, with destructive operations gated behind explicit confirmation and dry-run previews.
README
GitHub Model Context Protocol (MCP) Server with Tool-Calling Evaluation
A production-grade FastMCP GitHub server exposing read and confirm-gated write operations, paired with a 30-case evaluation harness scoring tool selection, argument accuracy, and destructive confirmation safety.
Executive Summary & Evaluation Matrix
LLM agent tool-calling requires strict safety boundaries. This MCP server enforces server-level confirmation gating on all mutating actions: unconfirmed requests return dry-run previews rather than executing mutations on GitHub.
Benchmark Performance (30 Labeled Scenarios)
Evaluated against a 30-case benchmark testing standard tool calls, underspecified/ambiguous queries, and destructive confirm-gated actions:
| Metric | Pass 1 (Zero-Shot) | Pass 3 (Optimized) |
|---|---|---|
| Tool Selection Accuracy | 76.7% (23/30) | 90.0% (27/30) |
| Argument Accuracy (given correct tool) | 52.6% (10/19) | 100.0% (19/19) |
| Confirmation Flag Accuracy (destructive) | 50.0% (3/6) | 100.0% (7/7) |
| — Standard Tool Selection Category | 100.0% (8/8) | 100.0% (8/8) |
| — Error / Destructive Action Category | 90.9% (10/11) | 90.9% (10/11) |
| — Ambiguous / Missing-Arg Category | 25.0% (2/8) | 75.0% (6/8) |
Tool Architecture & Operations
flowchart TD
A[User Request] --> B[LLM Tool-Calling Engine]
B --> C{Tool Category}
C -- Read Tool --> D[Execute GitHub API Call Directly]
D --> E[Return API Payload]
C -- Write / Destructive --> F{confirm == true ?}
F -- Yes --> G[Execute State Mutation on GitHub]
G --> H[Return Success / Number / URL]
F -- No --> I[Return Dry-Run Preview of Mutation]
Available Tools
Read Operations (Immediate Execution)
list_issues(owner, repo, state): List open/closed issues in a repository.get_issue(owner, repo, issue_number): Retrieve detailed metadata for a single issue.list_pull_requests(owner, repo, state): List pull requests in a repository.get_pull_request(owner, repo, pr_number): Retrieve details and mergeability for a PR.search_code(query, owner, repo): Search GitHub codebase globally or scoped to a repository.
Destructive Operations (Confirm-Gated)
create_issue(owner, repo, title, body, confirm=False): Creates an issue only when confirmed; returns preview otherwise.close_issue(owner, repo, issue_number, confirm=False): Closes an issue only when confirmed; returns preview otherwise.add_comment(owner, repo, issue_number, body, confirm=False): Comments on an issue/PR only when confirmed; returns preview otherwise.merge_pull_request(owner, repo, pr_number, confirm=False): Merges a PR only when confirmed; returns preview otherwise.
Project Structure
├── app/
│ ├── __init__.py # Public MCP server & client exports
│ ├── server.py # FastMCP server definition & tool routing
│ └── github_client.py # GitHub REST API client with dry-run previews
├── eval/
│ ├── __init__.py # Evaluation package
│ ├── tool_schemas.py # OpenAI-compatible function definitions & prompt
│ ├── test_set.json # 30 labeled evaluation test cases
│ └── run_eval.py # Benchmark harness scoring tool, args, and confirm flags
├── requirements.txt # Dependencies (mcp, requests, openai)
├── WRITEUP.md # Detailed evaluation report & iteration analysis
└── README.md
Quickstart & Usage
1. Installation
git clone https://github.com/vishalmurugan1986/github-mcp-server.git
cd github-mcp-server
pip install -r requirements.txt
2. Environment Configuration
export NVIDIA_API_KEY="nvapi-your-key-here"
# Optional: real GitHub write access
export GITHUB_TOKEN="ghp_your_personal_access_token"
3. Running the MCP Server
python -m app.server
Connect an MCP client (such as Claude Desktop or custom agents) over standard I/O.
4. Running the Tool-Calling Evaluation Suite
python -m eval.run_eval
Results are saved to eval/results.json and printed with full metric breakdowns.
Safety Design Principles
- Defense-in-Depth Confirmation: Rather than relying purely on prompt instructions, confirmation guards are hardcoded directly in
app/github_client.py. An unconfirmed request cannot cause an accidental mutation. - Ambiguity Rejection: The model is instructed to refuse execution and ask clarifying questions whenever repositories, issue numbers, or parameters are unspecified, avoiding placeholder hallucinations.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。