GitHub MCP Agent Server
Provides tools for interacting with GitHub's API, enabling AI agents to search code, manage issues, create pull requests, and perform code reviews on GitHub repositories.
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 Agent Serverlist open issues in FMorgan-111/github-mcp-server"
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 Agent Server
MCP server giving AI agents controlled GitHub access with policy guard and audit trail.
Architecture
┌───────────────┐ MCP stdio ┌───────────────────┐
│ AI Agent │ ◄──────────────────────► │ GitHub MCP Server │
│ (Claude, Codex│ JSON-RPC 2.0 │ │
│ or any MCP │ ┌─┴───────────────┐ │
│ client) │ │ Policy Guard │ │
└───────────────┘ ├─────────────────┤ │
│ Audit Log │ │
└─────────────────┘ │
┌──────────────────────────────────────────────┐ │
│ github_client.py │ │
│ (httpx) │ │
│ GitHub API │ │
└──────────────────────────────────────────────┘ │
┌──────────────────────────────────────────────┐ │
│ Review Engine (ruff + regex) │ │
└──────────────────────────────────────────────┘ │
└───┘Related MCP server: @cloud9-labs/mcp-github
Features & Tools
Tool | Description | Example Input | Example Output |
| Search GitHub repo code by query |
| List of matching files with paths & URLs |
| List open or closed issues |
| Formatted list of issues |
| Create a new issue (policy-guarded) |
| Confirmation with issue URL |
| Fetch raw diff of a pull request |
| Unified diff as text |
| Create a pull request between branches |
| Confirmation with PR URL |
| Run local automated code review rules |
| List of warnings and errors found |
| Post review findings as PR comments |
| Number of comments posted |
| Read a file from a repository |
| Decoded file content with metadata |
| Create or update a single file (guarded) |
| Commit SHA and URL |
| Push multiple files as a single commit |
| Commit SHA and file list |
| Comment on an issue or pull request |
| Comment URL |
| Merge a pull request |
| Merge status and SHA |
Security Model
Repository Allowlist: Only repositories explicitly allowed by policy can be accessed.
Branch Protection: PRs to protected branches are subject to branch protection rules before merging.
Dry-Run Mode: Execute operations without side effects for safe testing and auditing.
Audit Logging: All actions logged in JSONL format with precise timestamps to maintain traceability.
Policy Configuration: Start from
policy.example.jsonto configure repository allowlists and protected branches.
FAQ
Why not call the GitHub API directly?
Direct API calls lack centralized policy enforcement, audit logging, and uniform tooling support for AI agents. This MCP server adds a controlled, auditable layer for safer automation.
What MCP clients work with this?
Agents like Claude Code, OpenAI Codex, and any client supporting the MCP JSON-RPC 2.0 transport can connect to this server.
How is this different from the official GitHub MCP server?
This project's key differentiator is policy enforcement. Repository allowlists prevent agents from touching unauthorized repos, branch protection blocks accidental PRs to sensitive branches, dry-run mode supports safe validation, and write actions are audit-logged with timestamps.
Quick Start
Prerequisites
Python 3.10+
GitHub personal access token with
reposcope
Install
pip install fastmcp httpx python-dotenvConfigure and Run
git clone https://github.com/FMorgan-111/github-mcp-server.git
cd github-mcp-server
cp .env.example .env && nano .env
python3 -m src.mainConnect with Claude Code
claude mcp add github-agent -- python3 /path/to/github-mcp-server/src/main.pyDevelopment
pip install -e . --break-system-packages
python3 -m pytest tests/ -v
python3 -m src.main106 tests, all passing.
Docker Deployment
docker build -t github-mcp-server .
docker run \
-e GITHUB_TOKEN=ghp_your_token_here \
-i github-mcp-serverThe -e GITHUB_TOKEN=... flag passes the token into the container because
the local .env file is not copied into the image.
License
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- 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/FMorgan-111/github-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server