Uh oh!
There was an error while loading. Please reload this page.
fix(mcp): generate OAuth state on-the-fly during initial connection - #16248
fix(mcp): generate OAuth state on-the-fly during initial connection#16248jonahsnider wants to merge 1 commit into
Conversation
The following comment was made by an LLM, it may be inaccurate: Based on the search results, I found a potentially related PR: Related PR:
The search also returned several other OAuth-related PRs (#11477, #11925, #13085, #9034) but these appear to be feature additions rather than duplicate fixes for the same issue. |
Closing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR. |
jonahsnider
commented
May 5, 2026
I'm still waiting for a review. The bug this PR addresses is an actual issue and this fixes it. |
Issue for this PR
Closes#16247
Type of change
What does this PR do?
When connecting to a remote MCP server requiring OAuth, the SDK's auth flow calls
provider.state()to get the state parameter.This method was throwing when no state had been pre-generated, causing a non-
UnauthorizedErrorthat prevented the server from being recognized as needing auth.The error fell through to the SSE transport fallback, which also failed, resulting in a generic "Non-200 status code" status instead of
needs_auth.How did you verify your code works?
Following the reproduction steps in #16247, you'll see that the TUI properly marks the server as needing authentication, rather than having an SSE transport error:
Screenshots / recordings
N/A - not a UI change
Checklist