Repository navigation
app/: MCP's 401 names the resource's metadata, so clients find the sign-in (sc-8900) - #123
Merged
Merged
Conversation
ndbroadbent
force-pushed
the
mcp-challenge
branch
from
December 3, 2026 07:43
66c73f1 to
60b550d
Compare
…es and today's server sent (sc-8900)
ndbroadbent
force-pushed
the
mcp-challenge
branch
from
December 3, 2026 08:51
60b550d to
9d616c8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found by the new journeys suite:
POST https://mcp.visualci.com/mcpwithout a token answers 401 with a bareWWW-Authenticate: Bearer. The MCP spec (2025-06-18, authorization) requires the challenge to name the protected resource's metadata (RFC 9728 section 5.1), which is how a client such as Claude Code finds the OAuth server to sign in with. The metadata document itself was already served.app/ now answers as today's server/ did (
server/src/mcp.rs,auth): through oauth-provider'schallenge, for the resource<VISUALCI_MCP_URL>/mcp(or<APP_URL>/mcpon one host), scopemcp:Bearer resource_metadata="https://mcp.visualci.com/.well-known/oauth-protected-resource/mcp", scope="mcp";error="invalid_token", error_description="The token is unknown or revoked.".Tests
an_mcp_client_finds_the_sign_in_from_the_401follows the connect flow as a client does: it parses the challenge's auth-params (RFC 6750 section 3), fetches theresource_metadataURL, then the authorization server's metadata, and checks it offers authorization, token and dynamic registration endpoints and PKCE with S256.rejects_requests_without_a_valid_tokenalso checksinvalid_token.On main the first test fails at once: a bare
Bearerhas no parameters.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.