Skip to main content
Your @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:
  • Client ID — the public identifier for your app
  • Client Secret — the private credential for your app
Set the authorized redirect URI to:
Replace 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 wrangler secret put for secrets and wrangler.toml / wrangler.jsonc for non-sensitive values.For Cloudflare Workers, set secrets via the CLI:
For local development, add all variables to .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.
Localhost URLs will not work for OAuth. The provider’s callback and client redirect must reach your server over a public URL.
4

Connect your MCP client

Point your MCP client at the /authorize endpoint to begin the OAuth flow. For example, when configuring a Claude Web custom connector:
The client will redirect to /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.

OAuth endpoints

Your server exposes the following OAuth 2.1 endpoints automatically: