mcp

Cursor OAuth redirect URI registration for remote MCP

For remote MCP Connect in Cursor, the OAuth redirect URI must match your authorization server (AS) allowlist character-for-character—commonly a cursor://…/oauth/callback form (plus any port/path variants Cursor documents for your build). One trailing slash, scheme drift, or env/prod mismatch fails the bounce after browser login and looks like “auth almost worked.” Connect opening login, the browser succeeding, then the bounce failing is usually an allowlist mismatch: scheme, host, path, or trailing slash. Cursor and Claude need different documented callbacks—register each client separately. Prove the shared 401 + WWW-Authenticate + resource_metadata challenge before chasing redirect trivia. This page is redirect registration only—not the full OAuth recipe.

Symptom card

SymptomLikely redirect causeWhat to check first
Connect opens login → browser succeeds → bounce failsAS allowlist ≠ Cursor’s documented callbackExact string: scheme, host/path, trailing slash
“Needs authentication” loops after a successful loginCallback registered for another env (staging vs prod AS)Which AS the challenge / PRM pointed at
Cursor Connect fails; Claude works (or reverse)Different clients need different callbacksRegister each client’s documented URI separately
Static `CLIENT_ID` path still fails post-loginStatic clients skip DCR—they don’t skip redirectsSee mcp.json CLIENT_ID when DCR is missing

Full happy path (401 + `WWW-Authenticate` + `resource_metadata` → Auth Code + PKCE → tools): Build a remote MCP server with OAuth that Cursor and Claude can both Connect to. Prove the shared challenge before you chase redirect trivia.

Register the documented Cursor callback

  1. Copy the redirect URI from Cursor’s MCP OAuth docs for the build you ship—don’t invent a `https://` callback if Cursor expects `cursor://…/oauth/callback`.
  2. Paste that exact string into the AS client allowlist (admin UI or IaC)—no “helpful” normalization.
  3. If you use Dynamic Client Registration, confirm the registered client still carries that same redirect; if you use a static client, put the redirect on that static client record.
  4. Re-Connect from Cursor and watch the bounce land on the same string the AS logged.

Copy/paste discipline beats memory. A one-character mismatch is enough.

Common mismatches

  • Trailing slash — `/oauth/callback` vs `/oauth/callback/`
  • Scheme — `cursor://` vs `https://` (or a custom scheme Cursor doesn’t use)
  • Path / port variants — documented port or path differs across Cursor builds; follow *your* version’s docs
  • Env vs prod AS — redirect registered on staging; Connect hits prod (or reverse)
  • Claude’s callback reused for Cursor — each client gets its own documented URI; Cursor’s string does not satisfy Claude’s callback-port / path

Confirm with Inspector, then the AS log

Use MCP Inspector to confirm the remote challenge is clean first. Then, on a failing Connect attempt, check the AS authorize / redirect log for the exact `redirect_uri` the client sent—compare byte-for-byte to the allowlist entry. If they differ, fix the AS registration (or the client config), not the MCP tool handlers.

Static `CLIENT_ID` when DCR is missing: mcp.json CLIENT_ID when DCR is missing. You still register the Cursor callback exactly.

What the MCP Starter Kit is for

The MCP Starter Kit ($27) is aimed at shipping remote MCP with Cursor and Claude Connect in mind—including exact dual-client redirect registration when DCR isn’t available. Soft path: /free for the starter desk; Cheat Sheet for the pocket checklist mindset; kit when you want the auth-ready layout instead of stitching vendor posts.

Soft next step

Copy Cursor’s documented callback into the AS once, prove Connect, then register Claude’s callback separately. Soft ladder: /free for the starter desk, Cheat Sheet for the skim checklist, or the MCP Starter Kit ($27) for the dual-client recipe. Full sequence: OAuth pillar; static client: mcp.json CLIENT_ID; debug loop: MCP Inspector.

FAQ

What is Cursor’s OAuth redirect URI for remote MCP?+

The callback Cursor documents for MCP OAuth — commonly a cursor://…/oauth/callback form (plus any documented port/path variants). Copy the documented string; don’t invent one.

Why does a one-character mismatch fail Connect?+

Authorization servers match redirects character-for-character. Trailing slash, scheme, path, or env vs prod AS drift typically looks like “login almost worked” then Needs authentication / bounce loops.

Do I register the same URI for Claude and Cursor?+

No. Register each client’s documented callback separately. Cursor’s URI does not satisfy Claude’s callback-port / documented path.

Where do I put the redirect when using static CLIENT_ID / no DCR?+

Still on the authorization server’s allowlist for that client. Static CLIENT_ID skips Dynamic Client Registration; it does not skip exact redirect matching.

How do I confirm the AS saw the exact callback string?+

Compare the AS allowlist entry to Cursor’s documented callback side-by-side, then watch the redirect with MCP Inspector during a Connect attempt. Fix copy/paste drift before debugging tokens.

Soft next step?+

Paste the documented Cursor callback once.

Get the free starter

Value first, then a kit when you are ready. No fake urgency. Start with Harness Desk Starter at /free.