Regression when using OAuth mcp servers
Describe the bug
This commit b7ec3829d4bf8e8e148d817fbeb2c65435b7752a seems to have introduced a side-effect where an OAuth mcp server is not queried correctly.
Calling connect on a server with a valid .well-known/oauth-authorization-server is instead going to the local server: http://localhost:6277/.well-known/oauth-authorization-server.
To Reproduce Steps to reproduce the behavior:
- Checkout the prior commit 8b38d6b18f65e06f83d6625637654862c65a87fe
- Run any sse mcp server with an OAuth metadata endpoint and attempt to connect to it
- Observe that the request correctly goes to the mcp server's base url
- Checkout b7ec3829d4bf8e8e148d817fbeb2c65435b7752a
- Run the same sse mcp server with an OAuth metadata endpoint and attempt to connect to it
- Observe that the request now goes to the proxy not the intended metadata endpoint
Logs
The first three requests are from the prior commit and are correct 8b38d6b18f65e06f83d6625637654862c65a87fe
The second group of sse requests are from the regression, the requests are now going to the proxy only.
For those wondering in the meantime, just use the previous minor version: npx @modelcontextprotocol/[email protected] and it will work fine :)
Thank you @Lp-Francois ! I was tearing my hair out on this "simple" example that wasn't working! https://github.com/cloudflare/ai/tree/main/demos/remote-mcp-server
Thank you @Lp-Francois ! I was tearing my hair out on this "simple" example that wasn't working! https://github.com/cloudflare/ai/tree/main/demos/remote-mcp-server
@Taytay I ran into the exact same problem with the Cloudflare demo :)
Thank you! I've been beating my head against this thinking it was something in my code until I came across this. I get the same error for SSE and Streamable HTTP.
You can also comment out authProvider for each configuration object: https://github.com/modelcontextprotocol/inspector/blob/main/client/src/lib/hooks/useConnection.ts#L316 and run a local build
Glad to see I am not the only one loosing hair over this :) Quick one - does 0.11.0 really fix this for you? Running a custom OAuthAuthorizationServerProvider and while a custom test script works without a problem I cannot get this to work with the inspector 0.11.0 or 0.12.0. Using transport streamable http
I’m using streamable transport in the node sdk which has backwards compatibility to sse. At least enough compatibility for v11 to let me select SSE and the connect button triggers a check for the well known directory and then starts and complete the oauth flow.
At which point I have to switch to v12 and select streamable. Because v11 does not send the auth header to streamable endpoints
Seeing these issues makes me confident almost nobody is making these services yet haha, I’m just happy to figure this out and have it working
I believe this was fixed in 0.13.0: https://github.com/modelcontextprotocol/inspector/releases
Please re-open if you're still running into issues.