Repository navigation
fix(mcp): advertise the authorization server verbatim in protected-resource metadata - #50
Merged
Conversation
…source metadata The SDK's ProtectedResourceMetadata types authorization_servers as AnyHttpUrl, and pydantic renders the bare origin as "https://zernio.com/". MCP SDK 2.x clients (Hermes Agent 0.21+) compare that byte for byte with the issuer "https://zernio.com" from zernio.com/.well-known/oauth-authorization-server (SEP-2468) and abort with "Authorization server metadata issuer mismatch". Axiom shows 12 Hermes 0.21.5 IPs looping on the issuer document in the last 48h and zero registrations from that user agent. Upstream fixed the model in mcp 2.0 (url_preserve_empty_path), which fastmcp 3.x cannot resolve to, so the document is rendered by a RemoteAuthProvider subclass instead. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011CMTnkAaNe8GJksNdAwg3K
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.
Why
Every new Hermes Agent 0.21.x connection to
mcp.zernio.comfails withAuthorization server metadata issuer mismatch: https://zernio.com != https://zernio.com/. The SDK'sProtectedResourceMetadatatypesauthorization_serversasAnyHttpUrl, pydantic renders the bare origin with a trailing slash, and MCP SDK 2.x clients compare it byte for byte with the issuer fromzernio.com/.well-known/oauth-authorization-server(SEP-2468). Axiom shows 12 Hermes 0.21.5 IPs looping on the issuer document in the last 48h and zero registrations from that user agent. Existing installs are unaffected (a stored refresh token skips discovery).What
VerbatimIssuerRemoteAuthProviderrenders the RFC 9728 document itself withauthorization_serversas the configured strings; route path, CORS, cache header, scopes narrowing (ChatGPT surface) and resource are unchanged.Upstream fixed the model in mcp 2.0 (
url_preserve_empty_path), but fastmcp 3.x caps mcp at 1.30.0, which still lacks it. Same change landed in the dormantzernio-mcprepo as #2 before I noticeddevelophere is what Railway serves.🤖 Generated with Claude Code
https://claude.ai/code/session_011CMTnkAaNe8GJksNdAwg3K