Skip to main content
Glama
keyclaw6

GitHub MCP Bridge

by keyclaw6
README.md
# GitHub MCP Bridge

A private, write-capable GitHub MCP server for all repositories allowed by its
server-side GitHub token. It supports repository discovery, file reads,
branches, atomic multi-file commits, deletions, and pull requests.

## Deploy on Render

1. Put this project in a GitHub repository.
2. In Render, create a Blueprint from that repository. `render.yaml` builds the
   Docker service and prompts for its secrets.
3. Enter:
   - `GITHUB_TOKEN`: a GitHub token with the required repository access.
   - `AUTH_ISSUER_URL`: your Auth0 tenant URL, including `https://`.

Render supplies the OAuth audience, `RESOURCE_SERVER_URL`, and permitted
hostname automatically.
The MCP endpoint is `https://YOUR_RENDER_HOST/mcp`.

## Configure Auth0

In Auth0:

1. Create an API whose Identifier is the final Render `/mcp` URL.
2. Keep RS256 signing and set that API as the tenant's Default Audience.
3. Enable Client ID Metadata Document (CIMD) registration.
4. Import ChatGPT's CIMD URL when ChatGPT shows it during plugin setup.
5. Allow user-delegated access to the API and use a login method only you can
   access.

## Connect ChatGPT

Create a developer-mode plugin with:

- **Server URL:** `https://YOUR_RENDER_HOST/mcp`
- **Authentication:** OAuth

ChatGPT discovers Auth0 from the server and opens the login flow.

## Local development

```bash
cp .env.example .env
# Add GITHUB_TOKEN and keep MCP_AUTH_ENABLED=false.
docker compose up --build
curl http://127.0.0.1:8000/health
```

Local MCP endpoint: `http://127.0.0.1:8000/mcp`.

## Safety defaults

- Direct default-branch commits are disabled.
- Force pushes are not implemented.
- Production OAuth validates issuer, audience, signature, expiry, and scopes.
- All repositories accessible to the GitHub token are available by default.
- `ALLOWED_BRANCH_PREFIXES` can optionally restrict writable branches.
- File and commit payload sizes are capped.

Use a short-lived GitHub token and start with a disposable repository.