MCP server overwrites .mcp.json, stripping autoStart and other user-added fields
Bug
When ruvector (and ruflo) MCP servers start via npx ruvector@latest mcp start, the .mcp.json file gets modified — specifically, "autoStart": true fields are silently removed from the config.
Steps to Reproduce
- Create
.mcp.jsonwith both ruvector and ruflo configured:
{
"mcpServers": {
"ruvector": {
"command": "cmd",
"args": ["/c", "npx", "-y", "ruvector@latest", "mcp", "start"],
"autoStart": true
},
"ruflo": {
"command": "cmd",
"args": ["/c", "npx", "-y", "ruflo@latest", "mcp", "start"],
"env": {
"CLAUDE_FLOW_MODE": "v3",
"CLAUDE_FLOW_HOOKS_ENABLED": "true"
},
"autoStart": true
}
}
}
- Start Claude Code (or restart session)
- Check
.mcp.json—autoStartfields have been removed from both entries
Expected
.mcp.json should not be modified by the MCP server process. User-added fields like autoStart should be preserved.
Actual
The file is rewritten without autoStart, causing both servers to fall back to lazy/on-demand startup instead of auto-starting. This happens repeatedly across sessions — every restart strips the field again.
Impact
- Servers don't auto-start, so tools aren't available until first explicit call
- Any statusline or dashboard integration that depends on the servers being live at session start breaks silently
- Users have to manually re-add
autoStart: trueafter every session
Environment
- Windows 11, ruvector@latest + ruflo@latest via npx
- Claude Code
.mcp.jsonproject-level config - Observed across multiple sessions/restarts
Fixed in [email protected] (published to npm).
Root cause: hooks init was writing an empty mcpServers: {} key to .claude/settings.json. This could trigger Claude Code to regenerate .mcp.json from its internal state, stripping user-added fields like autoStart.
Changes:
hooks initno longer writes emptymcpServers: {}— it only usesenabledMcpjsonServersto reference servers already defined in.mcp.json- Existing empty
mcpServers: {}entries are now cleaned up automatically doctor --fixdetects and removes stale emptymcpServersentries
To update:
npx [email protected] hooks init --force
Or run npx ruvector doctor --fix to clean up the empty mcpServers key without re-initializing.
Thanks for the report @PogeystickJoe!