# --strict-mcp-config Flag

> It loads only the MCP servers you pass with --mcp-config.

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** claude --strict-mcp-config

## Think of it like

It is like you say, we play with this one box. The rest stay on the shelf.

## Definition

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

## Example code

```bash
claude --strict-mcp-config --mcp-config ./mcp.json
```

Use these servers and no others.

## Why it matters

Extra servers add tools that can change what Claude does. This keeps them out.

## Common mistake

Using it with no --mcp-config. Then no MCP servers load at all.

## Three principles

- **Only yours.** From --mcp-config.
- **Skips the rest.** .mcp.json, plugins.
- **Same everywhere.** Good for tests.

## Related terms

- [--mcp-config Flag](https://learn.benibix.com/term/ai/mcp-config-flag)
- [MCP Server](https://learn.benibix.com/term/ai/mcp-server)
- [--setting-sources Flag](https://learn.benibix.com/term/ai/setting-sources-flag)

## Told apart from

- [--mcp-config vs --strict-mcp-config](https://learn.benibix.com/compare/mcp-config-flag-vs-strict-mcp-config-flag): 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.

## Taught in

- [The claude mcp Commands](https://learn.benibix.com/learn/ai-claude-code-commands/claude-mcp-commands): Claude Code Commands, 12/17

![--mcp-config adds servers to yours. With --strict-mcp-config, only the passed ones load.](https://learn.benibix.com/diagrams/flag-mcp-config.svg)

---

Source: https://learn.benibix.com/term/ai/strict-mcp-config-flag
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
