Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
Using our plugin, after successfully completing OAuth authentication, Cursor saves the access token but does not use it for subsequent MCP requests. Instead, it immediately starts a new OAuth flow.
Steps to Reproduce
- Configure MCP server with OAuth authentication (remote SSH, remote
~.cursor/mcp.jsonused.
{
"mcpServers": {
"my-server": {
"url": "https://example.com/mcp/",
"auth": {
"type": "oauth", (note: tried specifying this and removing this parameter)
"CLIENT_ID": "...",
"scopes": ["read", "write"]
}
}
}
}
We also tried specifying an audience (e.g. https://example.com/mcp ) to no avail.
(note: We have a public, native app that doesn’t require a CLIENT_SECRET to be specified, however we do define a client secret in Auth0, and this unrelated token exchange succeeds later in the process).
- Enable the MCP server in Cursor
- Click “Connect” to start OAuth flow
- Complete authentication (Auth0 passwordless in our case)
- Observe: OAuth completes, tokens saved, but server immediately shows “Needs authentication” again
Expected Behavior
After OAuth completes, Cursor should send POST requests to the MCP endpoint with Authorization: Bearer header.
Actual behavior:
After OAuth completes:
- Cursor logs:
Saving tokensandOAuth authorization completed - Cursor reloads the client
- Cursor immediately starts a NEW OAuth flow (logs show
Saving PKCE code verifier) - Server receives NO POST requests with Bearer token (confirmed via server logs)
- MCP status returns to “needsAuth”
Operating System
Linux
Version Information
Version: 2.6.20
VSCode Version: 1.105.1
Commit: b29eb4ee5f9f6d1cb2afbc09070198d3ea6ad760
Date: 2026-03-17T01:50:02.404Z
Build Type: Stable
Release Track: Default
Electron: 39.8.1
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Linux x64 6.8.0-106-generic
For AI issues: which model did you use?
N/A
For AI issues: add Request ID with privacy disabled
N/A
Additional Information
MCP Client Logs (Truncated):
23:42:48.650 [info] Saving tokens
23:42:48.783 [info] OAuth authorization completed
23:42:48.959 [info] Handling ReloadClient action
23:42:49.137 [info] Connecting to streamableHttp server
23:42:49.901 [info] Saving PKCE code verifier <-- NEW OAuth flow starting!
23:42:50.108 [info] Redirect to authorization requested
23:42:50.243 [warning] UnauthorizedError: Unauthorized
Server Logs:
Only OAuth discovery requests received - NO POST /mcp/ with Bearer token:
GET /.well-known/oauth-protected-resource/mcp 200
No mcp_auth_attempting_oauth or mcp_auth_no_credentials_provided logs, confirming no POST requests made.
Additional Context
- All required callback URIs set in Auth0
- Auth0 API is suitably permissioned for Auth0 application access (user access: all permissions)
- Server correctly returns
WWW-Authenticateheader on 401 - OAuth discovery endpoints work correctly
- Auth0 token exchange completes successfully
- curl POST requests to /mcp/ with Bearer token work fine
- API key authentication works as expected
Guidance at Model Context Protocol (MCP) | Cursor Docs was followed. For now, we plan to return to specifying our MCP API key as an environment variable in order to submit our plugin (inconvenient but workable)
Does this stop you from using Cursor
No - Cursor works, but with this issue