[BUG] MCP server config changes in .mcp.json not picked up after restart — old config cached indefinitely (Windows)
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Platform: Windows 11, Claude Code desktop app + VS Code extension
Bug: When the bitbucket MCP server config in ~/.claude/.mcp.json is
changed (e.g. from npx to node), Claude Code continues using the old
server config after restart. The new command is never spawned — confirmed
by a sentinel file that the new process would write on startup, which is
never created.
Steps to reproduce:
- Add an MCP server to
~/.claude/.mcp.jsonwithcommand: "npx" - Restart Claude Code — server starts, tools load
- Change the same server's
commandtonodewith a different script - Restart Claude Code
- The new script is never executed — old server behaviour persists
Expected: New config is used after restart
Actual: Old config/cached error is returned indefinitely
Workaround: None found. The env block in .mcp.json is also not
passed to the subprocess on Windows, causing authentication failures even
when the correct token is configured.
Additional context: Querying the API directly from a Bash tool
subprocess works fine — the token is valid and the server works when
invoked manually. The issue is specific to how Claude Code spawns and
caches MCP server processes.
What Should Happen?
When ~/.claude/.mcp.json is modified and Claude Code is restarted, the updated MCP server configuration should be used. The new server command should be spawned and any previously cached server state or error should be cleared.
Error Messages/Logs
Steps to Reproduce
Add a Bitbucket MCP server to ~/.claude/.mcp.json with command: "npx" and credentials in the env block
Restart Claude Code
Call a Bitbucket MCP tool — it fails with "Authentication failed" because the env block credentials are not passed to the subprocess on Windows
Change the server command to node pointing to a local script that hardcodes the credentials
Restart Claude Code
The new script is never executed — the old server config and its cached error are returned indefinitely
Confirmed by writing a sentinel file at process startup that is never created when Claude Code spawns the server, but IS created when the script is run manually
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
Version 1.2278.0 (e5213f)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗