Skip to content

Regression in OAuth 2.0 Flow with Client ID in 0.16.8 #824

Closed

Description

@sberyozkin

Inspector Version

  • 0.16.8

Describe the bug

MCP Inspector fails to complete the authorization code flow, it starts spinning after a user logs-in to the OAuth2 provider (Keycloak) and is redirected back to MCP Inspector

To Reproduce
Steps to reproduce the behavior:

  1. Check out https://github.com/quarkiverse/quarkus-mcp-server
  2. No need to build anything, just go to https://github.com/quarkiverse/quarkus-mcp-server/tree/main/samples/multiple-secure-mcp-http-servers
  3. Do mvn quarkus:dev - it starts the MCP server, and launches a Keycloak container
  4. In MCP Inspector: set address to http://localhost:8080/mcp, Transport Type: Streamable HTTP, OAuth2 Client id - alpha-client, scope: openid quarkus-mcp-alpha
  5. Press Connect - you are redirected to Keycloak, login as user alice, password alice, you are redirected back to MCP Inspector, no option to select tools is offered, MCP Inspector is in the loop in the console and Web Developer Tools/Network

Expected behavior
It should work exactly as it works with 0.16.7 - after the login, MCP Inspector does not spin, a user is offered an option to select tools. See this description.

Screenshots
it is hard to capture anything specific - 401 errors are reported in the console, Web Developer Tools/Network shows MCP Inspector is looping

Environment (please complete the following information):

  • OS: Fedora 42
  • Firefox

Additional context

Let me know if I can help with some extra info.
The Quarkus blog post is due to go today and I had to update the text to recommend users to hold on to the 0.16.7.

Activity

  1. sivankri commented on Sep 25, 2025

    @sivankri

    Hi Team, i am facing same issue. Is there any workaround currently?

  2. olaservo commented on Sep 29, 2025

    @olaservo
    Member

    I have not personally reproduced this yet, but setting to P1 since it appears to be a blocking issue with multiple reports and upvotes.

  3. max-stytch commented on Sep 30, 2025

    @max-stytch
    Contributor

    I was able to repro! Some debugging notes:

    It does look like the OAuth request succeeds, and a token is issued.

    Image

    Something fails within the MCP connection itself (I'm not sure what, yet) and then the MCP client issues a refresh token request, which succeeds.

    Image

    The client tries again with the new token, which fails again, which triggers a new refresh token request, which succeeds, so the client tries again with the new token, entering into an infinite loop.

    So something is definitely up, but I don't think it is related to the OAuth redirect URL PR since a token is definitely being returned.

  4. max-stytch commented on Sep 30, 2025

    @max-stytch
    Contributor

    Found it! Although an access token was returned, the bearer header isn't being sent

    Image

    This looks like it is triggered by the custom header placeholder that is added automatically when the Authentication toggle is opened.

    Image

    Deleting the custom header restores the correct access token, and everything works again.

    Image

    That means this issue is a duplicate of #829 and should be addressed by https://github.com/modelcontextprotocol/inspector/830 - cc @olaservo @cliffhall if we want to get this out faster since it fixes the p1.

    There's an immediate workaround available of deleting the custom header but it is quite annoying to put on the user every time.

  5. rgwood-dd commented on Oct 1, 2025

    @rgwood-dd

    FYI, we're still seeing auth issues with v0.17.0 (which looks like it includes #830 ). When attempting to connect to our streamable HTTP server, it fails and prints these errors over and over in the console:

    Error from MCP server: Error: Error POSTing to endpoint (HTTP 401): {"errors":["Unauthorized"]}
        at StreamableHTTPClientTransport.send (file:///Users/reilly.wood/.npm/_npx/5a9d879542beca3a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js:284:23)
        at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    New StreamableHttp connection request
    Query parameters: {"url":"https://mcp.datadoghq.com/api/unstable/mcp-server/mcp","transportType":"streamable-http"}
    Created StreamableHttp client transport
    Client <-> Proxy  sessionId: 39255045-36f7-4b2a-8b6e-a605c30f2e69
    Error from MCP server: Error: Error POSTing to endpoint (HTTP 401): {"errors":["Unauthorized"]}
        at StreamableHTTPClientTransport.send (file:///Users/reilly.wood/.npm/_npx/5a9d879542beca3a/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js:284:23)
        at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    New StreamableHttp connection request
    Query parameters: {"url":"https://mcp.datadoghq.com/api/unstable/mcp-server/mcp","transportType":"streamable-http"}
    Created StreamableHttp client transport
    Client <-> Proxy  sessionId: efbe8892-4baa-4494-9801-8b5c28b41777
    

    In the UI we see an "Invalid Authorization Header" error:

    Image

    Workaround

    Downgrade to v16.7 with npx @modelcontextprotocol/inspector@0.16.7

  6. cliffhall commented on Oct 2, 2025

    @cliffhall
    Member

    @rgwood-dd Did you try disabling the header? This header should be off by default, unless in a previous version you had sent it and it is in your local storage. Try clearing your local storage if disabling it doesn't work.

    Image
  7. rgwood-dd commented on Oct 2, 2025

    @rgwood-dd

    I did not try that, I should have read the error message more closely 🤦

    Disabling that solves the issue, and it works by default after clearing my local storage. Thank you!

  8. sberyozkin commented on Oct 3, 2025

    @sberyozkin
    Author

    Good job

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    authIssues and PRs related to authorization

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions