How to Connect Claude to GitHub for Code Review
To connect Claude to GitHub for code review, sign in to claude.ai on a Pro, Max, Team, or Enterprise plan, open Settings > Customize > Connectors, click the + button, and add the GitHub MCP connector with your GitHub Personal Access Token (PAT). Once authenticated, Claude gains direct, programmatic access to your repositories—no more copying and pasting code into a chat window.
What Is the GitHub MCP Connector?
The GitHub MCP connector is a pre-built integration that uses the Model Context Protocol (MCP) to give Claude authenticated access to GitHub repositories and project data. Rather than manually pasting code or issue text into a conversation, you connect Claude to GitHub once, and it can then read files, list issues, inspect pull requests, view commit history, and—when configured with the right permissions—create branches, commit changes, and open pull requests on your behalf.
MCP is a standardized protocol that lets Claude communicate with external services through a consistent interface. The GitHub connector follows this standard, which means the tools Claude uses to query GitHub work the same way whether you set up the connector in the claude.ai web interface or configure a local MCP server in Claude Code or Claude Desktop. You can learn more about the protocol's foundations in Anthropic's guide to custom connectors using remote MCP.
It's worth distinguishing two separate GitHub integrations. The MCP connector described here is available across Pro, Max, Team, and Enterprise plans and gives Claude tool-based, programmatic access to GitHub. A separate native GitHub integration exists in beta for Enterprise users and syncs repositories more directly into Claude's context. This article covers the MCP connector approach.
How Do You Set Up the GitHub MCP Connector on claude.ai?
- Sign in to claude.ai with a Pro, Max, Team, or Enterprise account.
- Open Settings and navigate to Customize > Connectors.
- Click the + button next to Connectors.
- Enter a name for the connector (for example, GitHub) and the MCP server URL.
- Expand Advanced Settings if required, and enter your OAuth Client ID and Client Secret.
- Click Add and follow the on-screen prompts to authenticate with your GitHub account.
- Authorize access by approving the GitHub App or supplying a GitHub Personal Access Token with the
reposcope. If you need write access—creating branches, commits, or pull requests—the fullreposcope is required. For public repositories only,public_repois sufficient. - Team or Enterprise plans: an Owner must first add the connector at the organization level before individual users can connect to it.
- Verify the connection by asking Claude to list repositories or issues. If it returns results, the connection is working.
For local setups in Claude Code or Claude Desktop, the process involves editing your configuration file to add the GitHub MCP server entry and setting your PAT as an environment variable before restarting the application. See the Claude Code MCP documentation for details on that path.
What Can Claude Actually Do Once Connected to GitHub?
The connector unlocks a wide range of real development workflows:
- Pull request review: Ask Claude to fetch an open PR's diff and check for logic errors, missing input validation, and style inconsistencies. For example: "Review pull request #88 in acme-corp/backend-api. Check for logic errors, missing input validation, and any code that doesn't follow the patterns used in the rest of the payments module." Claude returns a structured review grouped by severity—critical issues, moderate concerns, and style notes.
- File explanation: Ask Claude to read a specific file by path and explain what each section does in plain English. New developers get instant, contextual explanations without interrupting senior colleagues.
- Issue triage: Ask Claude to list the most recently opened issues in a repository. It returns each issue's number, title, author, date, and labels—eliminating the need to switch browser tabs or learn GitHub's filter syntax.
- Issue-driven implementation: Tell Claude to read a specific GitHub issue, implement the requested change, commit to a new branch, and open a pull request—all within a single conversation.
- CI/CD log triage: Ask Claude to fetch logs from a failed GitHub Actions run, identify the root cause, and suggest the specific code change needed to fix the build.
- Release note generation: Ask Claude to read all merged pull requests and closed issues since the last release tag, then draft structured release notes grouped by feature, bug fix, and breaking change.
- Cross-repository analysis: Ask Claude to compare how two separate repositories handle a shared concern—like authentication—identifying inconsistencies before a planned merge.
What Are the Most Common Pitfalls and How Do You Fix Them?
Insufficient token scopes
A Personal Access Token with insufficient scopes causes read or write operations to fail silently or return permission errors. Create a PAT with at minimum the repo scope for full repository access. For write operations, the full repo scope is required. Set the token as the GITHUB_TOKEN environment variable before starting the MCP server.
Corporate firewall blocking the MCP server
If the MCP server sits behind a corporate firewall or VPN, claude.ai cannot reach it. Allowlist Anthropic's published IP address ranges in your firewall rules, or host the MCP server on a publicly reachable endpoint.
Team or Enterprise users can't see the connector
On Team or Enterprise plans, only an Owner role can add custom connectors at the organization level. Individual users cannot enable a connector that hasn't been added by an Owner first. The Owner must add it in the organization's admin settings before anyone else can connect.
Private repository access denied
For repositories owned by an organization, the GitHub App or OAuth App must be explicitly granted access to private repositories. If your organization uses single sign-on (SSO), the PAT must also be authorized for SSO. An organization administrator may need to approve the access request.
Prompt injection risk
Issue bodies, PR descriptions, and README files could contain adversarial text intended to manipulate Claude's behavior. Only connect to repositories you trust, review what Claude is being asked to execute, and avoid granting write permissions unless the workflow specifically requires it.
When Should You Use the GitHub MCP Connector vs. Alternatives?
| Scenario | Best choice | Why |
|---|---|---|
| Programmatic actions: reading files, creating branches, opening PRs | GitHub MCP connector | Tool-based access lets Claude take sequential actions across a full workflow in one conversation |
| One-off explanation of a small snippet, no setup desired | Manual copy-paste | No authentication or token scopes required; doesn't scale but works instantly |
| Enterprise-wide read-only context injection at scale | Native GitHub integration (Enterprise beta) | Admin-managed, simpler to deploy across an organization without configuring a separate MCP server |
| Automated, event-triggered PR review on every push | GitHub Actions with Claude API | Runs unattended in CI/CD pipelines without a human in the loop |
| Deep IDE integration with inline autocomplete | GitHub Copilot | Editor-centric workflow; conversation-based approach of MCP connector is less suited here |
| Multi-tool agent workflow combining GitHub, Slack, Jira, databases | GitHub MCP connector | MCP's standardized protocol lets Claude orchestrate across multiple connectors in one session |
Is the GitHub MCP Connector Worth Setting Up?
For any team doing regular code review, the answer is yes—provided you're on a qualifying plan. The setup investment is a one-time task: create a PAT, add the connector in Settings, and authorize access. After that, every developer on the team can ask Claude to review PRs, explain unfamiliar files, or triage issues without leaving their conversation.
The connector is especially valuable for teams that want Claude to operate across multiple sequential GitHub actions—read an issue, implement a fix, commit to a branch, open a PR—within a single conversation. That kind of end-to-end workflow isn't possible with manual copy-paste and would require custom scripting with the API to replicate otherwise.
For a deeper look at how pre-built connectors work across different services, see Anthropic's documentation on pre-built web connectors using remote MCP.
The one caveat worth repeating: on Team and Enterprise plans, an Owner must configure the connector at the organization level first. If you're an individual contributor and the connector isn't appearing in your Settings, that's the first place to check.
Frequently asked questions
Which Claude plans support the GitHub MCP connector?
The GitHub MCP connector is available on Pro, Max, Team, and Enterprise plans. On Team and Enterprise plans, an Owner must add the connector at the organization level before individual users can enable it.
Do I need a GitHub Personal Access Token to connect Claude to GitHub?
Yes. You can authenticate via a GitHub App authorization or by supplying a Personal Access Token (PAT). For read access, the repo scope (or public_repo for public repositories only) is sufficient. For write operations like creating branches or opening pull requests, the full repo scope is required.
Can Claude create pull requests and commit code, or is it read-only?
Claude can create branches, commit changes, and open pull requests when the connector is configured with the appropriate write permissions. If you only grant read access, it is limited to reading files, listing issues, and inspecting pull request diffs.
Is the GitHub MCP connector the same as the native GitHub integration for Enterprise?
No. The MCP connector gives Claude tool-based, programmatic access to GitHub and is available on Pro, Max, Team, and Enterprise plans. The native GitHub integration is a separate beta feature for Enterprise users that syncs repository context more directly and is better suited for read-only context injection at scale.
What should I do if Claude can't find or use GitHub tools like list_issues?
Tool discovery happens on demand. Make sure you are using a compatible model that supports the necessary tool features, and confirm that the GitHub MCP server version you deployed exposes the specific tools you need—older server versions may not include all available tools.
Is there a security risk in connecting Claude to GitHub repositories?
Yes, there is a prompt injection risk. Issue bodies, PR descriptions, and README files could contain adversarial text designed to manipulate Claude's behavior. Only connect to repositories you trust, and avoid granting write permissions unless your workflow specifically requires them.
MCP connector: GitHub is one of 85 features in Claude Master — the independent, continuously updated manual with worked examples, the pitfalls, and the workflows that put Claude to work.
Get Claude Master — founding price →Independent product. Not affiliated with or endorsed by Anthropic. "Claude" is a trademark of Anthropic, used here only to describe the subject of this guide.