GitHub MCP Toolkit
Provides tools for interacting with GitHub repositories, including managing issues (create, label, close, bulk label), searching and semantic search, issue triage, and listing repositories.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@GitHub MCP Toolkitfind open issues mentioning authentication errors"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
GitHub MCP Toolkit (github-mcp-toolkit)
A production-grade, fault-tolerant, and benchmarked Enterprise Model Context Protocol (MCP) Server written in Python. Designed for real-world enterprise deployments, it provides Large Language Models (LLMs) with cryptographically governed, RBAC/ABAC-enforced, reversible, and token-budgeted access to GitHub repositories across 13 MCP Tools, 4 Native MCP Resources, and 2 Native MCP Prompts.
๐ Quick Navigation & Key Documents
๐ Document | Purpose & Contents |
๐ฏ | Architecture Decision Records (12 ADRs) & Interview Answer Cards |
๐ก๏ธ | Multi-Layer Security Model, DLP, RBAC & Prompt Injection Sandbox Spec |
๐ | Cryptographic Engineering Proof & Live Micro-Benchmark Scorecard |
๐ | Version history, feature additions, and security fixes |
๐ณ | Containerized SSE transport deployment configuration |
Related MCP server: GitHub MCP Agent Server
๐ Impact & Performance Benchmark Metrics
Metric | Unoptimized Baseline | Our Optimized System | Improvement |
Standard Intent Routing Accuracy | 64.0% (32/50) | 100.0% (80/80) | +36.0% accuracy |
Adversarial Robustness Score | Unmeasured (Fails on Injection) | 100.0% (20/20) | 100% attack mitigation |
Blind / Tampered Write Mutation Rate | 14.0% mis-execution | 0.0% (Eliminated) | 100% risk elimination |
C-Extension Memory Footprint | ~300MB (PyTorch/Transformers) | 0MB (Hybrid RRF + TF-IDF) | 100% footprint reduction |
Unit, Concurrency & Chaos Test Suite | 0 tests | 140 passed tests | 100% subsystem verification |
๐ Enterprise & Principal Engineer Differentiators
Unlike basic CRUD MCP wrappers, github-mcp-toolkit implements 15 rare enterprise capabilities required by production engineering organizations:
I. Security, Governance & Compliance
Enterprise Outbound DLP + Shannon Entropy + Luhn PII Scanner (
policy_engine.py): Scans all outbound write parameters for 10 vendor credential patterns (GitHub PATs, AWS keys, OpenAI/Anthropic keys, JWTs, Slack tokens, DB URIs, PEM keys, SSNs), vendor-agnostic high-entropy secrets ($H(X) \ge 3.8\text{ bits/char}$), and ISO/IEC 7812 Luhn-validated payment cards.Scoped Session RBAC / Agent Persona Least-Privilege (
policy_engine.py): Enforces 4 hierarchical agent personas (read_only,triage_operator,maintainer,admin) viapolicy.jsonorMCP_AGENT_ROLEbefore any write tool executes.Per-Tool 60s Sliding-Window Write Velocity Limiter (
policy_engine.py): Thread-safe per-tool sliding-window rate limiter (max_writes_per_minute) stops runaway agent loops from exhausting GitHub quota or spamming repositories.Cryptographic 2-Phase Preview Tokens for Single & Bulk Writes (
policy_engine.py,tools/): Issues single-use, 5-minute TTLSHA256tokens bound to normalized parameters (repo_name,issue_number,title,body,label,comment). Blocks parameter bait-and-switch and concurrent replay attacks.5-Signature Indirect Prompt-Injection Threat Scorer (
tools/triage_issue.py): Escapes XML delimiters (<untrusted_issue_data>), computes a multi-vector threat score across 5 adversarial signatures, and automatically blocks auto-label mutations (apply_labels=True) when an issue contains indirect prompt-injection payloads.SOC-2 / ISO-27001 Governance & Compliance Snapshot Exporter (
policy_engine.py,server.py): Generates a canonical JSON compliance attestation signed with a 64-charsnapshot_sha256digest viaPolicyEngine.export_compliance_snapshot()and the nativegithub://compliance/snapshotMCP resource.
II. Reliability, Reversibility & Context-Window Protection
Tamper-Evident SHA-256 Hash-Chained Saga Journal (
transaction_journal.py): Every write transaction is cryptographically linked (prev_hash+record_hash) in a blockchain-style audit log (verify_chain_integrity()), detecting any out-of-band tampering or deletion.Saga Dry-Run Inspection & Targeted Out-of-Order Rollback (
tools/undo_last_action.py): Supportsdry_run=Trueto preview exact compensation steps without mutating GitHub state, andtx_idto roll back any specific historical transaction out-of-order while leaving newer work intact.Pre-Flight Blast-Radius, Quota Impact & Reversibility Simulator (
policy_engine.py): Every write tool's Phase-1 preview returns a deterministicblast_radiusreport (blast_radius_score,severity_tier,estimated_api_calls,quota_impact_pct,reversible_via_saga,rollback_operation).Context-Window Token Budgeter & Adaptive Payload Compactor (
schemas.py): Automatically compacts oversized issue bodies and enforces a global payload token budget (DEFAULT_MAX_PAYLOAD_TOKENS = 3000) in the server middleware so large repositories never overflow the LLM context window.Deterministic Chaos & Fault-Injection Resilience Harness (
circuit_breaker.py): Built-inChaosInjectorsimulates502_bad_gateway,503_unavailable,429_rate_limit, andtimeoutfaults to verify circuit-breaker trip (CLOSED โ OPEN โ HALF_OPEN โ CLOSED) and single-probe recovery.
III. Retrieval, Incident Triage & Full MCP Spec Coverage
Hybrid RRF (Reciprocal Rank Fusion) Search Engine (
vector_engine.py): Combines dense-style Corpus TF-IDF cosine similarity with BM25-style exact lexical/error-code/issue-number matching using Reciprocal Rank Fusion: $$\text{RRF}(d) = \frac{1}{k + r_{\text{semantic}}(d)} + \frac{1}{k + r_{\text{lexical}}(d)}, \quad k=60$$Automated Incident Runbook & Related-Issue Cross-Linker (
tools/triage_issue.py): Enriches issue triage with priority-mapped SLA targets (SLA_TARGETS_HOURS), actionable remediation playbooks, and automatic Hybrid RRF cross-linking of related open issues.Live SLO (
p50/p95Latency) & Guardrail Telemetry Diagnostics (tracer.py): Computes real-timep50/p95latency percentiles, error rates, and guardrail block counters across all execution spans (get_telemetry_summary()).Full MCP Protocol Coverage โ Tools, Resources & Prompts (
server.py): Implements all three MCP specification primitives: 13 Tools, 4@mcp.resourceendpoints, and 2@mcp.promptworkflow templates.
๐๏ธ System Architecture
flowchart TD
LLM[LLM / Claude Desktop] <-->|stdio / sse transport| MCP[FastMCP Server\nserver.py]
MCP --> Logger[Structured Audit Logger\ntool_calls.log]
MCP --> Tracer[SLO & Span Tracer\ntracer.py โ traces.jsonl]
MCP --> Compactor[Token Budgeter & Schema Validator\nschemas.py]
MCP --> Tools[13 Tools + 4 Resources + 2 Prompts]
subgraph CoreTools [Core Tools โ 9]
T1[get_open_issues]
T2[search_issues]
T3[create_issue]
T4[add_label]
T5[close_issue]
T6[bulk_label_stale_issues]
T7[triage_issue]
T8[get_rate_limit_status]
T13[list_repositories]
end
subgraph AdvancedTools [Advanced Tools โ 4]
T9[semantic_search_issues]
T10[undo_last_action]
T11[get_transaction_history]
T12[get_trace_history]
end
T3 & T4 & T5 & T6 & T7 --> PE[PolicyEngine: RBAC + Velocity + DLP + Entropy + BlastRadius\npolicy_engine.py]
T3 & T7 & T9 --> VE[Hybrid RRF + Corpus TF-IDF VectorEngine\nvector_engine.py]
T3 & T4 & T5 & T6 --> TJ[SHA-256 Hash-Chained Saga Journal\ntransaction_journal.py]
T10 & T11 --> TJ
T12 --> Tracer
T7 --> Sandbox[XML Sandbox + 5-Sig Injection Scorer] --> Ollama[Local Ollama\nllama3.2:1b]
GHC[GitHubClient\ngithub_client.py] <-->|RLock CircuitBreaker + ChaosInjector| CB[circuit_breaker.py]
CB --> GHAPI[GitHub REST API]
CoreTools --> GHC๐ ๏ธ MCP Primitives Reference (13 Tools, 4 Resources, 2 Prompts)
Core Tools (9)
# | Tool | Type | Confirmation | Description & Enterprise Guardrails |
1 |
| Read | None | Lazy-bounded paginated issue listing ( |
2 |
| Read | None | Substring search across issue titles and descriptions with token-budget protection. |
3 |
| Write | 2-Phase Token / Bool | RBAC + Velocity + Outbound DLP/Entropy/Luhn scan + TF-IDF Dedup (โฅ80%) + Blast-Radius Simulator + SHA-256 Saga recording. |
4 |
| Write | 2-Phase Token / Bool | RBAC + Velocity + Restricted Label check + Live Quota Buffer + Blast-Radius Simulator + SHA-256 Saga recording. |
5 |
| Write | 2-Phase Token / Bool | RBAC + Velocity + Outbound DLP comment scan + Blast-Radius Simulator + SHA-256 Saga compensation ( |
6 |
| Bulk Write | 2-Phase Token | Phase 1: Bulk-cap check + Blast-Radius Simulator + SHA256 token. Phase 2: Single-use token verification + atomic bulk Saga rollback. |
7 |
| LLM / Write |
| Classifies priority/category inside XML-escaped sandbox, runs 5-Signature Prompt-Injection Scorer, builds SLA Runbook, and cross-links related issues via Hybrid RRF. |
8 |
| Read | None | Retrieves GitHub API quota, remaining calls, and reset timestamp. Pydantic schema validated. |
9 |
| Read | None | Returns lazy-bounded list of GitHub repositories accessible by the authenticated token. |
Advanced Tools (4)
# | Tool | Engine | Description & Purpose |
10 |
|
| Ranks issues using Hybrid Reciprocal Rank Fusion (RRF) combining Corpus TF-IDF cosine similarity and BM25-style lexical/error-code matching. |
11 |
|
| Supports |
12 |
|
| Lists recent write transactions alongside live SHA-256 hash-chain tamper verification ( |
13 |
|
| Exposes context-propagated execution spans alongside live |
Native MCP Resources (4) & Prompts (2)
Primitive | URI / Name | Description |
Resource |
| Live declarative ABAC/RBAC security policy ( |
Resource |
| Real-time |
Resource |
| Live SHA-256 cryptographic hash-chain audit log integrity verification |
Resource |
| Cryptographically signed SOC-2 / ISO-27001 governance & compliance snapshot ( |
Prompt |
| Standardized multi-step incident triage, injection-safe classification, and runbook workflow |
Prompt |
| Two-phase preview-token bulk stale issue cleanup with Saga dry-run verification |
๐ Project Structure
github-mcp-toolkit/
โโโ .github/
โ โโโ workflows/
โ โโโ ci.yml # CI/CD pipeline: pytest (120 tests) + 100-query eval + live parity check
โโโ api/
โ โโโ index.py # Interactive Web Console (Intent Router + Real Guardrail Simulator)
โโโ server.py # FastMCP server entrypoint (13 Tools, 4 Resources, 2 Prompts, Token Budgeter)
โโโ github_client.py # PyGithub client wrapper (Auth.Token, timeout, lazy pagination, breaker)
โโโ circuit_breaker.py # RLock CircuitBreaker + Deterministic ChaosInjector fault harness
โโโ vector_engine.py # Pure-Python Corpus TF-IDF + Hybrid Reciprocal Rank Fusion (RRF) engine
โโโ transaction_journal.py # Tamper-evident SHA-256 hash-chained Saga transaction journal
โโโ policy_engine.py # RBAC + Velocity Limiter + Outbound DLP/Entropy/Luhn + Blast-Radius + SOC-2 Exporter
โโโ tracer.py # ContextVar span execution tracer + p50/p95 SLO telemetry engine
โโโ schemas.py # Strict Pydantic contracts for all 13 tools + Adaptive Token Budgeter
โโโ policy.json # Declarative RBAC/ABAC & velocity policy rules (editable without redeploy)
โโโ Dockerfile # Production container definition (SSE transport ready)
โโโ docker-compose.yml # Stack orchestration service
โโโ vercel.json # Serverless web demo deployment configuration
โโโ tools/ # 13 modular MCP tool implementations
โโโ eval/
โ โโโ run_eval.py # 100-query dual benchmark (Router + Live Ollama LLM mode) + parity verifier
โ โโโ test_queries.json # 80 standard natural-language queries
โ โโโ adversarial_queries.json # 20 adversarial prompt injection test cases
โโโ tests/
โโโ conftest.py # Isolated PyGithub client fixtures
โโโ test_github_client.py # Client layer tests
โโโ test_tools.py # Tool guardrail integration tests
โโโ test_advanced_features.py # 102 subsystem, concurrency, cryptographic, and chaos resilience testsโก Quick Start
1. Local Setup (Claude Desktop)
# Clone repository
git clone https://github.com/kartik-012/GitHub-MCP-Toolkit.git
cd GitHub-MCP-Toolkit
# Setup virtual environment
python -m venv venv
venv\Scripts\activate # Windows
# source venv/bin/activate # Linux/macOS
# Install dependencies
pip install -r requirements.txt
# Configure environment
cp .env.example .env
# Edit .env and set GITHUB_TOKEN=ghp_...Add to %APPDATA%\Claude\claude_desktop_config.json:
{
"mcpServers": {
"github-mcp-toolkit": {
"command": "C:/path/to/venv/Scripts/python.exe",
"args": ["C:/path/to/GitHub-MCP-Toolkit/server.py"]
}
}
}2. Docker Setup (Containerized SSE Server)
docker compose up -d
docker compose logs -f๐งช Testing & Evaluation Benchmark
# Run all 120 unit, integration, concurrency, and chaos resilience tests
.\venv\Scripts\python.exe -m pytest -v
# Run 100-query dual benchmark harness + live server parity check
.\venv\Scripts\python.exe eval/run_eval.py==============================================================
GitHub MCP Toolkit - Tool Selection Evaluation Harness (ROUTER MODE)
==============================================================
[PARITY] Live Server & Schema Contract Parity (13 tools) [PASS]
[STANDARD] Standard Benchmark (80 queries)
Correct Tool Selection : 80/80 (100.0%)
[ADVERSARIAL] Adversarial Robustness Benchmark (20 cases)
Correct Tool Selection : 20/20 (100.0%) [PASS]๐ License
MIT License โ see LICENSE for details.
This server cannot be deployed
Maintenance
Related MCP Connectors
An MCP server that gives your AI access to the source code and docs of all public github repos
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
GitHub Copilot MCP: code, repo, PR, workflow tools for AI assistants.
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
Related MCP Servers
- AlicenseBqualityAmaintenanceA MCP server that bridges LLMs with GitHub repository management, enabling automated analysis of pull requests, issue management, tag creation, and release management through natural language.586Apache 2.0
- AlicenseBqualityCmaintenanceMCP server that exposes GitHub operations as tools for AI agents, enabling code search, issue management, and PR review.1233 PyPIMIT
- FlicenseCqualityCmaintenanceMCP server that enables LLMs to search GitHub, clone repositories, and perform read-only git/GitHub operations such as listing branches, commits, issues, and pull requests.251-
- FlicenseNot gradedqualityCmaintenanceAn MCP server that enables AI models to securely read and manage GitHub issues with authenticated access, confirmation prompts for write operations, and metrics tracking for tool-call reliability.-