Repository navigation
Too many MCP servers results in continuous compaction #3024
Description
Activity
- addedarea:mcpMCP server configuration, discovery, connectivity, OAuth, policy, and registryMCP server configuration, discovery, connectivity, OAuth, policy, and registryarea:context-memoryContext window, memory, compaction, checkpoints, and instruction loadingContext window, memory, compaction, checkpoints, and instruction loading
on Apr 29, 2026 Real-world case: 20+ MCP servers configured in ~/.copilot/
Had a Technical PM hit this exact problem with ~20+ MCP servers configured globally. The symptoms were:
- Session startup took extremely long — spawning and handshaking with all MCP servers sequentially
- CLI crashes — likely from process/timeout exhaustion during initialization
- Severe hallucinations — using Claude Opus
4.6 (200K context), the tool definitions consumed so much of the context window that the model struggled to focus on the actual task
The root issue is that there's no guardrail or feedback — no warning at startup like "You have N tools loaded, consuming ~Xk tokens (Y% of context window)". Inexperienced users can install plugins/MCPs freely and silently degrade their experience without understanding why.
Suggestions:
- Warn at startup when tool definitions exceed a threshold (e.g., >50% of context window)
- Show tool token overhead in /env or /context
- Support MCP profiles (MCP Profiles #2235) so users can activate subsets per project instead of loading everything globally
Every server loads its full tool definitions into context up front, so the block grows without limit as you add servers.
Disclosure, I build an open-source gateway (Toolport) that fronts your servers with a couple of meta-tools and loads each tool's schema on demand. That 94k tool block drops to a few hundred tokens no matter how many servers you connect.
Rough math if useful, https://toolport.app/calculator
This appears to be resolved as of GitHub Copilot CLI v1.0.93. Please update to that release or a newer stable version. We're closing this as completed. If it still happens, please comment with your version and reproduction steps.
Describe the bug
The CLI agent can end up in a degenerate state when you enable too many MCP servers that expand past the available context window of the model in question supporting the harness.
The CLI should detect this state and warn the user. In my case, I ended up with 94k / 128k context window consumed by tools
Affected version
GitHub Copilot CLI 1.0.37.
Steps to reproduce the behavior
No response
Expected behavior
No response
Additional context
No response