MCP Inspector stuck in infinite OAuth loop after receiving JWT token - how to fix?
When connecting MCP Tool Inspector to a remote MCP server that requires OAuth, the flow successfully receives a JWT token but then keeps requesting new authorization codes in an infinite loop. Other clients like Cursor and Claude Desktop complete the same flow fine. Is there a fix or workaround?
Originally asked on GitHub: https://github.com/modelcontextprotocol/inspector/issues/633
5 answers
Fixed: the infinite OAuth loop was resolved in Inspector 0.17.0 (PR #830), according to a maintainer comment; a user later confirmed the issue is fixed. Update the Inspector to 0.17.0 or newer and retest.
Until you can upgrade, the workaround reported in the thread is to clear the stored OAuth state in the Inspector's OAuth settings, run the OAuth guided flow step by step until it completes with a token, and only then click Connect - one reporter confirmed this established the connection successfully. Another user reported that auth worked with @modelcontextprotocol/inspector@0.16.7, while the @latest tag still looped at that time.
The cause discussed in the thread: after a successful OAuth exchange the Inspector receives a JWT, but when the proxy server returns a token-expired error (or any 401 that is not self-recoverable, such as invalid requested scopes), the Inspector re-runs the whole OAuth flow instead of refreshing the token, because no refresh-token implementation exists. A contributor noted this often comes from authorization-server or MCP server misconfiguration, so check the scopes your server requests and the authorization server configuration if 401s persist after upgrading.
General advice: verify the Inspector version actually running, since older releases still exhibit the loop.
Did this work for you?What a GitHub user tried on GitHub (Didn't work)
Reproduced the bug: connected Inspector to an OAuth-protected MCP server; the authorization code was exchanged for a JWT, but Inspector requested a new authorization code instead of using the token.
Source: https://github.com/modelcontextprotocol/inspector/issues/633 (opens external site)
Did this work for you?What @williamoleria tried on GitHub (Worked)
Cleared the OAuth state in Inspector's OAuth settings, ran the OAuth guided flow step by step until a token was obtained, then clicked Connect; the connection succeeded.
Did this work for you?What @werkamsus tried on GitHub (Worked)
Reported that auth worked with @modelcontextprotocol/inspector@0.16.7, while the @latest tag still produced the infinite redirect at that time.
Did this work for you?What @cliffhall tried on GitHub (Worked)
Maintainer stated the infinite loop was fixed in 0.17.0 via PR #830 and referenced a suggested workaround in issue #824.
Did this work for you?
Related questions
- MCP Inspector 0.10.2 sends null for unset optional params (error -32602)?
- Why does npx @modelcontextprotocol/inspector fail with 'mcp-inspector: command not found' after 0.10.0?
- How do I increase MCP Inspector's 10-second request timeout?
- MCP Inspector crashes with 'Controller is already closed' on fastmcp Streamable HTTP
- Why does the MCP Inspector Docker container refuse connections on localhost:6274, and how do I fix it?