Overview
Connect Claude Code to GitHub's remote MCP server so it can read code, issues and pull requests in a repository you do not have checked out, draft the change in local files, and open it as a draft pull request only after you approve.
Problem or Objective
More in Coding and Code Review
AI Agents and Models
Tools and Integrations
- Tools
- Claude Code · GitHub
- Prerequisites
- Claude Code (most surfaces require a Claude subscription or Anthropic Console account), a GitHub fine-grained personal access token for the repositories involved, and a local clone to edit in.
How It Works
Create a fine-grained GitHub personal access token limited to the repositories you want Claude to work with, and add GitHub's remote MCP server to Claude Code with the command in Anthropic's MCP guide. Run /mcp and check the server shows a checkmark. Ask Claude to read the relevant files, the issue and any open pull requests through the server and to explain how the code is organised before changing anything. Then have it write the proposed change in a local clone or working folder with its normal file tools, and run the tests there. Read the diff yourself. Only when you are satisfied, tell Claude to push a branch and open a draft pull request with a description of what changed and why; otherwise ask for another round of edits.
Implementation Workflow
Steps assembled from the agents, tools and prompt of this entry. Adapt them to your own setup.
- Choose the agentSet up Claude Code.
- Connect the toolsConnect the tools this workflow relies on: Claude Code, GitHub.
- Check the prerequisitesClaude Code (most surfaces require a Claude subscription or Anthropic Console account), a GitHub fine-grained personal access token for the repositories involved, and a local clone to edit in.
- Gather your detailsCollect what the prompt asks for: Repository owner and name, Folder to read, Issue to work on, Local working copy, Test command, Branch to push.
- Run the starter promptPaste the starter prompt below into Claude Code and adapt it to your case.
- Check against the documentationCompare what you get with the documentation at code.claude.com before you rely on it.
Practical Starter Prompt: Read remotely, draft locally
Fill the fields to adapt the prompt. Empty fields stay as visible [placeholders].
Using the GitHub MCP server, read [Repository owner and name]: the files under [Folder to read], issue [Issue to work on] and any open pull requests that touch them. Explain how the code is organised and what the issue needs. Then write the change in [Local working copy] and run [Test command]. Show me the diff and the test results and wait for my approval. Only after I approve, push the branch [Branch to push] and open it as a draft pull request with a short description.Approve the diff and test results before Claude pushes. The pull request opens as a draft so you can review it again on GitHub before asking anyone else.
Expected Results and Benefits
This is a suggested workflow, not a reported result. The points below are what the cited documentation says the tools can do.
This is a suggested workflow, not a reported outcome. Anthropic's MCP guide shows adding GitHub's remote MCP server with a personal access token and then asking Claude Code to review a pull request, create an issue or list open pull requests. Its overview says Claude Code reads code, edits files and runs commands. The guide does not show this exact read-remotely, edit-locally split, so try it on a small change first.
Limitations and Considerations
Give the token access only to the repositories involved, and prefer read access until you want Claude to open pull requests. The claude mcp add command saves the configuration without validating the token, so check /mcp before starting. Review the diff and run the tests before anything is pushed; Claude Code asks before running commands unless you have allowed them. Most Claude Code surfaces require a Claude subscription or Anthropic Console account. Results depend on your setup and were not independently reproduced by Top 200 Repos.
GitHub Repositories
AI Agent Repository
Source code of the agent that does the work.
Related Videos
About anthropics/claude-code
The SECRET Claude Code Upgrade That Has Everyone Going Nuts (Full Guide) (opens in a new tab)
The title names the project, the description links the project website.
Watch on YouTube (opens in a new tab)About anthropics/claude-code
The only Claude Code guide you'll ever need (Opus 4.5) (opens in a new tab)
The title names the project, the description links the project website.
Watch on YouTube (opens in a new tab)Independent creators. Listing a video implies no endorsement, sponsorship or partnership.
Sources
- Connect Claude Code to tools via MCP - Claude Code Docs (opens in a new tab)
Project documentation · code.claude.com · Undated · Source checked 25 Nov 2026, 12:10 UTC
What this source supports
- GitHub's remote MCP server authenticates with a GitHub personal access token passed as a header; the guide suggests a fine-grained token with access to the repositories you want Claude to work with.
- The claude mcp add command saves the configuration without validating credentials; to verify the connection, run /mcp and check that the server's row shows a checkmark.
- Once connected, the guide's examples include asking Claude to review a pull request, create a new issue and show open pull requests.
- Overview - Claude Code Docs (opens in a new tab)
Project documentation · code.claude.com · Undated · Source checked 25 Nov 2026, 11:57 UTC
What this source supports
- Claude Code is an agentic coding tool that reads your codebase, edits files, runs commands, and integrates with your development tools.
- Most Claude Code surfaces require a Claude subscription or Anthropic Console account.

