GitHub API integration for repository management
## GitHub MCP Server: Complete Repository Management from Your IDE The **GitHub MCP Server** is the official integration that brings the full power of GitHub directly into Google Antigravity. Manage repositories, pull requests, issues, actions, and more without ever leaving your development environment. This is the essential MCP server for any developer working with GitHub. ### Why GitHub MCP? GitHub is the world's largest code hosting platform, and developers spend significant time switching between their IDE and the GitHub interface. The GitHub MCP eliminates this context switching by providing: - **Seamless Repository Access**: Clone, browse, and manage repos from your IDE - **Pull Request Workflows**: Create, review, and merge PRs with natural language - **Issue Management**: Create, update, and close issues efficiently - **Actions Integration**: Monitor and trigger CI/CD workflows - **Code Search**: Search across repositories for code patterns ### Key Features #### 1. Repository Operations Manage repositories with simple commands: ``` "Create a new private repository called my-awesome-project" "Clone the anthropics/claude-code repository" "List all my starred repositories" "Show recent commits on the main branch" ``` #### 2. Pull Request Management Full PR lifecycle management: - **Create PRs**: From current branch with auto-generated descriptions - **Review PRs**: View diffs, leave comments, request changes - **Merge PRs**: Squash, rebase, or merge with various strategies - **Track Status**: Monitor CI checks and review approvals ``` "Create a pull request from feature-auth to main" "Show me all open PRs that need my review" "Merge PR #42 with squash and delete the branch" ``` #### 3. Issue Tracking Comprehensive issue management: ``` "Create an issue for the login bug with high priority" "List all issues assigned to me" "Close issue #15 with a comment explaining the fix" "Add the bug label to issue #23" ``` #### 4. GitHub Actions Interact with CI/CD workflows: - View workflow runs and their status - Trigger manual workflow dispatches - Download artifacts from completed runs - Cancel running workflows ``` "Show me the status of the CI workflow" "Trigger the deploy workflow for production" "Download the test coverage report artifact" ``` #### 5. Code Navigation Browse and search code: - View file contents and history - Search code across repositories - Navigate branches and tags - Compare commits and branches ### Configuration Add GitHub MCP to your configuration: ```json { "mcpServers": { "github": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-github"], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_your_token_here" } } } } ``` ### Token Permissions Your personal access token needs these scopes: - **repo**: Full repository access - **workflow**: GitHub Actions access - **read:org**: Organization membership (optional) - **gist**: Gist access (optional) ### Common Workflows #### Feature Development Flow ``` 1. "Create a branch called feature/user-auth" 2. "Show me the current diff" 3. "Create a PR with the title Add user authentication" 4. "Request review from @teammate" 5. "Merge after approval" ``` #### Issue Triage ``` 1. "Show all new issues from the last week" 2. "Label issue #12 as bug and priority:high" 3. "Assign issue #12 to me" 4. "Add a comment explaining I'll look at this today" ``` #### Release Management ``` 1. "List all commits since the last release" 2. "Create a new release v1.2.0 with auto-generated notes" 3. "Download the build artifacts" ``` ### Best Practices 1. **Use Fine-Grained Tokens**: Create tokens with minimal required permissions 2. **Organize with Labels**: Use labels for efficient issue/PR filtering 3. **Leverage Templates**: Set up PR and issue templates in your repos 4. **Automate Reviews**: Use CODEOWNERS for automatic reviewer assignment 5. **Monitor Actions**: Keep track of workflow costs and durations ### Enterprise Features For GitHub Enterprise users: - Configure custom API endpoints - Use SAML SSO authentication - Access organization-level features - Manage team permissions ```json { "env": { "GITHUB_API_URL": "https://github.your-company.com/api/v3", "GITHUB_PERSONAL_ACCESS_TOKEN": "your_enterprise_token" } } ``` ### Security Considerations - Never commit tokens to repositories - Use environment variables for sensitive data - Rotate tokens regularly - Audit token usage in GitHub settings - Use repository secrets for Actions ### Integration with Development The GitHub MCP enhances your entire development workflow: - **Code Review**: Review PRs without leaving your editor - **Documentation**: Update README and wikis - **Collaboration**: Mention teammates and discuss in context - **Automation**: Chain with other MCP servers for complex workflows ### Troubleshooting Common issues and solutions: - **Rate Limiting**: Use authenticated requests to increase limits - **Token Expiry**: Check and refresh expired tokens - **Permission Denied**: Verify token has required scopes - **Network Issues**: Check proxy settings for enterprise environments The GitHub MCP Server is the cornerstone of any GitHub-based development workflow, bringing the full power of the platform into your AI-assisted development experience.
{
"mcpServers": {
"github": {
"mcpServers": {
"github": {
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_GITHUB_TOKEN"
},
"args": [
"-y",
"@modelcontextprotocol/server-github"
],
"command": "npx"
}
}
}
}
}