Skip to content

Build1 publisher3 min readPublished

Claude Desktop needs OAuth or an mcp-remote bridge to use API-key MCP servers

Claude Desktop's custom connectors offer only OAuth sign-in for remote MCP servers, while five other clients take a static API key in a header. Servers that authenticate with plain keys need an OAuth front or a local mcp-remote bridge for Desktop users.

The Engineer · Build desk

Illustration accompanying Claude Desktop needs OAuth or an mcp-remote bridge to use API-key MCP servers

What happened

  • Anthropic's support docs let Desktop users supply their own OAuth client ID and secret under Advanced settings when adding a connector.
  • A documented bug leaves spaces in args unescaped when Cursor, Codex-Cli and Claude Desktop on Windows invoke npx, so the bridge header is written with no space after the colon.
  • Cursor and VS Code take url and headers natively, pulling the key from an environment variable or a password prompt at server start.

Compiled by The EngineerSomething wrong?How this is made

Why it matters

  • decision Teams shipping a key-authenticated MCP server to Desktop users have to choose between building an OAuth front and asking every user to run a local bridge.
  • cost Each Desktop seat on the bridge path carries its own npx-launched process and config block, plus a Windows quoting rule that fails silently when missed.
  • exposure Moving a key-auth server onto Desktop through the bridge puts the bearer key back into a plaintext config file, the thing Cursor and VS Code setups are built to avoid.

With the bridge in place, Claude Desktop only talks to a local process. The Desktop config entry is a stdio server with the command `npx`. Its arguments are `mcp-remote`, the remote URL and a header [12]. mcp-remote runs locally and sends static headers to the remote endpoint [11]. That account comes from a survey of six MCP clients by a developer who works on PinkWallet's agent payments product [1]. The author re-fetched every quoted doc on 2026-09-30 [4].

The header argument is written `"Authorization:${AUTH_HEADER}"`. There is no space after the colon, and the bearer value sits in the `env` block [12]. That layout works around a bug the post describes: when Cursor, Codex-Cli and Claude Desktop on Windows invoke npx, spaces inside args are not escaped, and the values get mangled [13]. If you write the header the obvious way, with a space, it silently breaks on those platforms, the author wrote [14].

The limit is in Desktop's connector UI. Anthropic's support docs describe a sign-in: "you'll typically go through an OAuth authentication process to securely sign in" [7]. The advanced path is still OAuth: "Optionally, click 'Advanced settings' to specify an OAuth Client ID and OAuth Client Secret for your server." [8] Anthropic does not document a field for a static bearer token or API key [2]. `claude_desktop_config.json` looks as if it should accept `url` and `headers` the way Cursor's and VS Code's configs do. According to the author, it does not for servers added through the connectors UI [9].

In every other client, the key goes in a header. Claude Code takes it in one command: `claude mcp add --transport http secure-api https://api.example.com/mcp --header "Authorization: Bearer your-token"`. The `--header` flag, or `-H`, can be repeated [5]. The author calls Claude Code the lowest-friction of the six [6]. The post says the OpenAI Agents SDK and LangChain also take a headers object or flag directly [3]. That makes five of the six clients that accept the key without a bridge [1].

The bigger difference between clients is where the secret is stored. Cursor interpolates `${env:MY_SERVICE_TOKEN}`, so the raw key never has to be written into `mcp.json` [15]. The failure the author sees is people skipping the interpolation and committing the literal key. The docs example works either way, so nothing stops them [16]. VS Code resolves `${input:api-key}` from a `promptString` input marked `"password": true`, and asks for the value when the server first starts [17]. The mcp-remote example writes `"Bearer YOUR_KEY"` as a literal string in the Desktop config's `env` block [12].

The author offers two options: put OAuth in front of the server, or bridge it [10]. I think the right one depends on who uses the server. For an internal server with a few Desktop users, the bridge costs a config block per machine, an npx-launched process and the Windows quoting rule. For a server offered to customers, I would put OAuth in front. The author calls that more work, but it is the path Desktop supports natively [10]. The author also says most static-key servers recommend mcp-remote for Desktop today [11].

What to watch

  • Anthropic adding a static-token or headers field to Desktop custom connectors would make the mcp-remote bridge unnecessary.
  • A fix for the npx argument-escaping bug in Cursor, Codex-Cli and Claude Desktop on Windows would retire the no-space header workaround.
  • Checking the post's OpenAI Agents SDK and LangChain configs against those projects' docs would confirm or revise the five-client count.
Loading claim ledger
Loading source directory links
Loading share composer
Loading topic controls
Loading related stories