Skip to content

Feature: Lazy MCP server initialization (don't block startup) #26666

Closed as duplicate

Description

@alangmartini

Problem

Claude Code blocks the input prompt until all configured MCP servers have spawned and completed their tool discovery handshake. With even 1-2 MCP servers configured, this adds 3-10+ seconds to every session start.

This is frustrating because the user can't type anything during this time, even though MCP tools are rarely needed in the very first prompt.

Proposed solution

Initialize MCP servers lazily or in parallel with user input:

  1. Show the input prompt immediately
  2. Spawn MCP servers in the background while the user types
  3. If the first prompt doesn't need any MCP tools, there's zero perceived delay
  4. If it does, wait only at tool invocation time (with a brief "connecting to MCP server..." indicator)

This is similar to how ENABLE_TOOL_SEARCH already defers tool definitions from context — but applied to the actual process startup.

Current workarounds

  • Remove all MCP servers from config (defeats the purpose)
  • Use --strict-mcp-config with an empty file (inconvenient)
  • Set MCP_TIMEOUT to cap wait time (still blocks)

Expected behavior

MCP server readiness should never block the user from typing their first prompt. The startup sequence should be:

1. Load config          → instant
2. Show input prompt    → instant  
3. Spawn MCP servers    → background (parallel with user typing)
4. User submits prompt  → if MCP tools needed, wait for ready; otherwise proceed immediately

Activity

  1. github-actions commented on Feb 18, 2026

    @github-actions

    Found 3 possible duplicate issues:

    1. Feature Request: On-demand/lazy loading for MCP servers #18497
    2. Feature Request: Lazy/On-Demand MCP Server Loading #16254
    3. Feature request: Lazy/on-demand MCP server initialization #24627

    This issue will be automatically closed as a duplicate in 3 days.

    • If your issue is a duplicate, please close it and 👍 the existing issue instead
    • To prevent auto-closure, add a comment or 👎 this comment

    🤖 Generated with Claude Code

  2. github-actions commented on Feb 22, 2026

    @github-actions

    This issue has been automatically closed as a duplicate of #18497.

    If this is incorrect, please re-open this issue or create a new one.

    🤖 Generated with Claude Code

  3. github-actions commented on Mar 2, 2026

    @github-actions

    This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

  4. locked as resolved and limited conversation to collaborators on Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions