Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
When an MCP server has OAuth discovery endpoints (RFC 9728), Cursor ignores the headers configuration and always attempts OAuth authentication. This occurs in both plugin mcp.json and global mcp.json configurations.
Steps to Reproduce
- Configure an MCP server with headers (in either plugin or global
mcp.json):
{
"mcpServers": {
"my-server": {
"url": "https://example.com/mcp/",
"headers": {
"Authorization": "Bearer ${env:MY_API_KEY}",
"Content-Type": "application/json"
}
}
}
}
-
The server at example.com has OAuth discovery at
/.well-known/oauth-authorization-server -
Toggle the MCP server on in Cursor
-
Observe: Cursor requests
/.well-known/oauth-authorization-serverand attempts OAuth - it never sends the configuredAuthorizationheader
Expected Behavior
When headers is configured in mcp.json (plugin or global), Cursor should use those headers for MCP requests instead of attempting OAuth discovery.
Actual (buggy) behavior:
Cursor:
- Checks OAuth discovery endpoints first
- If OAuth discovery returns 200/302, uses OAuth flow
- Never uses the configured headers
- The
Authorization headeris never sent to/mcp/
Operating System
Linux
Version Information
Version: 2.6.21
VSCode Version: 1.105.1
Commit: fea2f546c979a0a4ad1deab23552a43568807590
Date: 2026-03-21T22:09:10.098Z
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
Evidence from Server Logs:
Only OAuth discovery requests received - no POST requests with Authorization header:
GET /.well-known/oauth-authorization-server → 302
GET /.well-known/oauth-protected-resource/mcp → 200
No POST /mcp/ requests with Authorization: Bearer … header appear in logs.
Impact:
This breaks API key authentication for servers that also support OAuth. Users cannot use headers config when their server has OAuth endpoints. For the moment, we’re going to try a workaround on the MCP server side and create an alternative endpoint, /api/mcp that’ll return a 404 for OAuth discovery, which will hopefully force Cursor to use the configured headers .
Related bug:
This compounds with the Remote SSH OAuth token sync issue that we filed earlier (see MCP OAuth Token Not Used After Successful Authentication ) – Remote SSH users cannot use OAuth (tokens don’t sync to remote host), and now cannot use headers either.
Does this stop you from using Cursor
No - Cursor works, but with this issue