企业托管设置中的 MCP 允许列表
英文标题:MCP allowlists in enterprise managed settings
企业所有者现可通过企业托管设置中的 `allowedMcpServers` 和 `deniedMcpServers`,集中控制 GitHub Copilot 客户端可运行哪些 Model Context Protocol(MCP)服务器。管理员可批准开发者依赖的 MCP 服务器,并在全企业范围内阻止不受信任或不合规的服务器;该功能现已正式可用。策略采用“默认拒绝”机制,配置格式错误或无法验证时将被阻止;若策略来自多个层级,服务器必须同时满足每一层策略。该机制目前已在 GitHub Copilot app、Copilot CLI 和 VS Code 中强制执行,有助于企业在使用 Agent 与外部工具时统一实施安全和合规治理。
135.3 KB
中文
企业所有者现可使用企业托管设置中新增的 allowedMcpServers 和 deniedMcpServers 键,集中控制 GitHub Copilot 客户端允许运行哪些 Model Context Protocol(MCP)服务器。您可以批准开发者所依赖的 MCP 服务器,并在整个企业范围内阻止不受信任或不合规的服务器。该功能现已正式可用。
将其中一个或两个键添加到 copilot/managed-settings.json。每个键都是一组匹配器,可通过远程 URL、本地命令或名称识别 MCP 服务器:
serverUrl:匹配远程(HTTP/SSE)服务器。支持*通配符,并会规范化 URL 以防止规避策略。serverCommand:通过精确的命令及参数匹配本地(stdio)服务器。serverName:匹配用户指定的标签。该字段仅为便利性而提供,并非安全控制手段,因为用户可以重命名服务器。
策略采用默认拒绝(fail closed)机制,这意味着格式错误或无法验证的配置会被阻止,而非被允许。当策略来自多个层级时,服务器必须通过每一个层级的策略检查。
在服务器托管部署中,这两个键都可以标记为 overridable,使企业团队能够在您的基线策略之上定义自己的允许和拒绝列表。欲了解更多信息,请参阅关于为单个团队覆盖设置的文档。
有关配置示例和完整的匹配器语法,请参阅企业托管设置参考。
MCP 允许列表目前已在 GitHub Copilot app、Copilot CLI 和 VS Code 中强制执行。
在源组织的 .github-private 仓库中,将这些键添加至 copilot/managed-settings.json,并提交到默认分支。
欲了解更多信息,请参阅配置企业托管设置。
English / 原文
Enterprise owners can now centrally control which Model Context Protocol (MCP) servers GitHub Copilot clients are allowed to run by using the new allowedMcpServers and deniedMcpServers keys in enterprise managed settings. Approve the MCP servers your developers depend on and block untrusted or non-compliant ones across your enterprise. This capability is generally available.
Add either or both keys to copilot/managed-settings.json. Each key is a list of matchers that identify MCP servers by remote URL, local command, or name:
serverUrl: Matches remote (HTTP/SSE) servers. It supports*wildcards and canonicalizes URLs to prevent evasion.serverCommand: Matches local (stdio) servers by exact command and arguments.serverName: Matches the user-assigned label. This is only supplied as a convenience, not a security control, since users can rename servers.
Policies fail closed, meaning a malformed or unverifiable configuration is blocked rather than allowed. When policies come from multiple layers, a server must pass every layer.
In server-managed deployments, both keys can be marked overridable so enterprise teams can define their own allow and deny lists on top of your baseline. To learn more, see our docs on overriding settings for individual teams.
For configuration examples and the full matcher syntax, see Enterprise managed settings reference.
MCP allowlists are currently enforced on the GitHub Copilot app, Copilot CLI and VS Code.
In your source organization’s .github-private repository, add the keys to copilot/managed-settings.json and commit to the default branch.
To learn more, see configuring enterprise managed settings.