github / github/copilot-cli

Lazy-load MCP servers on first tool invocation

未关闭
#2,901 2 条评论 18 个 reaction 已指派 0 人 在 GitHub 查看
area:mcp
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

### 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_

贡献指南

打开贡献指南

调研方向

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.

由索引模型根据 Issue 内容生成。

评估

技术栈
shell
领域
cli, tooling
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
冷清
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。