Skip to content

mcp: show where built-in MCP servers come from - #339427

Open
Vritant Bhardwaj (vritant24) wants to merge 3 commits into
microsoft:mainfrom
vritant24:agents/mcp-servers-config-visibility-issue
Open

Vritant Bhardwaj (vritant24) wants to merge 3 commits into
microsoft:mainfrom
vritant24:agents/mcp-servers-config-visibility-issue

Conversation

@vritant24

@vritant24 Vritant Bhardwaj (vritant24) commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Fixes #338719

The MCP server details in Chat Customizations didn't say where built-in servers come from. The header showed a made-up mcp.json, and Configuration only said "No definition is available". This PR uses what the agent runtime already reports about each server (its source, display name and contributing plugin) to show the real origin, and explains when there's nothing to show.

What you'll see

MCP server Before Now
github-mcp-server (built into Copilot CLI) Made-up mcp.json label; "No definition is available" Built-in: Copilot. Configuration explains that Copilot sets it up, with an Open Settings link to chat.agentHost.githubMcpServer.enabled
Copilot connector (managed by Copilot) Opaque name (github-copilot-connector-…), made-up mcp.json The connector's real name (e.g. "Linear"), Managed by Copilot, and an explanation
GitHub server from the Copilot Chat extension (local chat) No source Built-in: GitHub Copilot Chat, linking to the extension; the ... menu gains Show Extension
Added via MCP: Add Server → Add to Current Agent Session Could land under Built-In; no definition Listed under User, labelled Agent host configuration, with its definition
Reported as user or workspace config, but no file is known Made-up mcp.json label User configuration / Workspace configuration
Configured in an mcp.json or another app's config file File link and Edit Configuration Unchanged. Built-in rows backed by another app's file (e.g. Claude Desktop) also get Show Configuration in the ... menu

How it works

  • The Copilot agent host forwards the runtime's displayName and sourcePlugin (from session.mcp.list) as optional, namespaced _meta on MCP server customizations. Other agent hosts can leave them out.
  • The agent host also declares, in _meta, the setting that controls a server it adds itself. The UI only offers Open Settings when the host declares one.
  • The details page shows where a server comes from when there's no file to open, and an explanation when the agent owns the definition.
  • An open details page updates when the agent host reports new metadata. For example, a server in a restored session gets its name, origin and settings link once the runtime reports it, without reopening the page.
  • getMcpServers() also exposes the definition the agent host's own configuration holds for a server, so servers added there show their definition.

Notes for reviewers

  • Display names replace the row label only for managed servers. For other servers the runtime falls back to the server's own advertised title, which would rename servers that users configured.
  • Copilot Chat's own servers keep their extension ID (to link to it) but stay under Built-In.
  • The setting link is never inferred from a server's name. Another agent host, a plugin, or a user's config can also publish a github-mcp-server that chat.agentHost.githubMcpServer.enabled can't control, so Copilot declares the setting only for the runtime's own GitHub server.
  • Not in this PR: showing a built-in server's tools or instructions, or its actual definition (the Copilot SDK doesn't expose it).

How to test

  1. In a Copilot CLI agent session, open Chat Customizations → MCP Servers and select github-mcp-server. The header says "Built-in: Copilot", Configuration explains why there's no definition, and Open Settings opens chat.agentHost.githubMcpServer.enabled.
  2. Run MCP: Add Server → Add to Current Agent Session. The server is listed under User with "Agent host configuration" and its definition.
  3. In a local chat, select Copilot's GitHub server. The header links to GitHub Copilot Chat, and ... → Show Extension opens it.
  4. A server from .vscode/mcp.json still shows its file link and Edit Configuration.
  5. Open a server's details while a resumed Copilot CLI session is still starting. Once the runtime reports the server, the details update (name, origin, settings link) without reopening.

The EmbeddedMcpDetailBuiltinAgent and EmbeddedMcpDetailBuiltinExtension component fixtures show the new details states.

Validation (run locally on top of current main):

  • Unit tests: passed, 1181 passing and 0 failing.
    ./scripts/test.sh \
      --run src/vs/platform/agentHost/test/common/agentMetaReaders.test.ts \
      --run src/vs/platform/agentHost/test/common/metadataCompatibility.test.ts \
      --run src/vs/platform/agentHost/test/node/shared/mcpCustomizationController.test.ts \
      --run src/vs/platform/agentHost/test/node/shared/githubMcpServer.test.ts \
      --run src/vs/platform/agentHost/test/node/copilotAgentSession.test.ts \
      --run src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostCustomizationService.test.ts \
      --run src/vs/workbench/contrib/chat/test/browser/aiCustomization/embeddedMcpServerDetail.test.ts \
      --run src/vs/workbench/contrib/chat/test/browser/aiCustomization/mcpListWidget.test.ts \
      --run src/vs/workbench/contrib/chat/test/browser/aiCustomization/aiCustomizationManagementEditor.test.ts
    
  • npx tsc --project ./src/tsconfig.json --noEmit --skipLibCheck: no new errors. My locally installed dependencies are older than main's lockfile, which causes 14 errors in copilotAgent.ts and localTranscriptionService.ts; the same 14 appear on unmodified main.
  • npx eslint --max-warnings 0 on the changed files: passed.
  • node build/stylelint.ts src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationManagement.css: passed.
  • node build/checker/layersChecker.ts: passed.
  • Pre-commit hygiene: passed.

The Chat Customizations MCP details page showed no source for built-in
servers: the header fell back to a literal "mcp.json" and the
Configuration section was empty without explanation.

- Forward the runtime-reported display name and source plugin from the
  Copilot agent host as namespaced customization metadata.
- Show where a server comes from when it has no configuration file
  (e.g. "Built-in: Copilot", "Managed by Copilot", "Agent host
  configuration"); Copilot-contributed servers link to their extension.
- Explain why the agent's own servers have no definition, and link
  github-mcp-server to chat.agentHost.githubMcpServer.enabled.
- Show the definition of servers added to the agent host configuration
  and group them under User.
- Add Show Extension / Show Configuration to built-in row menus.

Fixes microsoft#338719

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 2, 2026 23:25
…nfig-visibility-issue

# Conflicts:
#	src/vs/workbench/contrib/chat/test/browser/aiCustomization/mcpListWidget.test.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Provider-specific settings are inferred from a server name, and open details do not refresh when runtime provenance arrives.

Review effort: Balanced
Findings: 2 Medium severity

Open (2)
What changed in this PR

Adds accurate provenance and configuration details for built-in and Agent Host MCP servers.

Changes:

  • Propagates runtime display names, source plugins, and host-held definitions.
  • Shows provenance, settings links, and source actions in MCP details.
  • Adds focused unit tests and visual fixtures.
File Description
src/​vs/​workbench/​test/​browser/​componentFixtures/​sessions/​aiCustomizationManagementEditor.fixture.ts Adds built-in MCP detail fixtures.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​aiCustomization/​mcpListWidget.test.ts Tests labels, provenance, grouping, and source actions.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​aiCustomization/​embeddedMcpServerDetail.test.ts Tests provenance and settings rendering.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​agentSessions/​agentHostCustomizationService.test.ts Tests runtime metadata and host definitions.
src/​vs/​workbench/​contrib/​chat/​browser/​aiCustomization/​media/​aiCustomizationManagement.css Styles provenance and settings links.
src/​vs/​workbench/​contrib/​chat/​browser/​aiCustomization/​mcpServerCount.ts Selects managed display names and expands search.
src/​vs/​workbench/​contrib/​chat/​browser/​aiCustomization/​mcpListWidget.ts Integrates provenance, definitions, grouping, and actions.
src/​vs/​workbench/​contrib/​chat/​browser/​aiCustomization/​embeddedMcpServerDetail.ts Renders real origins and unavailable-definition explanations.
src/​vs/​workbench/​contrib/​chat/​browser/​agentSessions/​agentHost/​agentHostCustomizationService.ts Exposes metadata and host configuration.
src/​vs/​sessions/​common/​agentHostSessionsProvider.ts Extends the shared MCP server contract.
src/​vs/​platform/​agentHost/​test/​node/​shared/​mcpCustomizationController.test.ts Tests metadata lifecycle behavior.
src/​vs/​platform/​agentHost/​test/​node/​copilotAgentSession.test.ts Tests SDK metadata propagation.
src/​vs/​platform/​agentHost/​test/​common/​agentMetaReaders.test.ts Tests metadata validation and clearing.
src/​vs/​platform/​agentHost/​node/​shared/​mcpCustomizationController.ts Publishes and preserves MCP provenance metadata.
src/​vs/​platform/​agentHost/​node/​shared/​githubMcpServer.ts Re-exports the shared server name.
src/​vs/​platform/​agentHost/​node/​copilot/​copilotAgentSession.ts Maps SDK provenance into Agent Host state.
src/​vs/​platform/​agentHost/​common/​meta/​vscode/​mcpCustomizationMeta.ts Defines typed metadata readers and writers.
src/​vs/​platform/​agentHost/​common/​meta/​mcpCustomizationMeta.ts Exports the new metadata helpers.
src/​vs/​platform/​agentHost/​common/​githubEndpoints.ts Centralizes the GitHub MCP server name.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.ts Outdated
Address review feedback on the MCP provenance change:

- The agent host now declares which VS Code setting controls a server it
  adds itself, in provider-owned metadata, instead of the UI inferring it
  from the server's name. Copilot declares the GitHub MCP server setting
  only for the runtime's own GitHub server, so a server with the same name
  from another host, a plugin or user configuration gets no settings link
  it cannot control.
- An open MCP details page now refreshes when the agent host reports new
  metadata, so a restored server picks up its display name, provenance,
  settings link and host configuration once the runtime inventory arrives,
  without reopening it.

Fixes microsoft#338719

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AI Customization does not show the source of built-in MCP servers

3 participants