Sharing a token-protected MCP server across a Claude Code team

CCDV-F Claude Code Medium Question 35 of 105

A team wants every engineer's Claude Code session to reach the same internal HTTP MCP server. The server needs a bearer token, and the token must never be committed to the repository.

How should the server be configured?

Show answer and explanation

BProject scope in .mcp.json, with ${API_KEY} in the Authorization header

Project scope stores the server in .mcp.json, which ships through version control, and Claude Code expands ${VAR} in the headers field at load time so the bearer token stays in each engineer's environment. User scope is stored per machine in ~/.claude.json and reaches nobody else. Local scope is also stored in ~/.claude.json under the project's path, not in .mcp.json as that option claims. An env block sets variables for a stdio server that Claude Code launches, so it never becomes a bearer header on a remote HTTP endpoint.

Source: code.claude.com/docs/en/mcp

Anonymous, no account needed. Your tally stays in this browser.

Next question Start 5 timed questions Browse all 105 original CCDV-F practice questions