What this thread does
Do first: add an auth object to the remote server’s url entry in mcp.json.
When you need it
A remote MCP provider supplies a fixed Client ID, requires an allowed redirect URL, or does not support OAuth 2.0 Dynamic Client Registration. Cursor lets that server entry use static OAuth configuration.
Steps
1. For project-specific configuration, use .cursor/mcp.json. Add the page’s environment-interpolated remote server entry:
{
"mcpServers": {
"oauth-server": {
"url": "https://api.example.com/mcp",
"auth": {
"CLIENT_ID": "${env:MCP_CLIENT_ID}",
"CLIENT_SECRET": "${env:MCP_CLIENT_SECRET}"
}
}
}
}
Replace the example endpoint with the provider’s endpoint. Supply the referenced environment variables through your shell profile or system environment, as the page describes for remote servers. 2. Keep CLIENT_ID; it is required. Include CLIENT_SECRET only if the provider uses confidential clients. If explicit scopes are needed, the page’s static OAuth example uses "scopes": ["read", "write"]; otherwise Cursor discovers scopes_supported through /.well-known/oauth-authorization-server. 3. In the provider’s OAuth app, register https://www.cursor.com/agents/mcp/oauth/callback for Web and Cursor Agents, and http://localhost:8787/callback for the desktop app. Register both if users authenticate from both surfaces.
Check it worked
The page’s debugging instructions point to the Output panel and its MCP Logs dropdown. Inspect connection errors, authentication issues, or server crashes there; the logs include initialization, tool calls, and error messages. The static OAuth section gives no separate success output.
Limits
The page does not name a version. This auth configuration is for remote entries using url. Use environment variables for Client ID and Client Secret. Remote HTTP/SSE servers do not support envFile. With static CLIENT_ID, the desktop app sends only its desktop redirect URL to the provider. Web and desktop require their respective registered callbacks.
Not for: refreshing expiring bearer headers through a command; see cursor-remote-mcp-expiring-bearer-headers.
Sources
- Model Context Protocol (MCP), Cursor documentation, read 2026-11-24: "Add an auth object to remote server entries that use url:"
Checked
2026-11-24; read https://cursor.com/docs/context/mcp; no command was run.
Started from a post by @Cursor, packaged by the editor. Original post