Claude Code 2.1.327: keep MCP tokens off argv
Most of the Claude Code changelog is noise to me, but v2.1.327 (published 17 November) has three small items that touch something I do every week: wiring MCP servers into a project. One of them fixes a bug that would have quietly eaten my config file.
The .mcp.json clobbering bug
The release notes say it plainly: claude mcp add and claude mcp remove with project scope used to delete "other top-level keys from .mcp.json, such as $schema or another tool's servers". If you keep a $schema line for editor validation, or share the file with another tool that reads its own top-level key, a routine claude mcp add --scope project could drop it without a word.
That is nasty precisely because .mcp.json is committed. The damage shows up as a mysterious diff in a PR, not as an error. The same release adds a related guard: claude mcp add --scope project now stops, instead of overwriting, when the file lists its servers at the top level with no mcpServers key. So a hand-written file in an unexpected shape gets a refusal rather than a rewrite.
My takeaway: if you ran either command with project scope on an earlier version, look at git diff on that file and see whether anything went missing.
Tokens from stdin instead of argv
The new feature I actually like is claude mcp add-json <name> -, which reads the server's JSON from stdin. The stated reason is that tokens can stay off the command line. A command-line argument ends up in shell history and is visible in the process list, so pasting a bearer token into add-json as an argument was never great. Now you can pipe it:
op read "op://Dev/my-mcp/config.json" | claude mcp add-json my-server -
That example uses 1Password's CLI purely as an illustration; any command that prints the JSON works. One caveat from the notes: this form is not available inside a Claude Code session, so it is a shell-only thing.
Other things worth a glance
- Remote MCP servers that dropped during a longer outage, such as a VPN disconnect, are now retried in the background for about a day for most servers on other machines reached by hostname over https. Before, they stayed disconnected until restart.
/statusnow lists broken agent, skill, command and output style files, keybinding errors, ignored permission settings and hook matchers that never match. I will use that as a config lint.- WebFetch now refuses a URL over 2,000 characters before any permission prompt.
- Some path checks now refuse certain symbolic links, and what counts as inside a working directory changed, so a few paths that passed silently will now ask. Expect a prompt or two you did not see last week.
What I am doing about it
I updated, diffed my committed .mcp.json files, and moved the one server that had a token in its add command over to the stdin form. The release is huge, so I only read what the notes say and have not exercised every change. Still, a config file that silently loses keys is the sort of bug you want fixed before you find it the hard way.