Repository navigation
Conversation
Carry enabled plugin-discovered MCP definitions into each owning SDK custom agent. Keep session-config servers on their existing registration path and preserve the authored tool allowlist. Fixes microsoft#342860 Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Projection loses server-level tool restrictions, and runtime lifecycle ownership still needs maintainer confirmation.
1 open issue
What changed in this PR
Preserves plugin-owned MCP definitions when projecting agents into the Copilot SDK catalog, addressing #342860.
Changes:
- Attaches enabled, plugin-discovered MCP servers to their owning agents.
- Adds regression coverage for ownership, disabled servers, session-config exclusion, and agent tool allowlists.
| File | Description |
|---|---|
| src/vs/platform/agentHost/test/node/copilotPluginConverters.test.ts | Tests plugin-scoped MCP projection. |
| src/vs/platform/agentHost/node/copilot/copilotPluginConverters.ts | Includes owning-plugin MCP definitions in projected agents. |
Review effort: Balanced
| const mcpServers = toSdkMcpServers((plugin.mcpServers ?? []).filter(server => | ||
| server.sdkRegistration === 'pluginDiscovery' && !plugin.disabledMcpServers?.includes(server.name) | ||
| )); |
There was a problem hiding this comment.
Confirmed and addressed in 6b8b52e. The parser discarded the authored server tools list, and shared Copilot conversion then hard-coded ['*'].
Server lists now survive parsing and conversion for stdio, HTTP, and SSE. Explicit [] remains empty; omitted lists retain the existing wildcard default. Malformed lists reject the server entry rather than falling back to wildcard access.
Added one regression reading a real in-memory .mcp.json through agent projection, with no agent-level restriction and literal expected server tool lists (not expectations derived from the converter). Observed 52 passing / 1 failing before the fix; 116 tests now pass across the three affected suites. Updated the existing CLI parsing expectation as well. Fast build, targeted lint, and whitespace checks pass.
Also checked actual compiled converter output with the current pinned native runtime and a two-tool synthetic server: wildcard exposes both tools, ['read'] exposes only read, and [] exposes no MCP tools. Full typechecking remains blocked by the checkout's missing Electron/original-fs declarations, with no diagnostics for changed files. Leaving the PR draft for maintainer confirmation of registration/lifecycle ownership.
|
@microsoft-github-policy-service agree company="Emerson" |
Keep authored server tool restrictions through plugin parsing and shared Copilot conversion instead of replacing them with wildcard access. Preserve empty allowlists and reject malformed restrictions. Add one regression from a plugin MCP file through agent projection, covering restricted, empty, wildcard, omitted, and malformed tool lists. Update the existing CLI configuration read expectation. Refs microsoft#342860 Co-authored-by: Copilot <[email protected]>

Summary
Fixes #342860.
The explicit SDK agent catalog loses native plugin-agent MCP association. Preserve that scope during projection using the existing MCP converter. Definitions remain authoritative inside the plugin; no global MCP configuration or manual Start requests are added.
Disabled servers are excluded, same-named servers stay scoped to their owning plugin's agents, and servers already registered through session config keep their existing path.
Preserve server-level
toolsthrough parsing and shared Copilot conversion: restricted lists stay restricted,[]exposes no tools, and omitted lists retain the existing['*']default. Malformed lists are rejected using the parser's existing invalid-entry behavior. This also preserves tool lists when reading supported CLI configuration entries.Evidence
mcpServers; 51 passing, 1 failing. After the initial fix: 52 passing..mcp.jsonthrough agent projection reports 52 passing, 1 failing, with restricted and empty server lists incorrectly emitted as['*']. After the follow-up: 116 passing across the converter, plugin parser, and shared Copilot configuration suites.npm run build-fast -- --client-only, targeted ESLint, andgit diff --checkpass.1.0.19-unstable.38345923974.g3754b70and1.0.23-preview.5. Actual compiled patched converter output connects the server and exposesprobe-readon the first model request without MCP Start requests or root server registration.['*']exposes both tools,['read']exposes onlyread, and[]exposes neither. The server connects in all three cases.Validation limits: native probes ran on Windows with a loopback synthetic model, not a complete Linux Agent Host/Insiders UI session. Full
typecheck-clientwas rerun but remains blocked by missing Electron/original-fs declarations after native dependency installation failed; no diagnostics were reported for the changed files. The fast build transpiles rather than type-checks.Recheck:
Merge Danger
Door: two-way
Reversible projection and shared configuration conversion changes; no protocol or persisted configuration migration.
Blast Radius: Copilot
Affects projected plugin custom agents with plugin-discovered MCP servers and shared Copilot server configuration conversion. Existing behavior is unchanged when no server tool list is authored. Malformed authored tool lists now reject the server entry instead of silently becoming unrestricted. Kept draft for maintainer confirmation of intended SDK registration/lifecycle ownership and full host integration verification.