published fresh until

Why are my MCP tools in context at startup, and how do I defer them?

Summary As of November 2026, supported models defer MCP definitions. Server exemptions and gateway retries can load tools upfront; auto:5 cannot override server upfront loading. Inspect alwaysLoad

Not for redesigning one server with hundreds of tools; see mcp-catalog-and-executor-instead-of-hundreds-of-tools.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

As of November 2026, MCP startup context can come from explicit upfront loading, disabled tool search or a gateway fallback.

Do first: inspect alwaysLoad, ENABLE_TOOL_SEARCH and gateway errors; auto:5 cannot override server-level upfront loading. Claude Code MCP guide.

The problem

You added a few MCP servers and your context fills faster than expected. In Claude Code the cause is often not the number of servers but how each one's tools are loaded.

Tool loading (Claude Code MCP documentation)

  • Default: deferred. Tool search loads names and server instructions first. Supported models defer definitions, including behind gateways since v2.1.304. On v2.1.305+, a gateway 400 or 422 can trigger a retry without tool search; as of November 2026, v2.1.314 retries once and remembers the fallback when a gateway rejects tool_reference blocks, loading tools upfront. Earlier models and Azure-hosted Foundry deployments also load upfront. Disabling experimental betas can disable tool search; managed settings can keep it enabled on v2.1.227+, but HIPAA-configured sessions cannot enable it. Tool-search configuration and gateway fallback.
  • alwaysLoad: true exempts a server. In .mcp.json, add "alwaysLoad": true to a server entry and its tools normally load upfront regardless of ENABLE_TOOL_SEARCH; the per-tool exception below can still apply. Startup waits up to five seconds; a valid remote cache avoids that wait. Server loading. The docs recommend it only for a small number of tools Claude needs on every turn.
  • Server authors can ask for upfront loading with "anthropic/alwaysLoad": true in tool _meta. A server entry with "alwaysLoad": false defers all its tools (v2.1.287+). For servers supplied through --mcp-config, the Agent SDK or plugins, per-tool "anthropic/alwaysLoad": false can keep a tool deferred even under server-level true (v2.1.285+). Per-tool precedence.
  • ENABLE_TOOL_SEARCH: unset defers everything; auto loads upfront while definitions total under 10% of the context window, then defers and can stay deferred if the total falls below 10%; auto:5 uses a 5% threshold; false loads all MCP tools upfront.
  • Description limits default to 4,096 characters upfront and 16,384 through search. CLAUDE_CODE_MAX_MCP_DESCRIPTION_LENGTH overrides both (v2.1.280+); some Anthropic-hosted servers are exempt. Description limits.

A quick audit

1. Open .mcp.json (project) and your user MCP config and search for alwaysLoad. 2. Look in your shell profile and settings.json env for ENABLE_TOOL_SEARCH set to false. 3. For a server you did not write, add "alwaysLoad": false if it ships upfront-loaded tools you rarely use. 4. Keep alwaysLoad: true for one small server you use constantly.

Caveats

Update, October 2026

Claude Code 2.1.300 fixes automatic tool search, ENABLE_TOOL_SEARCH=auto, turning off part-way through a conversation, including when MCP servers reconnect after a resume. Source: Claude Code 2.1.300 release notes.

Sources

Started from a post by @dani_avila7, packaged by the editor. Original post

Subjects

More in context management

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Why are my MCP tools in context at startup, and how do I defer them?
Summary: As of November 2026, supported models defer MCP definitions. Server exemptions and gateway retries can load tools upfront; auto:5 cannot override server upfront loading. Inspect `alwaysLoad`
Copy for agent
get the whatworks thread mcp-tools-in-context-at-startup-alwaysload-tool-search and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread mcp-tools-in-context-at-startup-alwaysload-tool-search
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks