MCP servers with workspace variables cannot be migrated to .mcp.json
@vritant24 is already working on this.
Since Sep 18, 2026.
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.7k
- PR merge metrics
- PR metrics pending
Description
Type of Bug
Bug
Description
The Migrate MCP Servers flow does not offer otherwise compatible workspace MCP servers when their .vscode/mcp.json configuration contains deterministic workspace or path variables.
Variables such as ${workspaceFolder}, ${workspaceFolderBasename}, ${cwd}, ${pathSeparator}, and their scoped or legacy aliases can be resolved without user interaction. The migration should replace them with concrete values before writing the workspace-root .mcp.json.
Steps to Reproduce
-
Enable
chat.customizations.mcpServerMigration.enabled. -
Open a trusted folder and create
.vscode/mcp.json:{ "servers": { "workspace-server": { "type": "stdio", "command": "${workspaceFolder}/server.js", "args": ["${workspaceFolderBasename}", "${pathSeparator}"] } } } -
Start an Agent Host session for the folder.
-
Open Chat: Open Customizations and select Migrate MCP Servers.
Actual Behavior
workspace-server is excluded from migration because the source configuration contains variable interpolation.
Expected Behavior
The server is offered for migration. Migrating it removes the entry from .vscode/mcp.json and writes it to .mcp.json with the supported variables replaced by their concrete path, folder-name, or separator values. Variables requiring user interaction or potentially exposing secrets, such as ${input:...}, ${command:...}, and ${env:...}, remain excluded.
Simple Verification
- Repeat the reproduction steps in a build containing #336822.
- Verify
workspace-serverappears in Migrate MCP Servers. - Migrate it and confirm
.mcp.jsoncontains concrete values with no${...}placeholders. - Confirm the original entry is removed from
.vscode/mcp.json. - Add a server using
${env:NAME}and verify that server is not offered for migration.
Related
- Fix: #336822
- Test plan: #336823
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.
Assessment
This issue has not been assessed yet.