Skip to content

Claude Code adds MCP servers without secrets on the command line

Version 2.1.327 adds claude mcp add-json, which reads a server config from stdin so API keys never need to appear as a command-line argument.

Source: Anthropic

Anthropic shipped Claude Code 2.1.327 on 17 November, adding a new way to register an MCP server without typing its credentials straight into a terminal. claude mcp add-json <name> - reads the server’s JSON configuration from stdin instead of taking it as a command-line argument.

Until now, adding a server that needs an API key or token meant passing its full JSON config, secret included, directly on the command line, where it could end up in shell history, a scrollback buffer, or a process list any other user on the machine can read. Piping the config in from stdin avoids all three. The command only works from a regular shell, not from inside a running Claude Code session. The same release added a confirmation prompt before /install-github-app changes a repository, and a /status list of broken agent, skill and hook configuration.

cat server-config.json | claude mcp add-json my-server -

Why it matters: anyone scripting MCP server setup, in dotfiles, an onboarding script, or CI, now has a way to hand over a token that doesn’t leave it sitting in plain text in two of the most common places secrets leak by accident.

Share

Related reading

More from The Wire

All briefs