GitHub MCP Server — Manage Repos & Issues from AI Tools
GitHub official MCP server. Connect Claude Code or Cursor to GitHub for managing repos, issues, PRs, and code search via natural language.
Safe staging for this asset
This asset is staged first. The copied prompt tells the agent to inspect the staged files and ask before activating scripts, MCP config, or global config.
npx -y tokrepo@latest install 595e3cd6-fbee-4271-8ede-e8fc1c9d8493 --target codexStages files first; activation requires review of the staged README and plan.
What it is
The GitHub MCP Server is the official Model Context Protocol server from GitHub. It connects AI tools like Claude Code and Cursor to GitHub for managing repositories, issues, pull requests, and code search via natural language. Instead of switching to the GitHub web interface or remembering CLI commands, you tell your AI agent what you need and it executes the GitHub API calls.
This server targets developers who want their AI assistant to interact with GitHub directly from the coding environment. It covers the most common GitHub operations: creating issues, reviewing PRs, searching code, and managing repository settings.
Why it saves time or tokens
GitHub operations like creating issues, reviewing PRs, and searching code across repositories require context switches to the web UI or memorizing gh CLI syntax. The MCP server lets the AI agent handle these operations inline during a coding session. Filing a bug report from a code review finding or searching for usage patterns across repos happens within the same conversation.
How to use
- Add the GitHub MCP server to your AI tool's MCP configuration
- Provide a GitHub personal access token with the needed scopes
- Instruct your AI agent to perform GitHub operations in natural language
Example
{
'mcpServers': {
'github': {
'command': 'npx',
'args': ['-y', '@modelcontextprotocol/server-github'],
'env': {
'GITHUB_PERSONAL_ACCESS_TOKEN': 'ghp_xxxxx'
}
}
}
}
Example commands:
- 'Create an issue in myorg/backend titled API rate limiting needed'
- 'Search for uses of deprecated function across all repos'
- 'List open PRs assigned to me'
| Operation | What the Agent Does |
|---|---|
| Issues | Create, update, comment, close |
| Pull Requests | List, review, comment |
| Code Search | Search across repositories |
| Repos | List files, read content |
| Branches | Create, list, compare |
Related on TokRepo
- MCP GitHub integration — dedicated GitHub MCP page on TokRepo
- AI tools for coding — developer productivity tools
Common pitfalls
- The personal access token grants the same permissions as your GitHub account; use fine-grained tokens with minimal scopes
- Code search across many repos can be slow and token-intensive; scope searches to specific organizations or repositories
- Creating issues or PRs via AI requires clear instructions; vague prompts produce low-quality issue descriptions
Frequently Asked Questions
The server supports repository management (list files, read content), issue operations (create, update, comment, close), pull request operations (list, review, comment), code search, branch management, and user operations. It covers the most commonly used GitHub API endpoints.
Yes. The GitHub MCP server is maintained as part of the Model Context Protocol project. It uses the official GitHub REST and GraphQL APIs. The server is open source and follows the MCP specification for AI tool integration.
For basic operations, use a fine-grained token with repository read/write access, issue read/write, and pull request read/write. For code search across organizations, add the appropriate organization scopes. Start with minimal permissions and add scopes as needed.
Yes. Configure the GITHUB_API_URL environment variable to point to your GitHub Enterprise API endpoint. The MCP server uses the standard GitHub REST API, which is compatible with GitHub Enterprise Server and GitHub Enterprise Cloud.
Yes. The agent can list pull requests, read diffs, add comments, and post review comments on specific lines. This enables AI-assisted code review where the agent reads the PR diff and posts findings as review comments directly on GitHub.
Citations (3)
- MCP GitHub Server— GitHub MCP server for AI tool integration
- MCP Docs— Model Context Protocol specification
- GitHub API— GitHub REST API documentation
Related on TokRepo
Source & Thanks
Created by GitHub. Licensed under MIT. github-mcp-server — ⭐ 28,300+
The official GitHub MCP integration, maintained by GitHub's engineering team.
Discussion
Related Assets
GitHub MCP — Repository Management for AI Agents
Official GitHub MCP server that gives AI agents access to repos, issues, PRs, code search, and Actions. Create branches, review PRs, and manage projects via natural language. 5,000+ stars.
GitMCP — Remote MCP Server for Any GitHub Repo
Free remote MCP server that gives AI agents context from any GitHub project. Eliminates code hallucinations by providing real README, docs, and code. Zero setup. 7.8K+ stars.
GitHub MCP Server — Official GitHub AI Integration
GitHub's official MCP server that lets AI assistants manage repos, issues, PRs, Actions, and code search through the Model Context Protocol.
Linear MCP — Project Management for Claude Code & Cursor
Linear's official MCP lets Claude Code, Cursor, Codex CLI manage Linear issues, projects, cycles. Search by status, create issues from chat, link PRs.