github-universal-mcp
Provides read-only access to private GitHub repositories, including tools such as github_whoami to retrieve the authenticated user's GitHub identity.
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-universal-mcpWhat GitHub user am I logged in as?"
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-universal-mcp
Self-hosted remote MCP server that gives any MCP client read-only tools for private GitHub repos. Runs on Cloudflare Workers. It speaks standard MCP (Streamable HTTP) and the MCP authorization spec (OAuth 2.1 with PKCE, dynamic client registration, protected resource metadata), so it works with any client that supports remote servers with OAuth, hosted or local. Towards GitHub it uses a GitHub App user token. Only allowlisted GitHub logins can finish sign-in.
Derived from nemolize/remote-mcp-github (MIT, see LICENSE). Kept: the workers-oauth-provider wiring and src/workers-oauth-utils.ts (consent page, CSRF and state binding). Changed: GitHub App flow instead of OAuth App scopes, login allowlist, stateless Streamable HTTP at /mcp (no Durable Object, no SSE), tool surface.
Status
Minimal build: one tool, github_whoami, to prove a client can connect and call tools before adding more.
Related MCP server: GitHub Read MCP Server
Endpoints
Path | Purpose |
| MCP endpoint (Streamable HTTP, JSON responses). Requires a Bearer token. |
| OAuth server used by MCP clients (dynamic client registration). |
| GitHub App redirect target. |
| Discovery metadata. |
Deploy
Needs Node.js 22+, a Cloudflare account and a GitHub account. Commands assume a bash shell (WSL or Fedora).
Set
ALLOWED_GITHUB_LOGINSinwrangler.jsoncto your GitHub login, then install and log in to Cloudflare:git clone https://github.com/darl33/github-universal-mcp cd github-universal-mcp npm ci npx wrangler login npx wrangler whoami # note your workers.dev subdomainThe Worker URL will be
https://github-mcp.<subdomain>.workers.dev.Create the KV namespace and paste the printed
idintowrangler.jsonc(kv_namespaces[0].id):npx wrangler kv namespace create OAUTH_KVCreate the GitHub App at https://github.com/settings/apps/new:
Field
Value
Homepage URL
https://github-mcp.<subdomain>.workers.devCallback URL
https://github-mcp.<subdomain>.workers.dev/callbackExpire user authorization tokens
On (tokens last 8 h, refresh tokens 6 months)
Request user authorization (OAuth) during installation
Off
Enable Device Flow
Off
Webhook > Active
Off
Repository permissions
Contents: Read, Metadata: Read, Pull requests: Read, Issues: Read
Account permissions
None
Where can this GitHub App be installed?
Only on this account
Then: generate a client secret, and use Install App to install it on Only select repositories. A GitHub App user token can only reach repos that are both installed and visible to the user, so the install list is the access boundary.
Set secrets and deploy:
npx wrangler secret put GITHUB_CLIENT_ID # App "Client ID" (starts with Iv) npx wrangler secret put GITHUB_CLIENT_SECRET openssl rand -hex 32 | npx wrangler secret put COOKIE_ENCRYPTION_KEY npm run deploy curl -s https://github-mcp.<subdomain>.workers.dev/.well-known/oauth-authorization-serverConnect a client. Point any MCP client that supports remote servers with OAuth at:
https://github-mcp.<subdomain>.workers.dev/mcpLeave any OAuth client ID and secret fields empty; the client registers itself. The client opens a browser to the consent page, then GitHub; sign in with an allowlisted account. Local clients that use a
http://localhostorhttp://127.0.0.1redirect work too, since the registration accepts loopback redirect URIs.To debug without a client, use MCP Inspector (
npx @modelcontextprotocol/inspector) with transport "Streamable HTTP" and the URL above.
Smoke test
Ask the client (or Inspector) to call
github_whoami. Expect your own login.Sign-in as any other GitHub account must end on a 403 page.
curl -i -X POST https://github-mcp.<subdomain>.workers.dev/mcpmust return 401 with aWWW-Authenticateheader pointing at the resource metadata.
Troubleshooting
Logs:
npx wrangler tail. If a client says sign-in succeeded but calls fail, check whether its requests to/mcpcarry anAuthorization: Bearerheader.If a client shows the server as connected but never offers its tools, test with MCP Inspector first. If Inspector works, the problem is on the client side.
Some clients refuse to add a second server with the same URL. Remove the old entry before re-adding.
whoamifailing with 401 about 8 hours after connecting is expected in this build: token refresh is the next step. Reconnect the server in your client as a workaround.
Security notes
Tokens: the GitHub access and refresh tokens live in the grant
props, whichworkers-oauth-providerencrypts before writing to KV. The key is derived from the MCP access token held by the client, so KV contents alone cannot be decrypted.Allowlist:
ALLOWED_GITHUB_LOGINSinwrangler.jsonc. It matches login, which GitHub lets users rename; the numeric user id is stored in props if a stricter id check is wanted later.The server is never authless:
/mcpreturns 401 without a valid token issued after the allowlist check.
This server cannot be deployed
Maintenance
Related MCP Connectors
GitHub Private MCP Pack — access private repos, org data via OAuth.
Create, deploy, and operate MCP servers directly from your GitHub repositories.
GitHub MCP — wraps the GitHub public REST API (no auth required for public endpoints)
OAuth-protected, read-only-by-default MCP server for provenance-labeled QuillCaddie project memory.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceConnects Claude to GitHub via OAuth and proxies official GitHub MCP tools, allowing each end user to interact with GitHub as themselves.-
- FlicenseNot gradedqualityFmaintenanceRead-only MCP server for the GitHub REST API that enables agents to query repositories, issues, files, and users without any write access.-
- AlicenseNot gradedqualityCmaintenanceProvides read-only access to GitHub repositories and issues through standardized MCP tools, with caching to handle API rate limits.1MIT
- AlicenseNot gradedqualityCmaintenanceEnables self-hosted, read-only remote interaction with GitHub repositories, allowing listing repositories, searching code, and inspecting commits, pull requests, issues, and diffs via authenticated MCP clients.94 npmMIT