mcp-oauth-starter
Provides GitHub OAuth sign-in and tools to list the authenticated user's repositories, create issues, and close issues through the GitHub API using per-user access tokens.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
mcp-oauth-starter
Copy-and-run OAuth 2.1 remote MCP starter for Cloudflare Workers: per-user token isolation, MCP tool annotations, structured audit logging, rate limits, and a built-in directory pre-flight.
What you get
OAuth 2.1 split deployment: authorization server (
auth-server/) + MCP resource server (mcp-server/) linked by a Service BindingPer-user isolation via encrypted
props(userId,login,upstreamAccessToken,scopes) — no cross-request token cacheFixed-scope tools with MCP annotations (
readOnlyHint,destructiveHint, …)Audit log — one JSON line per tool call (no secrets or argument bodies)
Rate limit — per-user fixed window (
429+Retry-After)Pre-flight —
node scripts/preflight.mjsfor directory-style checks
Upstream sign-in defaults to GitHub OAuth (demo). Swap it for your own IdP or your product’s OAuth in auth-server/.
Related MCP server: github-mcp-server
Quickstart
git clone https://github.com/konstantinbozukov/mcp-oauth-starter.git
cd mcp-oauth-starter
npm ci
cp .dev.vars.example auth-server/.dev.vars # fill GitHub OAuth placeholdersCreate a Cloudflare KV namespace for OAUTH_KV and set IDs in auth-server/wrangler.jsonc (placeholders only in repo).
Terminal 1 (auth server):
npm run dev -w auth-serverTerminal 2 (MCP resource server):
npm run dev -w mcp-serverLocal defaults: auth http://127.0.0.1:8787, MCP http://127.0.0.1:8788/mcp.
Connect from Claude / Cursor / MCP Inspector
{
"mcpServers": {
"mcp-oauth-starter": {
"url": "http://127.0.0.1:8788/mcp"
}
}
}Complete the browser consent + GitHub sign-in when the client starts OAuth. Request scopes mcp:read, mcp:write, and offline_access for full tool access.
Tools
Tool | Title | Read-only | Destructive | Notes |
| Who am I | yes | no | Login, id, granted scopes |
| List my repositories | yes | no |
|
| Create issue | no | no | Needs |
| Close issue | no | yes | Needs |
Architecture
sequenceDiagram
participant Client as MCP client
participant MCP as mcp-server (resource)
participant Auth as auth-server (AS)
participant GH as GitHub OAuth/API
Client->>MCP: POST /mcp (no token)
MCP-->>Client: 401 WWW-Authenticate
Client->>Auth: OAuth authorize + PKCE
Auth->>GH: Upstream authorize
GH-->>Auth: Callback + code
Auth-->>Client: Redirect with code
Client->>Auth: Token exchange
Client->>MCP: POST /mcp Bearer token
MCP->>Auth: validateToken (service binding)
MCP->>GH: Tool call with user upstream tokenSecurity model
MCP access tokens are validated on every request; upstream tokens live only in encrypted
props.No module-level cache of upstream tokens (see
tests/isolation.test.ts).Audit records include
userId,tool,outcome,durationMs, optionalupstreamStatus— never tokens or free-text arguments.
Pre-flight
node scripts/preflight.mjs http://127.0.0.1:8788/mcp # local, no auth wrapper
node scripts/preflight.mjs http://127.0.0.1:8788/mcp --auth oauthChecks include: initialize + tools/list, annotation/schema rules, catch-all detection, prompt-injection scan, error quality, optional response size (--sample '{...}'), and OAuth discovery when --auth oauth.
Adapting to your API (five edits)
Replace GitHub upstream in
auth-server/src/index.tsandauth-server/src/github-upstream.tswith your IdP helpers.Change tool implementations in
mcp-server/src/create-server.ts/mcp-server/src/github-api.tsto call your REST API usingprops.upstreamAccessToken.Update
scopesSupported/MCP_SCOPESinshared/oauth-scopes.tsand consent copy inauth-server/src/consent.ts.Set production URLs in both
wrangler.jsoncfiles (ISSUER,MCP_SERVER_URL,AUTH_SERVER_URL).Rename registry metadata in
server.json/glama.jsonto a namespace you control (see note inserver.json).
Directory readiness
See docs/DIRECTORY-READINESS.md. Registry files are prepared only — nothing in this repo publishes to the MCP Registry or third-party directories.
Deploy (your Cloudflare account)
npx wrangler kv namespace create OAUTH_KV(auth worker) and updatewrangler.jsonc.npx wrangler secret put GITHUB_CLIENT_IDandGITHUB_CLIENT_SECRETon auth-server (do not commit).Deploy auth-server first, then mcp-server (service binding target must exist).
Point clients at
https://<mcp-worker>/mcp.When ready, publish
server.jsonunder your ownio.github.<org>/...namespace (manual step; not automated here).
Development
npm ci
npm run typecheck
npm testTests use Vitest in Node with mocked fetch and OAuth shims — no credentials and no network (aligned with brief: plain Vitest + in-process handlers, not @cloudflare/vitest-pool-workers due to Vitest 5 peer mismatch at build time).
Built with AI assistance and human review. Part of the mcp.edge.report showcase. MIT licensed.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
The Stytch MCP server is a reference implementation that demonstrates remote MCP server authentication and authorization using Stytch Connected Apps. It provides OAuth 2.1-compliant authorization (including PKCE), Dynamic Client Registration, and validates Stytch-issued access tokens to enable AI agents to securely interact with external services through permissioned access, supporting scopes like openid, email, profile, and manage:project_data.
One MCP endpoint for your company's tools, with per-person sign-in, policy and audit.
One OAuth connector for your team's remote MCP servers, with Tool Packs, guardrails and logs.
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceEnables claude.ai to connect to GitHub MCP using OAuth, providing full toolset for repository, issue, PR, Actions, and gist operations.-
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with GitHub issues, pull requests, and Actions workflows through MCP tools.-
- AlicenseNot gradedqualityCmaintenanceGives any MCP client read-only tools for private GitHub repositories, with OAuth-based authentication and an allowlist of GitHub logins.MIT
- AlicenseAqualityCmaintenanceEnables any MCP client to read GitHub repositories, branches, tags, pull requests, files and Actions workflow runs, and optionally create branches and pull requests, comment, assign, approve, trigger workflows, merge and delete. Read-only by default, with separate opt-in switches for write and destructive operations, working against github.com or GitHub Enterprise Server.11MIT