github-mcp-bridge
Provides tools for interacting with the GitHub API, enabling operations on repositories, branches, files, pull requests, issues, and commits.
Click on "Install 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-mcp-bridgelist open pull requests for my-org/my-repo"
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-mcp-bridge
A lightweight TypeScript MCP (Model Context Protocol) server for GitHub. It exposes GitHub operations as MCP tools over HTTP, so any MCP-compatible client can interact with GitHub repositories without needing a built-in GitHub connector.
The GitHub PAT lives server-side only. Clients authenticate to the bridge using a shared CONNECTOR_SECRET.
How it works
MCP Client ──bearer token──▶ github-mcp-bridge ──GitHub PAT──▶ GitHub APIThe client sends a JSON-RPC 2.0 request to the bridge with a bearer token.
The bridge validates the token against
CONNECTOR_SECRET(timing-safe, with rate limiting).The bridge selects the correct PAT for the request owner (with fallback to the default) and calls the GitHub API.
The bridge maintains a server-owned MCP session for the authenticated caller so normal tool requests can resume without an explicit client-managed reinitialisation flow.
The bridge exposes tools/list so any client can discover all available tools and their input schemas at runtime — no manual tool configuration needed.
Related MCP server: GitHub Prod MCP
Session behaviour
The bridge uses server-owned sessions that are bound to the authenticated caller rather than relying on the client to preserve and replay Mcp-Session-Id on every request.
What this means
A normal authenticated
tools/listortools/callrequest can succeed without an explicit priorinitializecall.If the caller already has an active session, the bridge reuses it automatically.
If there is no active session, the bridge creates one automatically and continues the request.
initialize,notifications/initialized, andpingare still supported for compatibility with MCP clients that expect them.The bridge still returns
Mcp-Session-Idheaders, but the session ID is treated primarily as an internal transport/session handle rather than something every client must actively manage.
Session lifetime
The default session policy is:
Idle timeout: 2 hours since the last valid request
Maximum lifetime: 12 hours from session creation
Refresh-on-use: each valid request extends the idle timeout window
These defaults can be adjusted with environment variables.
Current limitation
Sessions are currently stored in memory. That means active sessions survive normal requests in the same process, but they do not survive:
process restarts,
cold starts, or
multi-instance/serverless routing without shared storage.
For durable cross-instance session continuity, replace the in-memory session store with Redis, Vercel KV, or another shared backend.
⚠️ Required parameters for MCP clients
All repo-scoped tools require owner and repo parameters. The only exception is list_repositories, which lists repositories accessible to the configured PAT and does not need repo coordinates.
Example tool call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "list_branches",
"arguments": {
"owner": "SamNewhouse",
"repo": "github-mcp-bridge"
}
}
}Common mistake
❌ Wrong - Missing required parameters:
{
"name": "list_branches",
"arguments": {}
}✅ Correct - Include owner and repo:
{
"name": "list_branches",
"arguments": {
"owner": "SamNewhouse",
"repo": "github-mcp-bridge"
}
}Strict validation
The server performs strict validation and will reject repo-scoped tool calls that don't include both owner and repo. This is intentional to:
Prevent accidental operations on wrong repositories.
Enable multi-PAT support — the
ownerselects the correctGITHUB_PAT_<OWNER>environment variable.Match GitHub API requirements — all GitHub endpoints require both parameters.
If you see errors like:
Missing required parameters: 'owner' and 'repo'You need to add these parameters to your tool calls. There are no defaults or fallbacks for repo-scoped tools.
Exception
list_repositories does not require owner and repo — it lists all repositories accessible to the configured PAT.
Available tools
Repositories
Tool | Description |
| List repositories accessible to the configured PAT |
| Get details of a single repository |
Branches
Tool | Description |
| List branches for a repository |
| Get branch details including latest commit SHA, message, and protection status |
| Create a branch from an existing base branch |
Files
Tool | Description |
| Get the contents of a file in a repository. Files larger than 3.5 MB are truncated — check the |
| Get the raw decoded text content of a file in a repository |
| Get the contents of multiple files in a repository. Results are paginated — when |
| List files and directories at a repository path |
| Create or update a file in a repository branch |
| Create or update multiple files in a repository branch in a single commit |
| Create a single commit that writes multiple files to a repository branch |
| Apply targeted text patches to a file without replacing the entire content. Supports |
| Delete a single file from a branch |
Pull requests
Tool | Description |
| List open pull requests for a repository |
| List pull requests filtered by state ( |
| Get a pull request by number |
| List files changed in a pull request, including patches |
| List general conversation comments on a pull request |
| Post a general conversation comment on a pull request |
| List reviews submitted on a pull request |
| Get the full unified diff for a pull request |
| Create a pull request |
| Update a pull request (title, body, state, base branch) |
Issues
Tool | Description |
| List issues for a repository, filtered by state ( |
| Get a single issue by number |
| Create a new issue |
| Update an existing issue (title, body, state, labels, assignees) |
| Link an issue to a PR using a closing keyword ( |
| List all comments on an issue |
| Post a comment on an issue |
Commits
Tool | Description |
| List commits for a repository, optionally filtered by branch or file path |
| Get full commit detail by SHA or ref, including changed files and diff stats |
Actions
Tool | Description |
| List workflow runs for a repository, optionally filtered by branch, event, or status |
| Get details of a workflow run, including its jobs and steps |
Search
Tool | Description |
| Search for code within a repository — returns file paths and match fragments |
| Search for files by name or path pattern using the git tree (no query limits) |
Testing
The integration tests are split into smaller files to make maintenance safer and avoid giant-file update issues.
Integration files
tests/integration/helpers.tstests/integration/repositories-branches.integration.tstests/integration/pull-requests.integration.tstests/integration/issues.integration.tstests/integration/commits-files.integration.tstests/integration/search-misc.integration.tstests/integration/truncation.integration.ts
Truncation coverage
get_file_contentstruncation is tested with a real file fixture.get_multiple_filespagination is tested withhasMoreandnextCursor.
Getting started
Prerequisites
Node.js >= 24
A GitHub Personal Access Token with
reposcope (or a fine-grained PAT scoped to the repositories you need)
Local development
# 1. Clone the repo
git clone https://github.com/SamNewhouse/github-mcp-bridge.git
cd github-mcp-bridge
# 2. Install dependencies
npm install
# 3. Set up environment variables
cp .env.example .env
# Edit .env and fill in GITHUB_PAT and CONNECTOR_SECRET
# 4. Start the dev server (hot-reloads on change)
npm run devThe server starts on http://localhost:3000 by default (configurable via PORT in .env).
Environment variables
Variable | Required | Description |
| ✅ | Default GitHub PAT — used for any owner that has no dedicated entry |
| ✗ | Owner-specific PAT. The owner name is uppercased and hyphens replaced with underscores to form the key — e.g. |
| ✅ | Shared secret used to authenticate requests to the bridge. Minimum 32 characters — generate with |
| ✗ | HTTP port (default: |
| ✗ | Idle timeout for server-owned sessions in milliseconds (default: |
| ✗ | Maximum total lifetime for a server-owned session in milliseconds (default: |
Deploying
The bridge is a standard Node.js HTTP server. It can be deployed anywhere that runs Node.js.
Set the environment variables (GITHUB_PAT, CONNECTOR_SECRET, and optionally PORT, MCP_SESSION_IDLE_TTL_MS, and MCP_SESSION_MAX_TTL_MS) in your hosting environment, then run:
npm run build
npm startOnce deployed, use the root URL as the MCP endpoint and point your client at it.
Verifying the server
Health check
curl -H "Authorization: Bearer $CONNECTOR_SECRET" http://localhost:3000/health
# {"ok":true}Discover all tools
A direct authenticated tools/list request works even when the client does not explicitly run initialize first.
curl -s -X POST http://localhost:3000 \
-H "Authorization: Bearer $CONNECTOR_SECRET" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'Call a tool
curl -s -X POST http://localhost:3000 \
-H "Authorization: Bearer $CONNECTOR_SECRET" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "list_branches",
"arguments": {
"owner": "your-org",
"repo": "your-repo"
}
}
}'Optional MCP initialise flow
Clients that prefer the traditional MCP initialise handshake can still use it.
curl -i -s -X POST http://localhost:3000 \
-H "Authorization: Bearer $CONNECTOR_SECRET" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc":"2.0",
"id":1,
"method":"initialize",
"params":{
"protocolVersion":"2025-03-26",
"capabilities":{},
"clientInfo":{"name":"example-client","version":"1.0.0"}
}
}'Connecting an MCP client
Configure your MCP client with:
Setting | Value |
URL | Your deployment URL |
Auth type | Bearer token / API key |
Secret | Your |
The client can call tools/list at any time to discover all available tools and their input schemas dynamically.
Clients that do preserve and replay Mcp-Session-Id will continue to work, but clients that do not preserve it can still use the bridge normally because the server owns session continuity.
Security
Authentication
Every request (including /health and HEAD /) requires a valid CONNECTOR_SECRET provided as:
Authorization: Bearer <secret>header, orX-Api-Key: <secret>header
Secret comparison uses crypto.timingSafeEqual to prevent timing side-channel attacks.
Secret rotation
CONNECTOR_SECRET supports zero-downtime rotation via a comma-separated list:
CONNECTOR_SECRET="newSecret,oldSecret"A request is authorised if it matches any entry. Once all clients have rotated to the new secret, remove the old one.
Rate limiting
Failed authentication attempts are tracked per IP in-memory. After 10 failures within a 15-minute window, the IP is blocked for 15 minutes. The counter resets on successful authentication.
Note: The rate limiter is per-process. On serverless runtimes such as Vercel, each cold start gets a fresh counter. For persistent cross-instance enforcement, swap the in-memory store for a shared backend such as Redis.
Session safety
Server-owned sessions are bound to the authenticated caller identity, and authentication is still checked on every request. A live session is a continuity mechanism, not an authentication substitute.
Security headers
The public splash page (GET /) is served with:
Content-Security-PolicyX-Content-Type-Options: nosniffX-Frame-Options: DENYReferrer-Policy: no-referrer
Best practices
Keep
GITHUB_PATserver-side only — never expose it to clientsUse a fine-grained PAT with the minimum repository permissions needed
Use a minimum 32-character random
CONNECTOR_SECRET— generate withopenssl rand -hex 32Rotate
CONNECTOR_SECRETimmediately if it is ever exposedRotate
GITHUB_PATimmediately if it is ever exposedNever log or commit secrets
Scripts
Command | Description |
| Start dev server with hot-reload |
| Compile TypeScript to |
| Run compiled server from |
| Run all tests (unit + integration) |
| Run unit tests only |
| Run integration tests only |
| Type-check without emitting |
| Format code with Prettier |
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityAmaintenanceMCP server that exposes GitHub operations as tools for AI agents, enabling code search, issue management, and PR review.12MIT
- AlicenseCqualityBmaintenanceA production-ready MCP server for GitHub operations, providing tools for repository management, issues, pull requests, and more via both MCP stdio and REST API.27MIT
- Flicense-qualityBmaintenanceA GitHub MCP server that wraps the gh CLI to expose GitHub operations like issues, pull requests, branches, labels, repositories, CI actions, and Projects V2 as tools for MCP clients.
- Alicense-qualityBmaintenanceMCP server providing maximum practical control over GitHub via REST and GraphQL APIs, exposing 22 tools for repository management, file operations, issues, PRs, Actions, and more.MIT
Related MCP Connectors
A MCP server built for developers enabling Git based project management with project and personal…
An MCP server that gives your AI access to the source code and docs of all public github repos
Markdown-first MCP server for Notion API with 8 composite tools and 39 actions.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/SamNewhouse/github-mcp-bridge'
If you have feedback or need assistance with the MCP directory API, please join our Discord server