Connect Claude to GitHub

Access repos, manage issues, review PRs, and automate development workflows with AI.

Official Integration

The GitHub MCP integration lets Claude interact with your repositories - reading code, managing issues, reviewing pull requests, and helping you navigate codebases. Ask Claude about your repo structure, get explanations of unfamiliar code, or automate repetitive GitHub tasks.

What You Can Do

Browse Repositories

Navigate repo structure, read files, understand codebases without cloning locally.

Manage Issues

Create, search, update, and triage issues. Get summaries of open issues and bug reports.

Review Pull Requests

Read PR diffs, get summaries of changes, understand what code is being modified.

Generate Docs

Create README updates, code comments, and documentation from existing code.

Example Commands

Basic

  • "What repositories do I have access to?"
  • "Show me the README for my 'project-x' repo"
  • "List open issues in the 'frontend' repository"

Intermediate

  • "Find all files that import the 'authentication' module"
  • "Summarize the changes in pull request #42"
  • "Create an issue titled 'Fix login timeout' with a description of the bug"

Advanced

  • "Review the code in PR #87 and explain what the changes do in plain English"
  • "Find all TODO comments across the codebase and create issues for each one"
  • "Analyze the 'api' folder and generate documentation for each endpoint"

Setup Guide

Prerequisites

Claude Desktop GitHub Account ~15 Minutes
  1. Generate a Personal Access Token at github.com/settings/tokens
  2. Select appropriate scopes (repo, read:org)
  3. Install the GitHub MCP server
  4. Add configuration to Claude Desktop
  5. Test with a simple repo query

Add this to your configuration file:

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@anthropic/mcp-server-github"],
      "env": {
        "GITHUB_TOKEN": "your-personal-access-token"
      }
    }
  }
}

Token Scopes Recommendation:

  • repo - Full access to repositories (required for most operations)
  • read:org - Read organization data (if accessing org repos)
  • Use fine-grained tokens for more precise access control

View Complete Setup Instructions →

Security & Privacy

Critical Warning: Your GitHub token grants significant access. Never share tokens. Use fine-grained tokens with minimal scopes when possible. For organization repos, consult your security team before connecting.

Claude accesses repos your token has permission to view. Private repos require appropriate token scopes. Code content is processed but not stored.

Read our complete Security Guide →

Best Use Cases

Developers

  • Navigate unfamiliar code
  • Explain complex logic
  • Automate triage

Teams

  • Summarize PRs
  • Track issues
  • Generate changelogs

Maintainers

  • Triage issues
  • Answer questions
  • Update docs

Workflows Using GitHub

See all workflow examples →

Works Well With

Technical Considerations

Rate Limits

GitHub API has rate limits. Claude's requests count against your token's limit. For heavy usage, consider GitHub Enterprise or authenticated requests.

Large Repositories

Very large repos may have performance considerations. Claude works best with targeted queries rather than reading entire codebases.

Binary Files

Claude can identify binary files but can't read their contents. Focus on source code, docs, and config files.

FAQ

Can Claude push code to my repositories?

With appropriate token scopes, Claude can create files and commits. Use read-only tokens if you want to prevent writes.

Does this work with GitHub Enterprise?

Yes, with appropriate configuration for your Enterprise instance. Check with your GitHub admin.

Can Claude access private repositories?

Yes, if your token has the repo scope and you have access to the private repo.

Will Claude see my organization's private code?

Only if your token has org access and you're a member. Claude can't access repos you can't access yourself.

Can Claude run GitHub Actions?

Claude can potentially trigger workflows if your token has appropriate permissions. Be cautious with automation permissions.

Ready to Connect GitHub?

Get our Quick Start Kit with developer workflow templates and code automation examples.

Get the Free Kit

Ready to Connect Your Tools?

Get the free MCP Quick Start Kit with 10 pre-built workflows.

Join 5,000+ developers building with MCP.