Repository navigation
Closed
Description
Summary
Currently MCP servers are discovered only for a single workspace folder. In multi-root workspaces the product only loads customizations (instructions/skills/agents) from the primary working directory by default; MCP server discovery follows the same single-folder behavior. For provisional sessions VS Code may list MCP servers, but those lists are also limited to a single folder.
Proposal
Support loading and listing MCP servers from all workspace folders in multi-root workspaces.
Rationale
- Consistency: Other local agents (Copilot, Claude, local agent) and existing multi-root behavior aim to load instructions/skills/agents from multiple workspace folders. MCP server discovery should follow the same approach.
- Usability: Users working in multi-root workspaces expect servers declared in any workspace folder (including workspace-specific .mcp.json files and .vscode/mcp.json) to be available when creating sessions.
- Provisional sessions: Use available SDK APIs (e.g., Copilot SDK discovery/listing if available) to include MCP servers from all workspace folders for provisional sessions as well.
Acceptance criteria
- MCP servers declared in any workspace folder are discoverable and listed in the MCP servers picker when a multi-root workspace is open.
- Workspace-specific .mcp.json and .vscode/mcp.json files from all workspace folders are honored and their servers included.
- Provisional sessions include MCP servers discovered from all workspace folders (using Copilot SDK discovery/listing where applicable).
- Duplicate servers are de-duplicated in UI lists.
- Behavior is configurable or documented (if there are cases where only the primary folder should be used, document rationale and opt-out).
Implementation notes
- Update MCP server discovery logic to iterate over all workspace folders and aggregate servers from each folder's configuration (.mcp.json, .vscode/mcp.json, etc.).
- When creating sessions, allow manually specifying mcpServers for the session and ensure servers from all workspace folders can be included.
- For provisional sessions, investigate and use the Copilot SDK (or equivalent) API for discovery/listing if available.
- Present servers grouped by workspace folder in the UI (or clearly show source folder) to make it obvious where each server is declared.
Link to discussion/context
This request is based on internal discussion about multi-root behavior for MCP servers and aligning with how local agents manage multi-root loading of instructions/skills/agents.
Activity