github-mcp
Provides tools for managing GitHub repositories, branches, issues, pull requests, collaborators, releases, gists, and searching repositories.
Enables listing, triggering, and inspecting GitHub Actions workflow runs.
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-mcplist my recent pull requests"
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 that wraps the GitHub CLI (gh) to provide 39 tools across 12 categories β manage repos, branches, issues, PRs, workflows, collaborators, and more, directly from Claude Desktop or Claude Code.
π Features
Repository Management β Create, clone, list, view, and delete repos
Git Operations β Add, commit, push, pull, init + push in one command
Branch Management β Create, list, switch, and delete branches
Forking β Fork repos and sync forks with upstream
Issues β Create, list, and comment on issues
Pull Requests β Create, list, comment, merge, review, and diff PRs
Collaborators β List and add collaborators to repos
File Operations β Read and create/update files via the GitHub API
Workflows β List, trigger, and inspect GitHub Actions workflow runs
Releases β Create and list releases
Gists β Create gists from content
Search β Search repositories across GitHub
Security β Path sandboxing, input validation, read-only mode, audit logging
Remote Access β SSE transport with OAuth 2.0 authentication via ngrok tunnel
Related MCP server: Git MCP
π¦ Prerequisites
1. Install GitHub CLI
# macOS
brew install gh
# Ubuntu/Debian
sudo apt install gh
# Windows
winget install GitHub.cli2. Authenticate
gh auth login
gh auth status # Verify you're logged in3. Python 3.10+
python --version # Must be 3.10 or higherπ§ Installation
# Clone the repository
git clone https://github.com/prateekaryann/github-mcp.git
cd github-mcp
# Create virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txtπ Usage β Local (stdio)
This is the simplest setup. Claude Desktop or Claude Code launches the server as a subprocess.
Claude Desktop
Add to your claude_desktop_config.json:
OS | Config path |
macOS |
|
Windows |
|
Linux |
|
{
"mcpServers": {
"github": {
"command": "python",
"args": ["/path/to/github-mcp/server.py"],
"cwd": "/path/to/github-mcp"
}
}
}Restart Claude Desktop after adding the configuration.
Claude Code
claude mcp add github -- python /path/to/github-mcp/server.pyπ Usage β Remote (SSE + OAuth)
For remote access, the server runs an SSE endpoint with OAuth 2.0 authentication, exposed via an ngrok tunnel.
Step 1: Start an ngrok tunnel
ngrok http 8080
# Note the HTTPS forwarding URL, e.g. https://abc123.ngrok-free.appOr use the included helper scripts:
# Linux/macOS
./tunnel.sh
# Windows (PowerShell)
.\tunnel.ps1Step 2: Start the server in SSE mode
export MCP_TRANSPORT=sse
export MCP_PORT=8080
export MCP_SERVER_URL=https://abc123.ngrok-free.app # Your ngrok URL
python server.pyStep 3: Connect from Claude Desktop
{
"mcpServers": {
"github-remote": {
"url": "https://abc123.ngrok-free.app/sse"
}
}
}The OAuth flow will prompt you to authorize when you first connect.
π οΈ Tools Reference
Auth (3)
Tool | Description |
| Check GitHub CLI authentication status |
| Get currently authenticated username |
| Switch between GitHub accounts |
Repos (5)
Tool | Description |
| Create a new GitHub repository |
| List repositories for a user/org |
| View repository details |
| Clone a repository locally |
| Delete a repository (requires |
Git (4)
Tool | Description |
| Get status of a local repository |
| Add, commit, and push in one command |
| Initialize local dir, create GitHub repo, and push |
| Pull latest changes from remote |
Branches (4)
Tool | Description |
| Create a new branch |
| List branches in a repository |
| Switch to a different branch |
| Delete a branch |
Forks (2)
Tool | Description |
| Fork a repository |
| Sync a fork with its upstream repository |
Issues (3)
Tool | Description |
| Create a new issue |
| List repository issues |
| Add a comment to an issue |
Pull Requests (6)
Tool | Description |
| Create a pull request |
| List pull requests |
| Add a comment to a PR |
| Merge a pull request |
| Submit a review on a PR |
| View the diff of a pull request |
Collaborators (2)
Tool | Description |
| List collaborators on a repository |
| Add a collaborator to a repository |
File Operations (2)
Tool | Description |
| Get the contents of a file from a repository |
| Create or update a file in a repository |
Gists (1)
Tool | Description |
| Create a GitHub gist |
Workflows (4)
Tool | Description |
| List GitHub Actions workflows for a repo |
| Trigger a workflow dispatch event |
| List recent workflow runs |
| View details of a specific workflow run |
Search (1)
Tool | Description |
| Search GitHub repositories |
Releases (2)
Tool | Description |
| Create a new GitHub release |
| List releases for a repository |
π Security
Path Sandboxing
All local file operations are restricted to the WORK_DIR directory (default: ~/projects). Any path outside this directory is rejected, preventing unauthorized filesystem access.
Input Validation
Repository names, usernames, branch names, and file paths are validated against strict regex patterns to prevent injection attacks.
Read-Only Mode
Set READ_ONLY=true to restrict the server to safe, non-destructive operations only (list, view, search). All write operations will be blocked.
Audit Logging
Every tool invocation is logged with parameters to mcp_audit.log (configurable via LOG_FILE), providing a full audit trail of all operations.
OAuth 2.0 (Remote Mode)
When running in SSE mode, the server requires OAuth 2.0 authentication with configurable scopes (read, write). Client registration and token revocation are supported.
Dangerous Operation Confirmation
Destructive operations like delete_repo require an explicit confirm=True parameter to prevent accidental data loss.
βοΈ Configuration
Variable | Description | Default |
| Base directory for git operations (path sandbox root) |
|
| Block all write operations when |
|
| Path to the audit log file |
|
| Transport mode: |
|
| Port for SSE server |
|
| Public URL for OAuth issuer (ngrok URL) |
|
ποΈ Architecture
github-mcp/
βββ server.py # Main MCP server β all 39 tools
βββ oauth_provider.py # In-memory OAuth 2.0 provider (SSE mode)
βββ requirements.txt # mcp[cli], uvicorn, starlette
βββ tunnel.sh # ngrok tunnel helper (Linux/macOS)
βββ tunnel.ps1 # ngrok tunnel helper (Windows)
βββ README.md
βββ LICENSE
βββ .claude/
βββ CLAUDE.md # Claude Code project instructionsπ License
MIT License β See LICENSE for details.
π€ Author
Prateek Aryan β @prateekaryann
Built for seamless GitHub integration with Claude.
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
- AlicenseBqualityDmaintenanceEnables comprehensive GitHub operations through natural language including file management, repository administration, issue tracking, and advanced code searching.Last updated47461MIT
- -licenseBquality-maintenanceEnables comprehensive Git and GitHub operations through 30 DevOps tools including repository management, file operations, workflows, and advanced Git features. Provides complete Git functionality without external dependencies for seamless integration with Gitea and GitHub platforms.Last updated18819
- Flicense-qualityDmaintenanceProvides comprehensive access to GitHub repositories, issues, pull requests, commits, user profiles, and statistics through 10 tools with natural language query support and advanced search capabilities.Last updated
- Flicense-qualityCmaintenanceEnables AI agents to interact with GitHub repositories, issues, pull requests, code, and more through a comprehensive set of tools.Last updated
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β¦
Screens public GitHub repos and PRs to generate risk maps, findings, and merge-readiness signals.
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/prateekaryann/github-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server