microsoft / microsoft/vscode

Same-name user/workspace MCP collision leaves stopped server inoperable until server ID is renamed

Open
#332,072 4 comments 0 reactions 1 assignee Assigned to @connor4312 View on GitHub
agent-host bug
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

## Summary

In a multi-repository workspace, defining the same MCP server ID in multiple
repository `.vscode/mcp.json` files and in the user-scoped `mcp.json` left one
deterministic but stopped/inoperable server entry. Temporarily renaming only
the user-scoped server ID restored MCP CodeLens immediately and allowed the
server to be started and authenticated from Agent Customizations.

This reproduces on an Insiders build that includes the same-name ordering fix
from #327979 / #329010, so it may be a remaining stale
registration/activation case after a collision winner is selected.

## Environment

- VS Code: `1.135.0-insider`
- Commit: `05bf4f5ce25799e2d0daf32bf90cb885ca75a0b9`
- Date: `2026-08-20T04:40:55Z`
- OS: macOS
- Surface: Agent Host and **Agent Customizations > MCP Servers**
- Server: Figma remote HTTP MCP (`https://mcp.figma.com/mcp`)

## Configuration

Multiple repositories in the workspace and the user configuration used the
same conventional server ID:

```json
{
"servers": {
"figma": {
"type": "http",
"url": "https://mcp.figma.com/mcp"
}
}
}
```

This is a normal setup for us: repositories carry team-owned MCP
configuration, while the user entry makes the same server available in
repositories that do not provide it.

## Observed behavior

1. `MCP: List Servers` showed one `figma` entry in a stopped state, pointing to
one repository `.vscode/mcp.json`.
2. Starting or restarting that entry from the Command Palette was ineffective.
3. The colliding `mcp.json` did not show the MCP **Start/Configure** CodeLens,
so the server could not be started from the file either.
4. Agent Host sessions did not receive Figma tools.
5. Window output logged a collision:

```text
Overwriting mcp server 'figma' from /.vscode/mcp.json
with /User/mcp.json.
```

## Recovery observation

1. I renamed only the user-scoped key from `figma` to `figma-user`.
2. The MCP CodeLens appeared immediately, without a window reload.
3. Starting the renamed entry initially remained at `Starting...`.
4. Starting it from **Agent Customizations > MCP Servers** subsequently
surfaced the expected external Figma OAuth flow and completed successfully.
5. Renaming the user entry back to `figma` did not immediately reproduce the
failure.

`MCP: Reset Trust` was also used earlier during troubleshooting, so it may have
affected the eventual OAuth flow. However, the immediate return of CodeLens
was directly correlated with changing the server ID.

## Expected behavior

- Same-name user/workspace entries should resolve through deterministic
collision priority.
- The effective winner should remain startable through `MCP: List Servers`,
its configuration CodeLens, and Agent Customizations.
- Replacing or shadowing a definition should fully invalidate stale server
registration, lifecycle, and session tool-projection state.
- Users should not need to coordinate globally unique server names across
private user configuration and team-owned repository configuration.

## Possible area to investigate

Changing the key may have created a new internal server identity and forced
registration, CodeLens, activation, or authentication bindings to be rebuilt.
The state shown by the Window registry, `MCP: List Servers`, CodeLens, Agent
Customizations, and the Agent Host session appeared inconsistent before that
rename.

#327979 / #329010 stabilized same-name sorting and winner selection. This case
may occur after a stable winner has been selected but remains bound to stale or
overwritten lifecycle state.

Related UX/provenance discussion: #327167.
Older multi-root collision report with the same immediate rename workaround:
#295660.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.