Add OAuth sign-in for remote MCP servers #3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "mcp-oauth"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Remote MCP servers (Streamable HTTP and SSE) can now authenticate with
OAuth: authorization code with PKCE, using dynamic client registration or
a configured client ID and secret, with tokens refreshed automatically.
A server marked for OAuth shows "sign-in required" in Settings -> MCP;
Sign in sends the browser to the provider and the callback brings it
back connected. Sign out forgets the tokens and registration.
Credentials live in the kv table (mcp-oauth namespace), bound to the
server's URL and client ID and removed with the server. Only a sign-in
started from the UI may register a client or begin a flow; background
connections only use and refresh stored tokens, so an expired session
becomes auth_required instead of registering new clients unattended.
The unauthenticated callback is guarded by a random, single-use state
that expires after 15 minutes, and authorization URLs must be http(s)
because the UI navigates to them. Client secrets are masked over the API.
Tested against an OAuth-protected fixture server with its own minimal
authorization server (unit and e2e), and by hand against the Wispr Flow
Notetaker MCP server.
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com