Repository navigation
feat(oauth): accept Cursor's exact MCP callback as a redirect URI - #53
Merged
Merged
Conversation
checkRedirect now accepts cursor://anysphere.cursor-mcp/oauth/callback, byte for byte, and no other custom scheme. DCR and CIMD both go through it; /authorize still needs an exact match against the client's registered redirect_uris, PKCE S256 stays required, and /token still binds the redirect URI. The consent page shows it as cursor://anysphere.cursor-mcp with the local-program warning, and the request view marks it local. The error page's back link is typed template.URL, built only from a checked redirect, so html/template no longer blanks the cursor: link.
frahlg-agents Bot
added a commit
to srcfl/ftw-plugin
that referenced
this pull request
Oct 26, 2026
srcfl/ftw-cloud#53 is deployed: the exact cursor://anysphere.cursor-mcp/oauth/callback is accepted, other custom schemes are still refused.
frahlg-agents Bot
added a commit
to srcfl/ftw-plugin
that referenced
this pull request
Oct 26, 2026
srcfl/ftw-cloud#53 is deployed: the exact cursor://anysphere.cursor-mcp/oauth/callback is accepted, other custom schemes are still refused. Co-authored-by: frahlg-agents[bot] <343333642+frahlg-agents[bot]@users.noreply.github.com>
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.
Lets Cursor (and Grok Bot through Cursor) finish an MCP sign-in against FTW Cloud.
Change
checkRedirectaccepts exactlycursor://anysphere.cursor-mcp/oauth/callback, byte for byte, and no other custom scheme. The https and http-loopback rules are unchanged./oauth/register) and CIMD both go throughcheckRedirect./authorizestill requires an exact match against the client's registeredredirect_uris, since the loopback port leniency only applies tohttp. PKCE S256 is still required for every client, and/tokenstill binds the redirect URI.cursor://anysphere.cursor-mcpwith the existing warning "That is a program on this computer. Approve only if you started it." The request view setsredirect.local=true.template.URL. It is built only from a redirect thatcheckRedirectaccepted, with parameters encoded viaurl.Values. Without this, html/template blanked thecursor:link to#ZgotmplZ.Tests (
internal/oauth/cursor_redirect_test.go)?,#, fragment, other paths, a port, userinfo, other hosts,cursor://evil,cursor:opaque, uppercase scheme/host/path, percent-encoding, whitespace, NUL,cursor-insiders:,vscode:,javascript:,data:,file:,http:./authorizerefuses variants and another client's use of it, with noLocation. It refuses plain or missing PKCE, and the error link back to Cursor works.code,stateandissto the exact callback./tokenrefuses another redirect_uri and a wrong verifier, and accepts the right one.go vet,go test -race ./...and-tags ftwclouddevpass locally.Security review (independent, two rounds)
cursor:could start its own flow. Declined: any DCR/CIMD client can already registerhttp://127.0.0.1orlocalhostwith any port, so a malicious local program has that capability today. Cursor uses DCR without a CIMD document, so binding the URI to a verified client_id would break it. The defence is the owner approving on the box with the agent key, plus the local-program warning, PKCE S256, and exact redirect binding.anysphere.cursor-mcplook like a web host. Fixed as described above.