G

GitHub MCP Integration

Connect Claude Code to GitHub for managing issues, PRs, repos, actions, and code search without leaving the terminal.

MCPClipticsdevelopmentv1.0.0MIT
0 views0 copies

GitHub MCP Integration

GitHub MCP Integration is an MCP server that provides a comprehensive Model Context Protocol bridge for AI assistants to interact with the full GitHub ecosystem, supporting multiple transport types (stdio, SSE, HTTP) and advanced features including OAuth authentication, webhook management, and GitHub Actions integration. This server goes beyond basic repository operations to offer deep integration with GitHub's collaborative development platform, enabling AI-driven development workflows spanning code review, issue management, CI/CD orchestration, and team coordination.

When to Use This MCP Server

Connect this server when...

  • You need a full-featured GitHub MCP integration supporting multiple transport types and advanced authentication patterns
  • Your development workflow requires AI interaction with GitHub Actions, webhooks, and deployment environments
  • You are building plugin-style integrations that bundle GitHub access as part of a larger MCP server configuration
  • You need OAuth-based GitHub authentication rather than personal access token-based access
  • Your team requires AI-driven automation across repositories, organizations, and GitHub Apps

Consider alternatives when...

  • You only need basic repository, issue, and PR access (the simpler unified-github-integration may suffice)
  • Your code hosting is on GitLab or Bitbucket rather than GitHub
  • You only need local git operations without GitHub API interaction

Quick Start

# .mcp.json configuration (stdio method) { "mcpServers": { "github": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-github"], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_your_token" } } } } # Alternative: SSE method for hosted deployment { "mcpServers": { "github": { "type": "sse", "url": "https://mcp.github.com/sse" } } }

Connection setup (stdio):

  1. Generate a fine-grained PAT at github.com/settings/tokens
  2. Select repository access and required permissions
  3. Add the stdio configuration to your .mcp.json
  4. Restart your MCP client to connect

Connection setup (SSE/OAuth):

  1. Add the SSE configuration to your .mcp.json
  2. On first connection, complete the OAuth flow in your browser
  3. Authentication is cached for subsequent sessions

Example tool usage:

# Manage GitHub Actions
> Show me the status of all workflow runs in the main branch for the past week

# Review deployments
> What environments are configured for the frontend repo and what is deployed to each?

# Coordinate PRs
> Create a draft PR from feature/auth-v2 to main with a summary of all commits

Core Concepts

ConceptPurposeDetails
Transport TypesFlexible connectivitySupport for stdio (local), SSE (hosted with OAuth), and HTTP (token-based) connection methods
GitHub ActionsCI/CD integrationAccess to workflow runs, job logs, deployment statuses, and action artifact management
OAuth FlowHosted authenticationBrowser-based GitHub OAuth for SSE connections without managing personal access tokens locally
GitHub AppsAdvanced integrationSupport for GitHub App authentication enabling organization-level access with granular permissions
WebhooksEvent handlingConfiguration and management of repository webhooks for integrating external services
Architecture:

+------------------+       +------------------+       +------------------+
|  GitHub          |       |  GitHub MCP      |       |  AI Assistant    |
|  Platform        |<----->|  Integration     |<----->|  (Claude, etc.)  |
|  API + Actions   | HTTPS |  stdio/SSE/HTTP  |varied |                  |
|  + Webhooks      |       +------------------+       +------------------+
+------------------+
        |
        v
+------------------------------------------------------+
|  Repos > Actions > PRs > Deploys > Webhooks > Apps    |
+------------------------------------------------------+

Configuration

ParameterTypeDefaultDescription
GITHUB_PERSONAL_ACCESS_TOKENstring(for stdio)Fine-grained PAT for stdio transport authentication
transportstringstdioConnection transport: stdio (local), sse (hosted/OAuth), or http (token-based remote)
urlstringnoneMCP endpoint URL for SSE or HTTP transport methods
github_app_idstringnoneGitHub App ID for app-level authentication (alternative to PAT)
github_app_private_keystringnonePEM private key for GitHub App authentication

Best Practices

  1. Choose the right transport for your use case. Use stdio for local development with PAT authentication, SSE for hosted deployments with OAuth convenience, and HTTP for server-to-server integrations with token-based auth. Each transport has different security and deployment characteristics.

  2. Prefer fine-grained tokens over classic PATs. Fine-grained Personal Access Tokens can be scoped to specific repositories and permission sets. This limits the MCP server's access precisely to what your workflow needs, following the principle of least privilege.

  3. Use GitHub Apps for organization-level automation. When building workflows that span multiple repositories or need organization-level access, configure GitHub App authentication. Apps provide granular permissions, installation-level access, and higher API rate limits than personal tokens.

  4. Monitor GitHub Actions through the MCP for CI/CD visibility. Use the Actions integration to check workflow run statuses, review job logs, and identify failing steps. This enables the AI to help debug CI/CD failures and suggest fixes based on build log analysis.

  5. Separate read and write operations with transport choice. For read-heavy analytics workflows, consider a read-only PAT with stdio transport. For workflows requiring write access (PR creation, issue management), use appropriately scoped tokens and implement review steps before AI-initiated changes.

Common Issues

OAuth flow fails with SSE transport. Ensure your browser can reach mcp.github.com and is not blocking third-party cookies or pop-ups. Corporate firewalls may block the OAuth callback URL. Try the stdio transport with a PAT as an alternative if OAuth continues to fail.

GitHub App authentication returns "not installed". The GitHub App must be installed on the target repository or organization. Go to the App's settings page and install it on the repositories you want to access. Verify the App's permissions match what the MCP server requires.

Actions API returns "Resource not accessible by integration". The token or App permissions do not include Actions access. For PATs, ensure the "actions" permission is selected. For GitHub Apps, the "Actions: Read" or "Actions: Read and Write" permission must be configured in the App settings.

Community

Reviews

Write a review

No reviews yet. Be the first to review this template!

Similar Templates