# --mcp-config Flag

> It loads MCP servers for one session from JSON.

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

## Think of it like

It is like you bring more toys to a friend's house. They are just for today.

## Definition

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

## Example code

```bash
claude -p --mcp-config ./ci-mcp.json "Check the open tickets"
```

Load the CI's MCP servers for this run.

## Why it matters

A run can bring the servers it needs without touching anyone's saved setup.

## Common mistake

Thinking only these servers load. Your other servers load too, unless you add --strict-mcp-config.

## Three principles

- **Files or strings.** JSON.
- **Adds to yours.** Not instead.
- **Waits to connect.** With -p.

## Related terms

- [--strict-mcp-config Flag](https://learn.benibix.com/term/ai/strict-mcp-config-flag)
- [claude mcp add Command](https://learn.benibix.com/term/ai/claude-mcp-add-command)
- [MCP Server](https://learn.benibix.com/term/ai/mcp-server)

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