Claude Code mcp add-json Reads From stdin and Project-Scope MCP Commands Stop Clobbering .mcp.json

Claude CodeView original changelog

Claude Code 2.1.327 lets claude mcp add-json <name> - read a server's JSON from stdin, so tokens can stay off the command line. It also fixes claude mcp add and claude mcp remove at project scope deleting other top-level keys from .mcp.json, and claude mcp add --scope project now stops rather than overwriting a file that lists servers at the top level.

Key Takeaways

  • claude mcp add-json <name> - reads from stdin, keeping secrets out of shell history.
  • The stdin form is unavailable inside a Claude Code session.
  • Project-scope add and remove no longer delete other top-level keys such as $schema.
  • --scope project stops instead of overwriting a .mcp.json with top-level servers and no mcpServers key.
  • Files shared with other MCP-aware tools are safer to touch from the CLI.
  • It is a small change with real security and data-safety benefits.

Keeping tokens off the command line

claude mcp add-json <name> - now reads the server's JSON from standard input. A bearer token or API key in the config no longer has to appear in the command line, where it would land in shell history and process listings. The option is not available inside a Claude Code session.

.mcp.json is no longer rewritten destructively

Project-scope claude mcp add and claude mcp remove previously deleted other top-level keys from .mcp.json, such as $schema or another tool's servers entry. That is fixed. In addition, claude mcp add --scope project now stops instead of overwriting when .mcp.json lists its servers at the top level with no mcpServers key, which protects files shared with other tools.