Repository navigation
fix(mcp): fail loudly when a server has no DCR endpoint - #1791
Merged
Merged
Conversation
vastsa#1782: when discovery returns no registration endpoint, the login flow fell back to a literal client id: } else { clientId = "pi-desktop"; } No authorization server has ever registered that id, so the app opened `<authorize>?client_id=pi-desktop` and the user landed on a bare 404 — with no explanation and no way forward. It is not a GitHub-specific failure: any OAuth MCP server without Dynamic Client Registration is affected. Throw before opening anything, naming what is missing and the two real ways out. A settings field for a client id does not exist yet, so the message does not promise one. The test drives the real startLogin through a mocked discovery that omits registration_endpoint, and asserts both the message and that openExternal was never called. Verified against the old code: the test does not merely fail, it hangs until the 300s timeout, because the previous flow waited for a callback that could never arrive — the same experience the report describes. Verification: mcp-oauth.test.mjs 20/20, mcp-oauth-discovery.test.mjs pass, tsc --noEmit clean.
muzimu217
force-pushed
the
fix/mcp-oauth-no-dcr
branch
from
October 20, 2026 17:04
22e8c83 to
99bd282
Compare
Bring the contributor branch onto the current integration base before validating and merging the OAuth fix.
Integrate the reviewed OAuth fallback fix with the latest main before final validation.
Fail before opening OAuth with an unregistered client, and send a stable error code so settings can show translated recovery guidance.
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.
What this fixes
Fixes #1782.
When discovery returns no
registration_endpoint, the login flow fell back to a literal client id:No authorization server has ever registered that id, so the app opened
<authorize>?client_id=pi-desktopand the user landed on a bare 404 — no explanation, no way forward. This is not GitHub-specific: every OAuth MCP server without Dynamic Client Registration is affected.Change
Throw before opening anything, naming what is missing and the two real ways forward (ask the server operator for a client id, or use a server that supports DCR). The message deliberately does not promise a settings field that does not exist yet.
Verification
mcp-oauth.test.mjs+mcp-oauth-discovery.test.mjs— 42/42 pass (tsc --noEmitclean).startLoginagainst a mocked discovery that omitsregistration_endpoint, and asserts both the error message and thatopenExternalwas never called (openeddeep-equals[]).main(710f493cc), 0 behind, 2 files +51/−2.