Feature Request: Lazy/On-Demand MCP Server Loading

Resolved 💬 7 comments Opened Jan 4, 2026 by josemrquintas Closed Mar 19, 2026

Problem

All configured MCP servers load at session start, consuming significant context tokens.
In my case: 133k tokens (67% of 200k context) before any conversation begins.

Current Behavior

  • All MCP servers in ~/.claude.json and .mcp.json files load immediately
  • Tools are registered even if never used in the session
  • No way to defer loading until tools are actually needed

Proposed Solution

Add a lazy option for MCP servers that defers loading until explicitly needed:

{
  "mcpServers": {
    "salesforce-dev": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@salesforce/mcp"],
      "lazy": true
    }
  }
}

Trigger options:

  • @-mention the server name (e.g., @salesforce)
  • Claude determines it needs a tool from that server
  • User runs /mcp enable <server>

Alternatives Considered

  1. Project-level .mcp.json files - current workaround, requires manual management per project
  2. Disabling servers via /mcp - still loads tools into context first before disabling
  3. Multiple Claude Code profiles - not currently supported

Impact

  • Large context savings for users with multiple MCP servers configured
  • Better UX for users who context-switch between different project types
  • Reduced startup time - no need to spawn all MCP server processes upfront

Use Case

A developer working on multiple projects (Salesforce, Next.js, hosting management, databases) doesn't need all 150+ tools loaded when working on a simple script or asking a quick question.

Environment

  • Claude Code version: 2.0.74
  • Platform: Linux
  • MCP servers: 4 configured globally (~133k tokens in tools)

View original on GitHub ↗

This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗