inspector icon indicating copy to clipboard operation
inspector copied to clipboard

MCP Inspector starts Authorization Code Flow with wrong redirect_uri

Open SJGeeKo opened this issue 1 month ago • 0 comments

Inspector Version

  • 0.17.2

Describe the bug

I'm currently developing a MCP server that requires OAuth2 authentication. My Authorization Server supports DCR. When I try to connect to my MCP server with MCP Inspector, It sometimes begin authorization code flow with wrong client_id. For example, MCP Inspector created OAuth Client with "http://localhost:6274/oauth/callback/debug", and begins authorization code flow with URL below:

https://my-mcp.bryan-test-4324.com/oauth2/authorize?response_type=code&client_id=KpMjPEzpPMSCz085Z_EpKOVqh6lA8HKRIQlg4vO064U&code_challenge=nGiruUmF-q3Ni7iYZZ8FK8tcNMXDS7Sdaqy1iGxMCoE&code_challenge_method=S256&redirect_uri=http%3A%2F%2Flocalhost%3A6274%2Foauth%2Fcallback&state=13a5669e6bb6326968ca68468369bf955958a78260a9a30022f2df26a9e9c0d1&resource=http%3A%2F%2Flocalhost%3A8080%2Fmcp2

as you can see, it requests with redirect_uri "http://localhost:6274/oauth/callback", which is different from what it created. I guess it's MCP Inspector's bug. Could you please check this out?

To Reproduce

  1. prepare a MCP server that requires OAuth2 authentication
  2. prepare a OAuth2 Authorization Server related to the mcp server.
  3. make the Authorization Server to support DCR
  4. start MCP Inspector
  5. click "Open OAuth Settings" button
  6. follow the steps
  7. on "Request Authorization and acquire authorization code" step, see if this bug happens.

It didn't occur everytime I tried, sometimes it did. So I guess it's kind of tricky to reproduce.

Expected behavior Start authorization code flow with redirect_uri that MCP Inspector request during DCR.

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: macOS Sequoia 15.6.1
  • Browser chrome

Additional context Add any other context about the problem here.

Version Consideration

Inspector V2 is under development to address architectural and UX improvements. See CONTRIBUTING.md for information about V2 development.

SJGeeKo avatar Nov 21 '25 05:11 SJGeeKo