github-pr-mcp
Provides tools to list repository files, read files, create branches, commit files, open pull requests, and list open pull requests on GitHub.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@github-pr-mcpOpen a new pull request from my feature branch"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
github-pr-mcp
A remote MCP server that gives an LLM client (such as Claude on claude.ai) GitHub read/write access through each user's own GitHub account.
Anyone can connect. Each person signs in with GitHub and the server uses their token, so they can only reach repos their own account can access.
No shared GitHub token is stored on the server. Tokens live inside encrypted OAuth grants managed by
@cloudflare/workers-oauth-provider.Each user can optionally restrict the tools to a list of repos they choose.
Tools
Tool | What it does |
| Shows the user's repo restriction, if any |
| Sets the user's allowed repos (an empty list removes the restriction) |
| Lists file paths in a repo at a branch or commit |
| Reads one file |
| Creates a branch from an existing branch |
| Commits one or more files to a branch as one commit |
| Opens a PR |
| Lists open PRs |
| Shows PR details and per-file diffs |
| Merges a PR (merge, squash, or rebase) |
Related MCP server: Narad GitHub Agent
How access works
The user adds the server URL as a custom connector in claude.ai.
The client sends them to a consent page on this server. They approve it.
They sign in with GitHub and grant the
repoandread:userscopes.Every tool call runs with their GitHub token. GitHub decides what they can touch.
If the user has set an allowlist, the tools also refuse any repo not on it.
The repo scope covers every repo the user can access, including private
ones. GitHub OAuth Apps can't limit that to chosen repos. If you need
per-repo control enforced by GitHub, use a GitHub App instead.
Setup (for the person deploying this server)
1. Register a GitHub OAuth App
Go to github.com/settings/developers → OAuth Apps → New OAuth App.
Homepage URL:
https://github-pr-mcp.<your-subdomain>.workers.devAuthorization callback URL:
https://github-pr-mcp.<your-subdomain>.workers.dev/callback
Copy the Client ID and generate a Client secret.
2. Install dependencies
npm install3. Create the KV namespace
npx wrangler kv namespace create OAUTH_KVPaste the returned id into wrangler.jsonc in place of
<replace-with-OAUTH_KV-namespace-id>.
4. Set the secrets and deploy
npx wrangler login
npx wrangler secret put GITHUB_CLIENT_ID
npx wrangler secret put GITHUB_CLIENT_SECRET
npm run deployThe MCP endpoint is https://github-pr-mcp.<your-subdomain>.workers.dev/mcp.
5. Connect it in claude.ai
Go to Settings → Connectors → Add custom connector.
Paste the
/mcpURL and save.Enable the connector in a chat. You'll be asked to approve access and sign in with GitHub.
Local development
Create .dev.vars from .dev.vars.example, filling in your OAuth App's
credentials, and then run:
npm run devThe local URL is http://localhost:8787/mcp. Note that the GitHub OAuth App's
callback must include the local URL (http://localhost:8787/callback) for
sign-in to work locally. You can add it as a second callback URL, or use a
separate OAuth App for development.
Managing access
Restrict repos for yourself: ask the assistant to call
set_allowed_repos, for example with["owner/repo"]. Call it with[]to remove the restriction.Revoke this server's access: remove the app under GitHub Settings → Applications → Authorized OAuth Apps.
Rotate the OAuth secret: generate a new client secret on GitHub, then run
npx wrangler secret put GITHUB_CLIENT_SECRET. No redeploy is needed.
Project layout
src/
index.ts OAuth provider setup and the MCP endpoint
auth.ts Consent page, GitHub sign-in, and callback
mcp-server.ts MCP tool definitions (one server per request)
github.ts GitHub API calls and the allowlist check
allowlist.ts Per-user repo allowlists stored in KV
types.ts Shared types
wrangler.jsonc Worker config and KV bindingThis server cannot be deployed
Maintenance
Related MCP Connectors
Create, deploy, and operate MCP servers directly from your GitHub repositories.
Remote streamable-HTTP MCP server running on a single Cloudflare Worker. Your assistant gets live Airbnb, Amazon, Booking.com, Google Flights, Maps and Reddit data, social search on X, Instagram and TikTok, the Meta Ad Library, and image/video generation without any keys. Connect your own accounts to let it send WhatsApp or Telegram messages, work an IMAP inbox, manage Meta Ads campaigns and publish to X and LinkedIn. OAuth 2.1 with PKCE; stored credentials are AES-256-GCM encrypted.
Access the GitHub API, enabling file operations, repository management, search functionality, and…
GitHub MCP — wraps the GitHub public REST API (no auth required for public endpoints)
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables remote MCP connections with GitHub OAuth authentication, providing tools like add, userInfoOctokit, and image generation (restricted) deployed on Cloudflare Workers.13 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables AI-powered GitHub interactions including repository analysis, code search, PR reviews, and more through the MCP protocol.4MIT
- AlicenseNot gradedqualityAmaintenanceA remote MCP server that gives MCP clients authenticated access to GitHub: repos, issues, pull requests, file contents, and search, over a proper OAuth 2.1 handshake. Runs on Cloudflare Workers.1Apache 2.0
- FlicenseNot gradedqualityDmaintenanceA read-only MCP server for GitHub that exposes 7 tools (list repos, commits, branches, pull requests, issues, file contents, search) via a Cloudflare Worker, using a single password for authorization and a fine-grained GitHub token for access control.-