GitHub MCP Server
Lets agents interact with GitHub: list and inspect repositories, issues, pull requests, branches, commits, labels, and files; read file contents; list workflow runs; and create or update issues, comments, pull requests, branches, labels, and files.
Lets agents list GitHub Actions workflow runs for a repository.
Click on "Install 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 open issues in microsoft/vscode"
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 project that lets an AI assistant talk to GitHub using safe, structured tools.
In plain words: instead of the AI guessing how GitHub works, this project gives it a clear menu of actions — like “list my repos”, “show open issues”, or “read a file”. The AI picks the right action, this server talks to GitHub, and the answer comes back in a clean format the AI can understand.
What problem does this solve?
Chatbots are good at language, but they do not automatically have live access to your GitHub account.
This project builds a bridge:
You ask something in normal English (“Show open issues in microsoft/vscode”).
An AI model (via Groq) decides which GitHub tool to use.
The MCP server runs that tool against the real GitHub API.
Results are cleaned up (normalized) and returned to the AI.
The AI explains the result to you in simple language.
MCP means Model Context Protocol. Think of it as a standard plug: any compatible AI client can connect to this server and use its tools.
Related MCP server: GitHub MCP Server
Big picture (architecture)
You
↓
AI Agent (client/agent.py) ← talks to Groq LLM
↓
MCP Server (notebooks/server.py) ← menu of GitHub tools
↓
GitHub Client ← HTTP calls with your token
↓
GitHub REST API
↓
GitHubDesign rule (important)
Tools stay thin:
Check the input (is the repo name valid?).
Call the GitHub client.
Normalize the response into a stable shape.
Return that clean data to the agent.
All messy GitHub details stay inside the client layer — not scattered across tools.
Project folders (what each part is for)
Path | What it is |
| Main MCP server — the production entrypoint the agent starts |
| Stable data shapes (Pydantic models) for agents |
| Converts raw GitHub JSON → those stable shapes |
| Confirm / dry-run / allowlist for dangerous tools |
| Page helpers for list tools ( |
| JSON logs to stderr (never prints secrets) |
| Older/experimental copy — prefer |
| Learning notebook (how the server was built step by step) |
| Chat agent that connects to the MCP server over stdio |
| Checks whether the AI picks the right tool for sample prompts |
| Your private keys (never commit this) |
| Template showing which keys you need |
| Python packages to install |
| Step-by-step setup for non-technical users |
What you can do with the tools
The server exposes many GitHub actions. Grouped simply:
Read (safe to explore)
List your repositories
Get repo details
List / get issues and pull requests
Get PR diffs
List branches, commits, labels
Search code in a repo
Read file contents
List GitHub Actions workflow runs
Write (changes GitHub)
Create issues, comments, PRs, branches, labels
Update issues, add/remove labels
Reopen issues
Destructive (can hurt things — protected)
These need extra confirmation by default:
merge_pull_requestdelete_filecreate_repositorycreate_or_update_fileclose_issue
For these, the agent should usually:
Call with
dry_run=true→ preview onlyCall again with
confirm=true→ actually do it
You can tighten or loosen this with environment settings (see below).
Normalized responses (why agents like this)
Raw GitHub responses are huge and change often. This project returns stable shapes.
List tools always look like:
{
"count": 20,
"items": [ ... ],
"page": 1,
"per_page": 20,
"has_next": true,
"has_prev": false,
"next_page": 2,
"prev_page": null,
"last_page": 5
}To get the next page, call the same tool again with page=2 (or page=next_page).
Issue example:
{
"number": 42,
"title": "Bug in login",
"state": "open",
"author": "some-user",
"labels": ["bug"],
"comments": 3,
"html_url": "https://github.com/...",
"is_pull_request": false
}Also: get_issues filters out pull requests (GitHub’s issues API mixes them in).
Safety features
Feature | Meaning |
| Required to run destructive tools (default mode) |
| Shows what would happen; does not change GitHub |
| MCP annotation so clients know a tool is risky |
Allowlist | Optional list of which destructive tools are even allowed |
Mode |
|
Environment variables (optional):
GITHUB_MCP_DESTRUCTIVE_MODE=confirm
GITHUB_MCP_DESTRUCTIVE_ALLOWLIST=merge_pull_request,delete_fileLogging (for debugging)
The server writes JSON logs to stderr only.
Why stderr? MCP uses stdout for the protocol. If we printed logs there, the AI connection would break.
Logs include things like:
request method and path
HTTP status
duration
rate-limit remaining
They never log:
your GitHub token
Authorization headers
secret-looking values (PATs, bearer tokens, etc.)
Example log line:
{"ts":"2026-08-23T12:00:00+00:00","level":"INFO","event":"github_request","method":"GET","path":"/repos/microsoft/vscode/issues","status_code":200,"duration_ms":120.5}The AI agent (client/agent.py)
The agent:
Starts the MCP server as a subprocess (
notebooks/server.py).Asks the server for the tool list.
Sends your question + tools to Groq.
If Groq wants a tool, the agent calls it through MCP.
Sends the tool result back to Groq for a final answer.
Useful commands (from the project folder, with the virtual environment active):
# See all registered tools
python client/agent.py --list-tools
# Only show which tool the AI would pick (no GitHub write)
python client/agent.py --dry-run "list my github repos"
# One real question, then exit
python client/agent.py --once "show open issues for microsoft/vscode"
# Interactive chat
python client/agent.py
# Check tool-picking quality on many sample prompts
python client/test_tool_picking.pyLoop limits (optional):
python client/agent.py --max-rounds 5 --once "..."Or in .env:
AGENT_MAX_TOOL_ROUNDS=8
AGENT_MAX_TOOL_CALLS=16
AGENT_MAX_CONSECUTIVE_ERRORS=3Environment variables
Required for the MCP server
Variable | Purpose |
| Personal access token so the server can call GitHub |
| Your GitHub username (used at startup validation) |
| A default repo name (used at startup validation) |
Required for the agent (chat / tool picking)
Variable | Purpose |
| API key for Groq (LLM) |
Optional
Variable | Purpose |
| Default: |
|
|
| Comma-separated destructive tool names |
| Max tool rounds per user message |
| Max tool executions per user message |
| Stop after N tool failures in a row |
Copy .env.example → .env and fill in real values. See SETUP.md for the full walkthrough.
Tech stack (for the curious)
Python 3.13+ (project was developed on 3.13)
MCP (
mcpPython package) — tool server protocolhttpx — HTTP client for GitHub
Pydantic — schemas / validation
python-dotenv — load
.envOpenAI-compatible client → Groq for the agent
Jupyter (optional) — the learning notebook
How to set up and run
Follow the friendly guide:
👉 SETUP.md — install Python, create keys, configure .env, and run your first commands.
Short version (if you already know Python):
cd "path\to\Github-MCP-server"
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt
copy .env.example .env
# edit .env with your tokens
python client/agent.py --list-tools
python client/agent.py --once "list my github repos"Learning path (recommended)
Read this README (you are here).
Complete SETUP.md until
--list-toolsworks.Read docs/ARCHITECTURE_HLD_LLD.md for HLD + LLD flows.
Try
--dry-runand--oncewith simple read-only questions.Run the 50-scenario manual test plan: tests/MANUAL_TESTING_50_SCENARIOS.md
Auto picking:
python client/run_manual_scenarios.py
Open
notebooks/01_github_mcp_server.ipynbto see how each layer was built.Only then try write/destructive tools with
dry_run+confirm.
Troubleshooting (quick)
Problem | Likely fix |
| Activate |
Groq model 404 | Set |
Missing env vars | Fill |
Destructive tool blocked | Expected — use |
Agent hangs on exit (Windows) | Known stdio quirk; one-shot commands force-exit after finishing |
Security reminders
Never commit
.env.Never paste your GitHub or Groq tokens into chat, screenshots, or GitHub issues.
Prefer a GitHub token with only the scopes you need.
Keep
GITHUB_MCP_DESTRUCTIVE_MODE=confirm(ordeny) unless you fully trust the environment.Do not share
server_1.pydebug output if it ever printed tokens in older experiments — useserver.py.
License / ownership
This is a personal / learning Gen-AI project for a GitHub MCP server and agent. Adjust ownership and license as needed before publishing publicly.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to manage GitHub repositories, branches, issues, pull requests, releases, and actions through natural language.1155MIT
- FlicenseNot gradedqualityBmaintenanceEnables AI assistants to perform GitHub operations such as creating repositories, issues, pull requests, and more through natural language.
- FlicenseBqualityDmaintenanceEnables AI assistants to inspect local Git repositories and interact with the GitHub API for reading commits, diffs, files, issues, comments, pull requests, and project boards.10121
- FlicenseBqualityCmaintenanceEnables AI clients to interact with GitHub repositories, issues, pull requests, and code search through the GitHub REST API.12
Related MCP Connectors
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Connect AI assistants to your GitHub-hosted Obsidian vault to seamlessly access, search, and analy…
Git-backed platform for skills, tools, and context for AI agents
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Arnab1999india/github-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server