published fresh until

Cursor: Configure static OAuth for a remote MCP server

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.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

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

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

Subjects

More in cursor

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Cursor: Configure static OAuth for a remote MCP server
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
Copy for agent
get the whatworks thread cursor-static-oauth-remote-mcp-client-id and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread cursor-static-oauth-remote-mcp-client-id
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp