Skip to content

mcp: add persistent server enablement scopes#326251

Open
connor4312 wants to merge 2 commits into
mainfrom
connor/mcp-server-enablement-scopes
Open

mcp: add persistent server enablement scopes#326251
connor4312 wants to merge 2 commits into
mainfrom
connor/mcp-server-enablement-scopes

Conversation

@connor4312

Copy link
Copy Markdown
Member

Fixes #326167

Summary

  • persist profile and workspace enablement for agent-host-only MCP servers
  • keep session enablement independent and apply changed durable preferences immediately before turns
  • expose profile, workspace, and session actions in one consistent enablement group
  • use exact, unambiguous local-server correlation and structured MCP tracking

Validation

  • npm run typecheck-client
  • npm run valid-layers-check
  • npm run precommit
  • 17 focused MCP and agent-host tests
Persist profile and workspace enablement for agent-host-only MCP servers while keeping session overrides independent. Apply durable changes immediately before turns and group profile, workspace, and session actions consistently.

Fixes #326167

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 17, 2026 00:12
@connor4312
connor4312 enabled auto-merge July 17, 2026 00:12

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.

Pull request overview

Adds persistent profile/workspace enablement for agent-host MCP servers while preserving session-level controls.

Changes:

  • Persists durable MCP enablement and applies changes before turns.
  • Unifies profile, workspace, and session actions.
  • Adds exact local-server matching and focused tests.
Show a summary per file
File Description
.github/skills/sessions/SKILL.md Documents structured MCP tracking.
src/vs/sessions/AI_CUSTOMIZATIONS.md Documents enablement scopes and reconciliation.
src/vs/sessions/contrib/providers/remoteAgentHost/test/browser/remoteAgentHostCustomizationHarness.test.ts Updates customization-service mock.
src/vs/sessions/services/agentHost/browser/agentHostCustomizationService.ts Adds storage injection and tracking cleanup.
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService.ts Implements durable enablement and turn preparation.
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.ts Prepares MCP state before dispatch.
src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.ts Adds scoped enablement actions and exact matching.
src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostChatContribution.test.ts Tests pre-turn preparation.
src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostCustomizationService.test.ts Tests persistence and reconciliation behavior.
src/vs/workbench/contrib/chat/test/browser/aiCustomization/mcpListWidget.test.ts Tests action composition and scopes.
src/vs/workbench/contrib/mcp/browser/mcpCommands.ts Adds scoped server-option actions.
src/vs/workbench/contrib/mcp/test/browser/mcpCommands.test.ts Tests unambiguous server correlation.

Review details

  • Files reviewed: 12/12 changed files
  • Comments generated: 4
  • Review effort level: Medium
Comment thread src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.ts Outdated
Comment thread src/vs/workbench/contrib/mcp/browser/mcpCommands.ts Outdated
@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Base: 5b1112a3 Current: c22f9481

No screenshot changes.

Use the Sessions-aware active project root for workspace action visibility and include the session working directory in workspace-scoped agent-host MCP preferences. Keep profile preferences shared across repositories.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants