Skip to content
BENIBIX Learn

--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.

AI⌨️ Claude Code

--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.

Example
Emma's CI job needs a ticket server that no developer has set up. The job passes it with --mcp-config, so it is there for that run only.
Why it matters
A run can bring the servers it needs without touching anyone's saved setup.
Full entry
AI⌨️ Claude Code

--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.

Example
Jack's eval runs must be the same on every laptop. He adds --strict-mcp-config, so no one's own servers sneak extra tools into the test.
Why it matters
Extra servers add tools that can change what Claude does. This keeps them out.
Full entry

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.