Repository navigation
Add enterprise allowedMcpServers / deniedMcpServers governance policies for MCP servers - #326226
Merged
Merged
Conversation
…es for MCP servers
Contributor
There was a problem hiding this comment.
Pull request overview
Adds enterprise governance policies for per-server MCP allow/deny lists across installation and runtime.
Changes:
- Adds managed policy definitions and normalization.
- Implements name, URL-pattern, and command matching.
- Adds runtime enforcement, UI error states, and tests.
Show a summary per file
| File | Description |
|---|---|
build/lib/policies/policyData.jsonc |
Exports both policies. |
src/vs/platform/mcp/common/allowedMcpServers.ts |
Implements matcher validation and evaluation. |
src/vs/platform/mcp/common/allowedMcpServersService.ts |
Applies configured governance rules. |
src/vs/platform/mcp/common/mcpManagement.ts |
Defines policy settings and service API. |
src/vs/platform/mcp/test/common/allowedMcpServers.test.ts |
Tests matcher behavior. |
src/vs/platform/mcp/test/common/allowedMcpServersService.test.ts |
Tests service enforcement. |
src/vs/platform/policy/common/copilotManagedSettings.ts |
Normalizes new managed-setting keys. |
src/vs/workbench/contrib/chat/browser/chat.shared.contribution.ts |
Registers policy-only configurations. |
src/vs/workbench/contrib/mcp/common/mcpServer.ts |
Adds runtime policy checks and error state. |
src/vs/workbench/services/accounts/browser/managedSettings.ts |
Types server-managed matcher payloads. |
src/vs/workbench/services/accounts/test/browser/managedSettings.test.ts |
Tests payload adaptation. |
Review details
- Files reviewed: 11/11 changed files
- Comments generated: 8
- Review effort level: Medium
Vijay Upadya (vijayupadya)
marked this pull request as ready for review
July 17, 2026 01:16
Justin Chen (justschen)
approved these changes
Jul 17, 2026
Vijay Upadya (vijayupadya)
enabled auto-merge (squash)
July 17, 2026 02:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes https://github.com/microsoft/vscode-internalbacklog/issues/7930
Summary
Adds enterprise-managed per-server MCP allow/deny lists so administrators can control which MCP servers may be installed and run. Servers are matched by name, remote URL pattern (with * wildcards), or exact local command invocation. Enforced at both install time and runtime, and delivered via enterprise policy (governance-only; not surfaced in the Settings UI).
Settings / policies
Behavior
chat.mcp.accessgate — controls are ANDed; the most restrictive wins.chat.mcp.access: nonestill blocks everything, andregistrycontinues to be enforced independently.*wildcards in the authority (scheme/host/port) never cross/into the path, so an authority wildcard cannot admit an untrusted host.canInstallUI check — so the management APIs can't be used to bypass it.${...}variables) and decided authoritatively once resolved.