microsoft / microsoft/vscode

MCP servers with workspace variables cannot be migrated to .mcp.json

Closed
#336,854 0 comments 0 reactions 1 assignee View on GitHub

@vritant24 is already working on this.

Since Sep 18, 2026.

ai-customizations bug mcp
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

  1. Enable chat.customizations.mcpServerMigration.enabled.

  2. Open a trusted folder and create .vscode/mcp.json:

    {
      "servers": {
        "workspace-server": {
          "type": "stdio",
          "command": "${workspaceFolder}/server.js",
          "args": ["${workspaceFolderBasename}", "${pathSeparator}"]
        }
      }
    }
    
  3. Start an Agent Host session for the folder.

  4. 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

  1. Repeat the reproduction steps in a build containing #336822.
  2. Verify workspace-server appears in Migrate MCP Servers.
  3. Migrate it and confirm .mcp.json contains concrete values with no ${...} placeholders.
  4. Confirm the original entry is removed from .vscode/mcp.json.
  5. Add a server using ${env:NAME} and verify that server is not offered for migration.

Related

  • Fix: #336822
  • Test plan: #336823

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.