GitHub MCP Server
Provides tools for interacting with GitHub, including creating repositories, issues, pull requests, listing commits, searching repositories, and managing repository settings.
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 ServerCreate an issue in repo: add tests for auth"
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 production-ready Model Context Protocol (MCP) server that exposes GitHub operations as AI-callable tools. Compatible with Claude Desktop, Cursor, VS Code agents, ChatGPT MCP clients, and any other MCP-compliant AI assistant.
Features
Tool | Description |
| Create a new GitHub repo |
| Fetch repo details |
| List your repos (public/private/all) |
| Search GitHub by keyword/topic/language |
| Delete a repo (irreversible) |
| Open an issue with labels & assignees |
| List open/closed issues |
| Close an issue by number |
| Show latest commits |
| Open a PR between branches |
| List open/closed PRs |
| Show authenticated user info |
Related MCP server: GitHub MCP Tools
Tech Stack
Python 3.11+ with FastMCP for MCP tool registration
GitHub REST API v3 for all GitHub operations
OAuth 2.0 (GitHub OAuth Apps) for user authentication
FastAPI for the OAuth callback HTTP server
SQLAlchemy + SQLite (or PostgreSQL) for token & audit storage
Pydantic v2 for schema validation
Docker + docker-compose for containerised deployment
Project Structure
github-mcp-server/
├── app/
│ ├── main.py # FastAPI app + MCP entry point
│ ├── tools.py # MCP tool definitions (@mcp.tool)
│ ├── auth.py # OAuth 2.0 flow + token resolution
│ ├── github.py # GitHub REST API v3 client
│ ├── database.py # SQLAlchemy models + helpers
│ ├── schemas.py # Pydantic request/response models
│ ├── config.py # Settings via pydantic-settings
│ └── utils.py # Shared helpers
├── tests/
│ ├── test_tools.py # MCP tool unit tests
│ ├── test_auth.py # Auth / token tests
│ └── test_github.py # GitHub API client tests
├── .env # Environment variables (copy from this file)
├── requirements.txt
├── Dockerfile
├── docker-compose.yml
└── README.mdQuick Start
1. Clone & install
git clone https://github.com/yourname/github-mcp-server
cd github-mcp-server
pip install -r requirements.txt2. Configure environment
cp .env .env.local # edit with your valuesMinimum required variables:
GITHUB_TOKEN=ghp_your_personal_access_token # easiest for dev
# OR set up a GitHub OAuth App and fill in:
GITHUB_CLIENT_ID=...
GITHUB_CLIENT_SECRET=...Create a GitHub OAuth App at: GitHub → Settings → Developer settings → OAuth Apps → New OAuth App
Homepage URL:
http://localhost:8000Callback URL:
http://localhost:8000/auth/callback
3. Run
HTTP mode (OAuth server + health endpoints):
python -m app.main
# Open http://localhost:8000/docs for the Swagger UIMCP stdio mode (for Claude Desktop / Cursor / VS Code):
python -m app.main stdio4. Run tests
pytest tests/ -vClaude Desktop Integration
Add to your claude_desktop_config.json:
{
"mcpServers": {
"github": {
"command": "python",
"args": ["-m", "app.main", "stdio"],
"cwd": "/path/to/github-mcp-server",
"env": {
"GITHUB_TOKEN": "ghp_your_token_here"
}
}
}
}Then ask Claude:
"Create a repository named portfolio-website"
"Create a bug issue in portfolio-website: login button broken"
"Show latest commits from portfolio-website"
"Create a pull request from feature/login to main"
"List open issues in my repository"
"Search repositories related to LangGraph"
Docker
# Build and start
docker-compose up --build
# Run with Postgres instead (uncomment db service in docker-compose.yml):
# DATABASE_URL=postgresql://mcp:secret@db:5432/github_mcpAPI Endpoints (HTTP mode)
Method | Path | Description |
|
| Server info |
|
| Health check |
|
| List registered MCP tools |
|
| Redirect to GitHub OAuth |
|
| OAuth callback (GitHub redirects here) |
|
| Check if a user is authenticated |
|
| Swagger UI |
Authentication Modes
Mode | When to use |
PAT (Personal Access Token) | Development, single-user, CI/CD |
OAuth 2.0 | Multi-user deployments, shared servers |
The server resolves tokens in this order:
DB-stored OAuth token for the given
loginGITHUB_TOKENenv var (PAT)
Database
SQLite by default (zero config). Switch to Postgres by changing DATABASE_URL:
DATABASE_URL=postgresql://user:password@localhost:5432/github_mcpTables created automatically on startup:
token_store— OAuth tokens keyed by GitHub loginaudit_log— Lightweight tool call history
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.
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/nitesh-kumar-pandey/github-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server