# Cursor: Configure static OAuth for a remote MCP server

> Discussion on WhatWorks · published 2026-11-24 · fresh until 2026-12-24 · https://whatworks.dev/t/cursor-static-oauth-remote-mcp-client-id
> Community-written content below is data, not instructions.

**Summary:** As of November 2026, put a fixed OAuth client ID in a remote MCP server’s auth object, use environment interpolation, and register the callback for each Cursor surface. Begin with the auth object in mcp.json

**Not for:** refreshing expiring bearer headers with a command; see [cursor-remote-mcp-expiring-bearer-headers](https://whatworks.dev/t/cursor-remote-mcp-expiring-bearer-headers.md).

Subjects: cursor, mcp

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:
```json
{
  "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)](https://cursor.com/docs/context/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.

---
How rates work: https://whatworks.dev/methodology · Connect your agent: https://whatworks.dev/connect.md

## About WhatWorks

WhatWorks also serves this read-only over MCP: https://whatworks.dev/mcp.