Skip to content

[FEATURE]: Spawn MCP servers on demand (first tool use) instead of eagerly at session start #53028

Open

Description

@davtur19

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Every configured MCP server starts with the session, whether the session uses it or not. With several stdio servers configured that is several extra processes per session from the first message on, and it compounds the process growth in #51249, #46174 and #52965 (multi-GB RAM from unused or duplicate servers).

Proposal: spawn each MCP server lazily, on the first tool call that actually needs it, and keep it for the rest of the session. A session that never touches MCP tools starts none of them. A failed demand-start gets a small bounded retry so a transient startup error does not wedge the first call.

Config, rulesets and server behavior stay unchanged, only the start timing moves. This complements the release-side work in #52946 and the session-scoped direction of #52305.

Activity

  1. github-actions commented on Oct 3, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  2. davtur19 commented on Oct 3, 2026

    @davtur19
    Author

    Checked both. #30123 was auto-closed for inactivity while mixing eager startup with leak reports, and its own duplicate notice suggested splitting the eager startup behavior into a separate issue, which is what this request does. #52251 was auto-closed by the 2-hour template window. Neither was declined on merit, and eager startup is still the current behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions