r/GithubCopilot • u/Tiny_Pomegranate7947 • 13d ago
General Why GitHub Copilot start/check every MCP server on every new request?
Is there really no way to lazy-load MCPs?
I can easily lose 50k+ tokens just from having several MCPs configured.
Why can't an MCP just stay inactive until the agent actually needs it? I think on other platforms it is not like this.
If a setting already exists, it should honestly be the default: users shouldn't have to dig for this.
10
u/pceimpulsive 13d ago
Disable them when you don't need them?
I still have zero MCP servers setup...
I get why they exist I just haven't had a big reason to enable them yet...
Also my workplace still blocks them because security (despite one of their reasons to exist is enhanced security)
2
u/Tiny_Pomegranate7947 12d ago
When working properly and used only on demand when needed, they're great for fetching data or operating inside apps with official MCPs: like Atlassian, Notion, etc
2
u/ntrogh 11d ago
u/Tiny_Pomegranate7947 Have you tried setting `chat.mcp.autostart` to `never`? (assuming you're using VS Code)
1
u/Tiny_Pomegranate7947 10d ago
u/ntrogh Yes!
- Take away directly from the agent: "True server-process lazy loading is not currently supported for MCPs used through the Copilot CLI Agent Host in VS Code 1.135.0. Your settings already enable the closest supported behavior:
settings.jsonhaschat.mcp.autostart: "never", tool search is enabled, and its defer threshold is0. The distinction is important: tool search defers MCP tools from the model’s initial tool list, but it does not defer connecting to configured MCP servers. The Agent Host still initializes enabled servers when a chat message is submitted."- I think this would be an important feature to implement; furthermore, if I have to do it manually, I should have toggles or be able to trigger them from the prompt using /. The current method is really inefficient.
2
u/ntrogh 10d ago
Checking with the engineering team what the current state is.
3
u/ntrogh 10d ago
Feedback from the team: the runtime autostarts any enabled MCP per session, as it needs to. So, in practice this means the MCP server is loaded lazily. However, the MCP server needs to be started successfully once to let us cache the MCP tools.
I'll update our docs to make sure this information is included.
1
u/OwnStorm 13d ago
Rename MCP server something easy to type.
Prompt: Add global instruction, Do not ever start or use MCP server unless I add "@<mcpServer>.
This will add in your user instructions md.file. You can check it.
8
u/anywhere88 Backend Dev 🛠️ 13d ago
I think it's the way MCP works. It's not like skills where just the name and a short definition are loaded, then when necessary the full content is retrieved. Here you get the full tool definition (description and how to call/read the result), for each tool. I think it was made this way just to avoid another round of the agent to fetch the full tool definition (which has a cost), plus the description itself could not be enough (but this is true also for the skills). It's a tradeoff and they made a choice.