GitHub MCP Server
Connects to authenticated GitHub data via the GitHub REST API, providing tools for listing repositories, viewing open issues and pull requests, counting open issues across repositories, summarizing repository activity, detecting stale issues, and safely creating issues or adding labels after dry-run confirmation.
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 Servershow me the open issues labeled bug in my repo"
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 Server
A Model Context Protocol (MCP) server connecting AI assistants to authenticated GitHub data — repositories, issues, pull requests, and stale-backlog detection — via the GitHub REST API.
MCA Minor Project · VIPS-TC, GGSIPU, Delhi
Architecture
┌──────────────────────────────────────────────────────┐
│ LOCAL MACHINE │
│ │
│ ┌──────────────┐ stdio (JSON-RPC) ┌──────────┐ │
│ │ MCP Client │ ◄══════════════════► │ server │ │
│ │ (Inspector) │ │ .py │ │
│ └──────────────┘ └────┬─────┘ │
│ │ │
│ HTTPS (REST) │
└─────────────────────────────────────────────┼───────┘
▼
┌─────────────────┐
│ api.github.com │
└─────────────────┘Design Principles
Principle | Implementation |
Read-only first | 5 of 7 tools are strictly read-only |
Safe writes |
|
Least privilege | Fine-grained PAT scoped to Issues + PRs + Metadata |
Protocol integrity | All logging → |
Related MCP server: GitHub MCP Server
Tools
# | Tool | Mode | Description |
1 |
| Read | Authenticated user's repositories with stars, forks, visibility |
2 |
| Read | Open issues for a repo; optional label filter; excludes PRs |
3 |
| Read | Cross-repo open-issue count via GitHub Search API |
4 |
| Read | Dashboard: repo metrics + recent commits + open PRs |
5 |
| Read | Issues with no activity for N days |
6 |
| Write | Creates issue after dry-run preview and explicit confirmation |
7 |
| Write | Adds labels to issue after dry-run preview and confirmation |
Setup
Prerequisites
Python 3.10+
A GitHub account with a fine-grained Personal Access Token
Install
git clone https://github.com/pranjay6667/github-mcp-server.git
cd github-mcp-server
python -m venv .venv
.venv\Scripts\activate # Windows
# source .venv/bin/activate # macOS / Linux
pip install -r requirements.txtConfigure Token
Create a fine-grained token at github.com/settings/personal-access-tokens/new
Permissions: Issues (Read & Write), Pull Requests (Read), Metadata (Read)
Copy
.env.example→.envand paste your token:GITHUB_TOKEN=github_pat_...
Usage
MCP Inspector (recommended for testing)
mcp dev server.pyOpens a browser UI at localhost:6274 with all 7 tools ready to invoke.
Claude Desktop
Add to %APPDATA%\Claude\claude_desktop_config.json:
{
"mcpServers": {
"github": {
"command": "C:\\path\\to\\.venv\\Scripts\\python.exe",
"args": ["C:\\path\\to\\server.py"]
}
}
}Restart Claude Desktop. The tools icon will show 7 tools.
Testing
python tests/test_tools.py # All 7 tools against live API
python tests/test_safety.py # Dry-run vs confirmed execution
python tests/test_protocol.py # MCP JSON-RPC handshakeEvaluation
A 50-question benchmark (evaluation/questions.csv) across English, Hindi, and Hinglish tests tool-routing accuracy:
Round | Accuracy | Notes |
Round 1 (naive prompts) | 90.0% (45/50) | Boundary ambiguity in cross-repo queries |
Round 2 (refined prompts) | 98.0% (49/50) | Scope guards + negative constraints added |
Run the benchmark:
python evaluation/evaluate.pyProject Structure
github-mcp-server/
├── server.py # MCP server — 7 tool definitions
├── github_client.py # GitHub REST API client
├── config.py # Token loader from .env
├── requirements.txt
├── .env.example
├── tests/
│ ├── test_tools.py # Tool integration tests
│ ├── test_safety.py # Dry-run confirmation tests
│ └── test_protocol.py # MCP handshake test
├── scripts/
│ └── seed_test_data.py # Creates sample issues/labels
├── evaluation/
│ ├── questions.csv # 50-question benchmark
│ ├── evaluate.py # Benchmark runner
│ └── results.csv # Round 1 & 2 results
└── docs/
├── PROJECT_REPORT.md
├── PPT_OUTLINE.md
├── DEMO_SCRIPT.md
├── VIVA_QUESTIONS.md
└── INTERVIEW_PITCH.mdSecurity
No hardcoded credentials — token loaded from
.envviaconfig.py.envin.gitignore— never committedLeast privilege — PAT scoped to metadata, issues, and PRs only
No destructive tools — no deletion or repo-level mutation
Dry-run by default — write tools preview before executing
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Operate GitHub from your AI assistant: repos, PRs, issues, Actions. Previews and read-only mode.
Access the GitHub API, enabling file operations, repository management, search functionality, and…
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Read and write KukGit repositories, files, issues and pull requests from an AI assistant.
Related MCP Servers
- AlicenseAqualityNot gradedmaintenanceEnables AI agents to interact with GitHub repositories through the GitHub REST API for managing files, issues, and repository metadata. It supports both read operations like searching code and write operations such as creating repositories and updating issue comments.9-
- FlicenseCqualityDmaintenanceEnables AI assistants to interact with GitHub repositories via the REST API, supporting repository listing, detail retrieval, and issue management.2-
- FlicenseBqualityDmaintenanceEnables AI clients to interact with GitHub repositories, issues, pull requests, and code search through the GitHub REST API.12-
- FlicenseNot gradedqualityBmaintenanceEnables AI assistants to interact with GitHub through the GitHub REST API, supporting repository, file, issue, pull request, branch, commit, search, and label operations with explicit confirmation for write operations.-