Skip to content

Conversation

halllo
Copy link

@halllo halllo commented Sep 21, 2025

There currently is a problem with MCP servers that rely on a remote authorization server at a different host. During OAuth login the /authorize request is made to the correct authorization server, but the /token request is made against the MCP server.

Due to creating multiple transports and recursive invocations of connectToRemoteServer(), the acquired resource metadata (containing the correct authorization server) was forgotten between /authorize and /token calls.

Unfortunately the transport has the resource metadata in a private field, so I inject it by bypassing the typesystem. Going forward there should be only a single transport used for everything and no recursions. For now I consider this fix the bare minimum to get spec compliant OAuth to working at all.

…quired resource metadata (containing the correct authorization server) were forgotten between /authorize and /token calls. Now the metadata is remembered throughout the entire login flow.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant