What
MCP servers are outside programs that give Claude Code extra tools. In a non-interactive session, such as one started with -p that runs a single request and exits, Claude Code now begins connecting your MCP servers immediately after startup, before the first turn needs them. This happens when all of these hold:
- The session is non-interactive.
- The session is not a remote one (
CLAUDE_CODE_REMOTEis not set). - Claude Code is not in a restricted or bare mode.
- At least one configured MCP server is not one supplied through the SDK.
If this early round fails, Claude Code connects the servers at the usual point instead.
Why
Scripted runs that rely on MCP servers should reach their first answer sooner, because the connections are already under way.