/mcp accepts the same bearers as the REST API, plus an OAuth token where the deployment brokers one.
Anonymous calls count against the MCP client’s IP. Each client gets its own anonymous bucket.
Token handling on
/mcp:
- Missing or unknown token:
401withWWW-Authenticate: Bearer. Where OAuth is enabled, the challenge also carriesresource_metadata, which is how a client starts the flow. - Key lookup fails:
503with no challenge. Retry. The key is not rejected. - Self-hosted, no identity provider:
/mcpruns without a token check.
OAuth
Where the deployment enables it,/mcp is an OAuth 2.0 authorization server. Login goes through Clerk. Bearer tokens still work. A connector directory uses this mode, and the client registers itself instead of receiving a token out of band.
The issuer is https://gateway.vlm.run/mcp, with /mcp/authorize, /mcp/token, and /mcp/register under it. It implements Dynamic Client Registration (RFC 7591) and Client ID Metadata Documents, and it requires PKCE (S256). A client registers at connect time.
- Scopes:
openid,email, andprofile. - Refresh token: Also request
offline_access. Without it, the client sends the user back to sign in when the access token expires. - Persistence: Registrations and sign-ins are shared by every replica and survive a restart, so a client does not register again after a deploy.
/mcp:
An unauthenticated call returns a transport-level
401 with WWW-Authenticate: Bearer resource_metadata="…". That challenge is what makes a client show a connect prompt. The resource URL has to match the client URL character for character: https://gateway.vlm.run/mcp.