Skip to content

MCP OAuth callback fails (Cursor)

  • Redirect rejected

    Check the callback allowed by the identity provider.

  • Address unreachable

    Check the addresses reachable from your computer.

  • App does not open

    Check the callback’s desktop application handler.

Find the failed sign-in step before changing the callback configuration.

You can match the symptom to the relevant sign-in correction.

Next: MCP setup

If Cursor fails to complete OAuth when connecting to IdentityScribe’s MCP channel, the problem is usually one of three: redirect URI mismatch, localhost vs remote Scribe, or the callback never launching Cursor. Each one breaks a different step of the sign-in:

YOUR MACHINECursorMCP clientBrowsersign-in pageScribe /mcpOAuth metadataIdentity providerpublic issuerdiscovers IdPnames issueropens loginsigns inredirects back
YOUR MACHINECursorMCP clientBrowsersign-in pageScribe /mcpOAuth metadataIdentity providerpublic issuerdiscovers IdPnames issueropens loginsigns inredirects back
The client must reach the identity provider Scribe advertises and return to its registered callback.

Symptom: IdP returns “invalid redirect URI” or “redirect_uri_mismatch” after you sign in.

Cause: Your IdP must allow Cursor’s OAuth callback URI. Cursor uses a custom scheme for callbacks (e.g. cursor:// or similar). The exact URI depends on your Cursor version and configuration.

Steps:

  1. In your IdP’s OAuth client settings, add Cursor’s callback URI. Check Cursor’s docs or MCP auth UI for the exact value — it typically looks like cursor://anysphere.cursor-deeplink/oauth/callback or a variant.
  2. Ensure no trailing slash, exact case, and no extra query params unless your client requires them.
  3. For public clients (no secret), confirm the client is configured as “public” if Cursor uses PKCE.

Symptom: OAuth discovery or token requests fail; IdP shows wrong redirect or “connection refused.”

Cause: Cursor learns where to sign in from Scribe. Scribe’s metadata names the identity provider’s issuer, and the provider’s own discovery document lists its sign-in and token addresses. If one of these addresses only works inside the server’s network, such as localhost or an internal host name, Cursor on your machine cannot use it.

Steps:

  1. In your MCP config, use the URL you reach Scribe at: http://localhost:8080/mcp only when Scribe runs on your machine.
  2. If clients reach Scribe through a reverse proxy or load balancer, set auth.resource-metadata-origin to Scribe’s public origin (e.g. https://scribe.example.com) so sign-in challenges point to the right metadata address.
  3. If Scribe reaches the identity provider at an internal address, set auth.providers.<name>.public-issuer to the provider’s externally reachable issuer URL (e.g. https://auth.example.com/application/o/scribe/). It is the provider’s address, not Scribe’s, and replaces only the issuer that clients see.
  4. The sign-in and token addresses come from the provider unchanged. If they name an internal host, set the provider’s public URL in the provider itself.
  5. Ensure your IdP’s OAuth client has the correct redirect URI for the Cursor you use.

Symptom: Browser completes IdP sign-in, but Cursor doesn’t open or reconnect; no error in Cursor.

Cause: The cursor:// deeplink may not be handled, or the browser blocks custom-scheme redirects.

Steps:

  1. Confirm Cursor is installed and running before starting the OAuth flow.
  2. Try the flow in a different browser — some block or prompt for custom-scheme links.
  3. On macOS, ensure Cursor is set as the handler for cursor:// (System Settings → Apps → Default apps for URLs, or reinstall Cursor).
  4. If using a reverse proxy, ensure it does not rewrite or strip the redirect URL.

If OAuth keeps failing, you can bypass it temporarily using ROPC, LDAP bind, or a configured local account. Configure auth.methods to include the selected method, then use username:password in your MCP client. This is less secure than OAuth — use only for local or low-risk environments.