Repository navigation
feat(mcp): one-click approval for a user already signed in to the site - #93
Merged
Merged
Conversation
The MCP login page asks /mcp/oauth/session (same-origin, so the site's SameSite=Strict cookie is sent) and, when signed in, offers "approve as <name>" posting to /mcp/oauth/approve. Approve requires a matching Origin and a valid site cookie; admins and impersonated sessions get the form. The page can't be framed and shows the host it returns to. Refs buzz-code/ops#47 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012GTicqnHNZPYxcmrvzQsZs
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.
Requested by הדסה · project thread
The MCP login page always asked for email and password, even when the browser was already signed in to the site.
How it works
Authentication, SameSite=Strict) isn't sent on the AI app's redirect to/authorize, but it is on same-site requests. So the page callsPOST /mcp/oauth/sessionfrom a script. When the user is signed in, it shows "אישור בתור ", which posts toPOST /mcp/oauth/approve.McpOAuthProvider.sessionUserverifies the cookie JWT withJWT_SECRETand loads the user. It refuses impersonated sessions and admins, the same rule as the password login.Security
Originto equal this server's base URL. The cookie is SameSite=Strict as well, so another site can't approve or read the name.frame-ancestors 'none'andX-Frame-Options: DENY.client_nameis self-registered, so the page also shows the host of the redirect URI the user returns to.Tests
jest shared/mcp src/mcp-toolspasses (55 tests), andtscis clean. Both were run from dnd-management-nra.Fixes buzz-code/ops#47
Generated by Claude Code