Feature Request: Per-agent MCP server scoping to reduce context overhead
@connor4312 is already working on this.
Since Jul 2, 2026.
Assessment
This issue has not been assessed yet.
Description
MCP servers defined in mcp.json files are loaded globally for all agents in the workspace. Each server's tool schemas consume context tokens regardless of which agent is running.
The tools: field in .agent.md can restrict which tools an agent may invoke, but it does not prevent the MCP server from starting or its schemas from being loaded into the prompt. The overhead is paid even for agents that never use those servers.
Request: Add an optional agents field to MCP server configs in mcp.json:
{
"servers": {
"playwright": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@playwright/mcp"],
"agents": ["Research"]
},
"sqlite": {
"type": "stdio",
"command": "npx",
"args": ["-y", "mcp-server-sqlite", "data.db"],
"agents": ["*"]
}
}
}
If agents is absent or ["*"], the server loads for all agents (current behaviour).
If agents lists specific agent names, only those agents get the server started and its schemas loaded.
Alternatively, allow inline MCP server definitions inside .agent.md frontmatter, scoped exclusively to that agent.
Use case: A "Manager" coding agent needs only read/edit/execute tools and a local SQLite MCP. A "Research" agent needs Playwright, web search, GitHub, and Context7. Currently both pay the context cost for all servers.
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.9k
- PR merge metrics
- PR metrics pending
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/vscode
-
testplan-item
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
new release
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
testplan-item
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
testplan-item
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
All issues in microsoft/vscode
Similar issues
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
vercel/react-tweet#225 ·