Lazy-load MCP servers on first tool invocation
- Dominant language
- Shell
- Stars
- 11.2k
- Forks
- 1.9k
- Avg merge
- 14h 16m
- Merged PRs (30d)
- 6
Description
### Describe the feature or problem you'd like to solve
Currently, all MCP servers configured in mcp-config.json are connected at CLI startup. As users add more MCP servers (ADO, GitHub, Work IQ, custom agents, etc.), this increases startup time even when most servers won't be used in a given session.
### Proposed solution
Add a lazy-loading option so MCP servers connect on-demand — only when a tool from that server is first invoked. This could be a per-server config flag like "lazy": true, or a global setting.
Benefits:
- Faster startup time, especially for users with many configured servers
- Reduced resource usage for servers that aren't needed in every session
- Better scalability as the MCP ecosystem grows
### Example prompts or workflows
_No response_
### Additional context
_No response_
Contributor guide
Research direction
Start by tracing how mcp-config.json is read and how all MCP servers are connected during CLI startup. Then follow the path from the first tool invocation to the selected server. Done means a per-server or global lazy-loading setting connects only the needed server on first use while preserving configured server behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- shell
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100