GitHub
Local MCP server for safe GitHub developer workflows. Enables pulling main, creating feature branches, pushing them, and opening ready-for-review pull requests via tools like github_create_feature_branch and github_create_pull_request.
What is GitHub?
GitHub is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to local mcp server for safe github developer workflows. enables pulling main, creating feature branches, pushing them, and opening ready-for-review pull requests via tools like github_create_feature_bra...
Local MCP server for safe GitHub developer workflows. Enables pulling main, creating feature branches, pushing them, and opening ready-for-review pull requests via tools like github_create_feature_branch and github_create_pull_request.
This server falls under the Version Control category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- create_or_update_file
- search_repositories
- create_repository
- get_file_contents
- push_files
Use Cases
Maintainer
Works with
Installation
NPM
npx -y @modelcontextprotocol/server-githubManual Installation
npx -y @modelcontextprotocol/server-githubConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use GitHub
This GitHub MCP server provides a focused set of safe GitHub developer workflow tools for AI assistants, covering file operations, pull request lifecycle management, Dependabot alert monitoring, and repository health checks. Unlike broader GitHub integrations, it emphasizes safe branch-based workflows: reading files via the Contents API, creating or updating files idempotently, listing and merging pull requests, and surfacing security alerts by severity. Developers use it to automate PR reviews, manage Dependabot alerts, and perform file-level operations on GitHub repositories entirely through natural language.
Prerequisites
- A GitHub Personal Access Token (PAT) with scopes: Contents (read/write), Pull requests (read/write), Dependabot alerts (read)
- Node.js 18 or later and npx available (for the @modelcontextprotocol/server-github package)
- An MCP-compatible client such as Claude Desktop
- Optional: GITHUB_API_BASE set to your GitHub Enterprise Server URL if not using github.com
Create a GitHub Personal Access Token
Go to GitHub Settings > Developer Settings > Personal access tokens > Fine-grained tokens. Create a token with Contents (R/W), Pull requests (R/W), and Dependabot alerts (R) permissions for the repositories you want to access.
Store the token securely
On macOS, store the PAT in the Keychain rather than in plain text in your config file. Alternatively, set it as GITHUB_TOKEN in your environment.
# macOS Keychain (recommended)
security add-generic-password -s github-mcp -a "$USER" -w "<your-PAT>"
# Or export as environment variable
export GITHUB_TOKEN=ghp_your_token_hereConfigure Claude Desktop
Open claude_desktop_config.json and add the GitHub MCP server block. The server reads GITHUB_TOKEN or GH_TOKEN from the environment (GITHUB_TOKEN takes precedence).
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_TOKEN": "ghp_your_token_here"
}
}
}
}Restart Claude Desktop
Fully quit and relaunch Claude Desktop. The GitHub tools (health_check, list_prs, get_pr, merge_pr, list_dependabot_alerts, get_file, put_file) will be available.
Verify with a health check
Ask your AI assistant to run a health check to confirm your PAT is valid and see your current rate-limit availability.
GitHub Examples
Client configuration
Complete claude_desktop_config.json entry for the GitHub MCP server using the official @modelcontextprotocol/server-github package.
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_TOKEN": "ghp_your_personal_access_token"
}
}
}
}Prompts to try
Use these prompts to manage GitHub repositories, pull requests, and security alerts through your AI assistant.
- "List all open pull requests in my-org/my-repo"
- "Get the details and check run status for PR #42 in my-org/my-repo"
- "Merge PR #42 in my-org/my-repo using squash merge and delete the branch"
- "Show me all critical Dependabot alerts in my-org/my-repo"
- "Read the contents of src/index.ts in my-org/my-repo"Troubleshooting GitHub
401 Unauthorized when calling GitHub tools
Verify GITHUB_TOKEN is set correctly in your config env block. Ensure the token has not expired and has the required scopes: Contents, Pull requests, and Dependabot alerts. Generate a new fine-grained PAT if needed.
Dependabot alerts tool returns permission denied
Dependabot alert access requires the token to have 'Dependabot alerts' read permission AND the repository must have Dependabot alerts enabled (Settings > Security > Dependabot alerts).
Rate limit errors after many tool calls
GitHub's REST API has rate limits (5000 requests/hour for authenticated users). Use the health_check tool to see remaining rate-limit quota. Consider using a fine-grained token with repo-specific scope to avoid sharing limits with other integrations.
Frequently Asked Questions about GitHub
What is GitHub?
GitHub is a Model Context Protocol (MCP) server that local mcp server for safe github developer workflows. enables pulling main, creating feature branches, pushing them, and opening ready-for-review pull requests via tools like github_create_feature_branch and github_create_pull_request. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install GitHub?
Install via npm with the command: npx -y @modelcontextprotocol/server-github. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).
Which AI clients work with GitHub?
GitHub works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is GitHub free to use?
Yes, GitHub is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.
GitHub Alternatives — Similar Version Control Servers
Looking for alternatives to GitHub? Here are other popular version control servers you can use with Claude, Cursor, and VS Code.
Ruiyu MA
★ 30.1kConnect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
GitMCP
★ 8.1kTransforms any GitHub repository or GitHub Pages site into a documentation hub for AI assistants using the Model Context Protocol. It allows AI tools to access real-time code and documentation to prevent hallucinations and provide accurate API usage
GitHub Codemunch
★ 1.8kA token-efficient MCP server for exploring GitHub repositories using tree-sitter AST parsing to extract symbol signatures and summaries. It enables users to search and retrieve specific code components while significantly reducing token consumption c
Azure DevOps MCP Server
★ 1.7kThis server provides a convenient API for interacting with Azure DevOps services, enabling AI assistants and other tools to manage work items, code repositories, boards, sprints, and more. Built with the Model Context Protocol, it provides a standard
GitHub Official
★ 1.2kOfficial GitHub integration with comprehensive API coverage
Azure DevOps
★ 367Enables interaction with Azure DevOps through Cursor chat, providing tools to manage builds, pipelines, work items, sprints, and board operations. Supports secure authentication via Personal Access Tokens and allows natural language-driven DevOps tas
Browse More Version Control MCP Servers
Explore all version control servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up GitHub in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use GitHub?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.