@phake/mcp server acts as an OAuth 2.1 authorization server. When a client authenticates, your server proxies the flow to an upstream provider (e.g., Google), maps the resulting provider token to an internal RS token, and returns that token to the client.
Your server must be publicly accessible for OAuth to work. Clients connect from their own infrastructure, and the provider’s callback must be able to reach your
/oauth/provider-callback endpoint.1
Create an OAuth app with your provider
Register an OAuth application with your identity provider (e.g., Google Cloud Console, GitHub, etc.) and collect:Replace
- Client ID — the public identifier for your app
- Client Secret — the private credential for your app
your-server.com with your deployed server’s domain.2
Set the required environment variables
Configure the following environment variables in your deployment. For Cloudflare Workers, use For local development, add all variables to
wrangler secret put for secrets and wrangler.toml / wrangler.jsonc for non-sensitive values.For Cloudflare Workers, set secrets via the CLI:
.dev.vars:.dev.vars
3
Deploy your server publicly
Deploy your server so it is reachable from the internet. For Cloudflare Workers:Your server’s base URL will be something like
https://your-worker.your-subdomain.workers.dev.4
Connect your MCP client
Point your MCP client at the The client will redirect to
/authorize endpoint to begin the OAuth flow. For example, when configuring a Claude Web custom connector:/authorize, your server will proxy the request to the upstream provider, and after the user grants access the client receives an RS token it can use for subsequent MCP requests.