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 (Model Context Protocol) server that exposes GitHub operations as tools for AI agents — Claude Code, Codex, and any MCP-compatible client.
Features
Tool | Description |
| Search GitHub repositories for code |
| List open/closed issues in a repository |
| Create a new GitHub issue |
| Fetch the raw diff of any pull request |
| Create a pull request between branches |
| Automated code review via local rules (no API call) |
Quick Start
1. Prerequisites
Python 3.10+
A GitHub personal access token with
reposcope
2. Install
pip install fastmcp httpx python-dotenv3. Configure
git clone https://github.com/FMorgan-111/github-mcp-server.git
cd github-mcp-server
echo "GITHUB_TOKEN=ghp_your_token_here" > .env4. Run
python -m src.main5. Connect to your AI agent
Claude Code:
claude mcp add github-agent -- python3 /path/to/github-mcp-server/src/main.pyOr via Claude Desktop / Cursor config:
{
"mcpServers": {
"github-agent": {
"command": "python3",
"args": ["/path/to/github-mcp-server/src/main.py"],
"env": {
"GITHUB_TOKEN": "ghp_your_token_here"
}
}
}
}Then ask your AI:
"List open issues in FMorgan-111/github-mcp-server" "Search for 'FastMCP' in my repo" "Review PR #1 in this repo"
Tool Reference
search_code(query, repo)
Search code within a GitHub repository.
Parameters:
query(str, required) — Search queryrepo(str, optional) — Repository inowner/repoformat
Returns: Formatted list of matching files with paths and URLs.
list_issues(repo, state)
List issues in a repository.
Parameters:
repo(str, required) — Repository inowner/repoformatstate(str, optional) —"open"(default) or"closed"
create_issue(repo, title, body)
Create a new issue.
Parameters:
repo(str, required) — Repository inowner/repoformattitle(str, required) — Issue titlebody(str, required) — Issue body text
get_pr_diff(repo, pr_number)
Fetch the raw diff of a pull request.
Parameters:
repo(str, required) — Repository inowner/repoformatpr_number(int, required) — Pull request number
create_pr(repo, title, body, head, base)
Create a pull request.
Parameters:
repo(str, required) — Repository inowner/repoformattitle(str, required) — PR titlebody(str, required) — PR descriptionhead(str, required) — Source branch namebase(str, required) — Target branch name (e.g."main")
review_pr_diff(repo, pr_number)
Fetch a PR diff and run local code review rules. No API call — all analysis is local.
Rules checked:
⚠️
print()statements in non-test files⚠️
TODO/FIXME/HACKcomments❌ Hardcoded secrets (passwords, API keys, tokens)
❌ Bare
except:clauses (should specify exception type)⚠️ Functions over 80 lines
Architecture
┌─────────────────┐ MCP stdio transport ┌──────────────────────┐
│ Claude Code │ ◄─────────────────────────► │ GitHub MCP Server │
│ Codex │ JSON-RPC 2.0 messages │ │
│ Any MCP client │ │ ┌────────────────┐ │
└─────────────────┘ │ │ github_client │ │
│ │ (httpx) │ │
│ │ → GitHub API │ │
│ └────────────────┘ │
│ ┌────────────────┐ │
│ │ review.py │ │
│ │ local rules │ │
│ └────────────────┘ │
│ ┌────────────────┐ │
│ │ config.py │ │
│ │ .env / env │ │
│ └────────────────┘ │
└──────────────────────┘Development
# Clone and install
git clone https://github.com/FMorgan-111/github-mcp-server.git
cd github-mcp-server
pip install -e . --break-system-packages
# Run tests
python -m pytest tests/ -v
# Start MCP server (stdio mode)
python -m src.main
# Test with MCP Inspector
# https://github.com/modelcontextprotocol/inspectorDeployment
Docker
docker build -t github-mcp-server .
docker run -e GITHUB_TOKEN=ghp_your_token_here -i github-mcp-serverSmithery (MCP Registry)
Deploy to Smithery for one-click install into any MCP client.
License
MIT
This server cannot be installed
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
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