feat: Support OOB redirect URI in OAuth /authorize for headless clients (#383)#385
Merged
Merged
Conversation
…ts (#383) When redirect_uri=urn:ietf:wg:oauth:2.0:oob, /authorize renders an HTML page showing the auth code instead of 302-redirecting to a localhost callback. Unblocks remote/SSH boxes where the browser on the user's local machine can't reach a localhost port bound on the remote host. Existing localhost-callback flow is unchanged.
This was referenced May 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
urn:ietf:wg:oauth:2.0:oobin the MCP server's/authorizeendpointhttp://localhost:<port>/callbackflow is unchangedWhy
Per #383, the current OAuth flow fails on headless / remote-SSH boxes: the CLI binds its callback listener to localhost on the remote host, but the user's browser is on a different machine, so the redirect to
http://localhost:<port>/callbacklands on the wrong host and dies (Safari Can't Connect to the Server).OOB unblocks any MCP client that supports the standard OOB redirect URI, and gives users a manual
curl /register+ open/authorize+curl /tokenpath they can drive by hand from a headless box.Test plan
npm run test-mcp— all 53 existing MCP tests pass/register→/authorize?redirect_uri=urn:ietf:wg:oauth:2.0:oobreturns 200 + HTML with code →/token(with PKCE verifier) returns validaccess_tokenescapeHtmlis applied defensively)