Update MCP SDK and Inspector, then retest OAuth flows
You will upgrade the MCP Python SDK and MCP Inspector, then rerun the fresh login and expired-token paths. This helps you confirm connections stop looping and stored tokens behave as expected.
- Verify versionsConfirm Inspector 0.17.0+ and pinned Python SDK
- Clear OAuth stateRemove stored tokens before retesting
- Fresh login testComplete the guided flow to a token
- Expired token testCheck proactive refresh vs first-request 401
- Scope checkMatch requested scopes to the AS config
Why it matters
The Inspector kept requesting new authorization codes after a successful JWT exchange, and the fix landed in Inspector 0.17.0 (issue #633 (opens external site)). The Python SDK still has an open bug where an expired stored token is treated as valid forever, so the first request gets a 401 and the client falls back to full re-authentication (issue #1318 (opens external site)). Upgrading fixes the Inspector loop, but the SDK expiry case needs its own retest.
Steps
-
Check which Inspector version is actually running. Older releases still show the loop, and the
@latesttag pointed to a looping build at one point. Install 0.17.0 or newer and confirm the version after install. -
Clear the stored OAuth state in the Inspector's OAuth settings before retesting. Run the OAuth guided flow step by step until it completes with a token, and only after that click Connect.
-
Upgrade the Python SDK in your project environment, then pin the exact version you tested with in your lockfile or requirements file. Confirm the installed version matches the pin.
-
Retest a fresh login. Connect a client with no stored tokens, complete the flow, and confirm the server accepts the token on the first request.
-
Retest an expired-token case. Store a token whose expiry has passed and check whether the client refreshes it proactively or hits a 401 first. If it returns a 401 on the first request, you are hitting the expiry bug in issue #1318 (opens external site), so plan a workaround or wait for the fix.
-
If you run a proxy or external authorization server, retest refresh against the real token endpoint. Watch for refresh requests going to
server_url + /tokeninstead of the provider's token URL, which is the second bug in the same issue. -
Check the scopes your server requests against the authorization server configuration. A 401 for invalid requested scopes will not self-recover, and the Inspector restarts the full flow instead of refreshing.
Common mistakes
- Testing only with a fresh login and assuming refresh works. Expired-token behavior is a separate path.
- Assuming the Inspector fix covers the Python SDK. The SDK bugs are tracked separately and were still open in the linked thread.
- Logging bearer tokens while debugging. Redact them in logs and traces.
- Skipping the version check after upgrading. Confirm what is actually running.
Checklist
0 of 8 done