--mcp-config vs --strict-mcp-config
People think --mcp-config swaps your MCP servers for the ones in its file, and it does not. It adds those servers on top of the ones you already have. --strict-mcp-config is the flag that makes them the only ones. In CI, use the two together, so every machine gets the same servers.
--mcp-config Flag
It loads MCP servers for one session from JSON.
--mcp-config loads MCP servers for this session from JSON files or JSON strings. Pass more than one with spaces between them. These servers join the ones you already set up. With -p, Claude Code waits up to 30 seconds by default for them to connect before the first turn.
--strict-mcp-config Flag
It loads only the MCP servers you pass with --mcp-config.
--strict-mcp-config skips the MCP servers set up in places such as .mcp.json, ~/.claude.json or a plugin. Only the servers you pass with --mcp-config load. Then a run gets the same servers on each machine. What each person set up does not count.
In one line
- --mcp-config Flag
- It loads MCP servers for one session from JSON.
- --strict-mcp-config Flag
- It loads only the MCP servers you pass with --mcp-config.