# 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. ## Install Merge the JSON below into your `.mcp.json`: ## Quick Use Add to your `.mcp.json`: ```json { "mcpServers": { "github": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-github"], "env": { "GITHUB_TOKEN": "ghp_your_token_here" } } } } ``` Create a token at [github.com/settings/tokens](https://github.com/settings/tokens) with `repo`, `issues`, `pull_requests` scopes. Restart Claude Code. --- ## Intro GitHub MCP is the official Model Context Protocol server for GitHub that gives AI agents full access to repositories, issues, pull requests, code search, and GitHub Actions with 5,000+ GitHub stars. Create branches, open PRs, review code, manage issues, and search across codebases — all through natural language. Your AI agent becomes a GitHub-native developer that can handle the entire PR lifecycle. Best for developers who want AI-assisted GitHub workflows. Works with: Claude Code, Cursor, any MCP client. Setup time: under 2 minutes. --- ## Available Tools ### Repository Operations ``` "List my recent repositories" "Create a new branch called feat/rate-limiting from main" "Show the file tree of the src/ directory" "Read the contents of src/auth/handler.ts" ``` ### Issues ``` "Create an issue: 'Login fails with expired JWT' with label bug and priority high" "List all open bugs assigned to me" "Close issue #42 with comment: Fixed in PR #43" "Search issues mentioning rate limiting" ``` ### Pull Requests ``` "Open a PR from feat/rate-limiting to main with title 'Add rate limiting'" "Show the diff for PR #43" "List review comments on PR #43" "Merge PR #43 with squash" ``` ### Code Search ``` "Search the codebase for all usages of createUser function" "Find files containing TODO comments" "Search across all my repos for database connection strings" ``` ### GitHub Actions ``` "Show the status of recent workflow runs" "Trigger the deploy workflow on main branch" "Show logs for the failed CI run" ``` ## Use Cases ### Automated PR Workflow ``` "Create a branch, commit the changes I just made, open a PR, and assign it to @alice for review" → Agent handles the entire flow ``` ### Issue Triage ``` "Show all unassigned bugs from the last week, add priority labels based on severity" → Agent reads issues, analyzes content, applies labels ``` ### Cross-Repo Search ``` "Find how other repos in our org implement rate limiting" → Agent searches across organization repos ``` ### Key Stats - 5,000+ GitHub stars - Official MCP implementation - Full repo, issue, PR management - Code search across repos - GitHub Actions integration ### FAQ **Q: What is GitHub MCP?** A: The official MCP server for GitHub that gives AI agents full access to repositories, issues, pull requests, code search, and Actions via natural language. **Q: Is GitHub MCP free?** A: The MCP server is open-source. GitHub is free for public repos, paid plans for private. **Q: What token scopes are needed?** A: `repo` for full access, or `public_repo` for public repos only. Add `workflow` for Actions. --- ## Source & Thanks > Created by [Anthropic](https://github.com/anthropics) and [GitHub](https://github.com). Licensed under MIT. > > [server-github](https://github.com/modelcontextprotocol/servers) — ⭐ 5,000+ Thanks for making GitHub a first-class MCP integration. --- ## 快速使用 将以下配置添加到 `.mcp.json`: ```json { "mcpServers": { "github": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-github"], "env": { "GITHUB_TOKEN": "ghp_你的令牌" } } } } ``` --- ## 简介 GitHub MCP 是 GitHub 的官方 MCP 服务器,GitHub 5,000+ stars。AI Agent 可管理仓库、Issue、PR、代码搜索和 Actions。适合需要 AI 辅助 GitHub 工作流的开发者。 --- ## 来源与感谢 > Created by [Anthropic](https://github.com/anthropics). Licensed under MIT. > > [server-github](https://github.com/modelcontextprotocol/servers) — ⭐ 5,000+ --- Source: https://tokrepo.com/en/workflows/d6e7f6a5-0243-4507-b119-132ec9253843 Author: MCP Hub