Skip to content

Fix MCP OAuth authorize UX for browser/Inspector - #251

Closed
paulocastellano wants to merge 6 commits into
mainfrom
fix/mcp-oauth-authorize-ux
Closed

Fix MCP OAuth authorize UX for browser/Inspector#251
paulocastellano wants to merge 6 commits into
mainfrom
fix/mcp-oauth-authorize-ux

Conversation

@paulocastellano

Copy link
Copy Markdown
Contributor

Summary

  • Split from Activation checklist + MCP OAuth authorize UX (#239) #250 so the onboarding checklist PR stays reviewable.
  • Guests hit login before invalid_client for stale MCP Inspector clients.
  • Browser authorize failures render mcp/AuthorizeError (shared authorize layout) instead of raw OAuth JSON.
  • SetLocale attaches cookies on raw Symfony Passport responses without calling withCookie().

Test plan

  • php artisan test --compact tests/Feature/Mcp/OAuthRegistrationTest.php tests/Feature/Middleware/SetLocaleTest.php
  • Manual: clear ~/.mcp-inspector/storage/oauth.json, reconnect Inspector, authorize happy path + stale client error page

Made with Cursor

paulocastellano and others added 6 commits August 6, 2026 23:42
OAuth errors return a raw Symfony Response without withCookie(); attach
the default locale cookie via headers so authorize no longer 500s.

Co-authored-by: Cursor <cursoragent@cursor.com>
MCP Inspector often reuses a stale client_id; validateAuthorizationRequest
was returning invalid_client JSON before the login redirect. Guests now
hit /login first, then client validation runs after authentication.

Co-authored-by: Cursor <cursoragent@cursor.com>
After login, Inertia follows the intended authorize URL; raw invalid_client
JSON broke that visit. HTML/Inertia requests now get mcp/AuthorizeError
while API JSON clients still receive the OAuth error payload.

Co-authored-by: Cursor <cursoragent@cursor.com>
Use the framework helper so post-login authorize failures keep returning
an Inertia page instead of raw OAuth JSON.

Co-authored-by: Cursor <cursoragent@cursor.com>
Drop the X-Inertia header sniff; browser and Inertia visits already do
not expectsJson, while API clients still receive the OAuth JSON payload.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keep authorize and authorize-error on the same centered card shell instead of the auth split layout.

Co-authored-by: Cursor <cursoragent@cursor.com>
@paulocastellano

Copy link
Copy Markdown
Contributor Author

Folding back into #250 — keeping everything on the onboarding PR.

@paulocastellano
paulocastellano deleted the fix/mcp-oauth-authorize-ux branch August 7, 2026 02:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant