企业自建 MCP 注册表的两种部署方式
介绍为企业配置 MCP 注册表的两种路径:自托管开源注册表或使用 Azure API Center 托管服务,并说明该功能处于公开预览阶段,更安全的访问限制应通过 managed-settings.json 实现。
重要 此功能在公众预览中, 而不是用于限制访问 MCP 服务器的推荐方法。 安全性越高, 一般可用的方法是定义您企业的设置 。 `managed-settings.json` 文档。 [为您的企业配置 MCP 服务器授权列表](<https://docs.github.com/en/copilot/how-tos/administer-copilot/manage-mcp-usage/configure-enterprise-allowlist>)。如果您已经使用插件市场,请参见 [将 MCP 分发到市场](<https://docs.github.com/en/copilot/how-tos/administer-copilot/manage-for-enterprise/use-managed-settings/manage-plugin-marketplaces-and-plugins#move-mcp-distribution-from-a-registry-to-a-marketplace>). ## [先决条件](<https://docs.github.com/en/copilot/how-tos/administer-copilot/manage-mcp-usage/configure-mcp-registry#prerequisites>) 在创建您的模式上下文协议( MCP) 注册前, 您应该了解 MCP 管理对您的公司的功能和好处 。 见 [您公司的 MCP 服务器使用情况](<https://docs.github.com/en/copilot/concepts/enterprise/mcp-management>). ## [选项 1: 自动托管 MCP 登记册](<https://docs.github.com/en/copilot/how-tos/administer-copilot/manage-mcp-usage/configure-mcp-registry#option-1-self-hosting-an-mcp-registry>) 在核心中,MCP注册是一组HTTPS端点,服务于包含的MCP服务器的细节. 您可以使用以下任何选项创建您的注册: - 叉和自主机开源的 MCP 注册。要开始,请参见 [MCP 登记快速启动](<https://github.com/modelcontextprotocol/registry/tree/main?tab=readme-ov-file#quick-start>) 输入 `modelcontextprotocol/registry` 存储器。 - 使用 Docker 本地运行开源注册 。 - 发布您的自定义执行 。 说明 如果您想让您的开发者访问本地的 MCP 服务器, 请在您的注册簿中包含有正确服务器 ID 的服务器。 更多信息请参见 [MCP 私人登记执法](<https://docs.github.com/en/copilot/reference/enterprise-administrators/mcp-private-registry-enforcement>). 为了建立一个有效的MCP登记册,由GitHub副驾驶可以到达,该登记册必须满足下列要求: - [终点和规格要求](<https://docs.github.com/en/copilot/how-tos/administer-copilot/manage-mcp-usage/configure-mcp-registry#endpoint-and-specification-requirements>) - [跨奥里京资源分享需求](<https://docs.github.com/en/copilot/how-tos/administer-copilot/manage-mcp-usage/configure-mcp-registry#cross-origin-resource-sharing-requirements>) ### [终点和规格要求](<https://docs.github.com/en/copilot/how-tos/administer-copilot/manage-mcp-usage/configure-mcp-registry#endpoint-and-specification-requirements>) 一个有效的登记册必须支持URL的路由,并遵循v0.1 MCP的登记册规格,包括以下终点: . - `GET /v0.1/servers`: 返回所有包含的 MCP 服务器列表 - `GET /v0.1/servers/{serverName}/versions/latest`: 返回特定服务器的最新版本 - `GET /v0.1/servers/{serverName}/versions/{version}`: 返回服务器特定版本的细节 详情和实例 JSON 对请求的答复,见 [正式的MCP登记文件](<https://registry.modelcontextprotocol.io/docs>). #### [对 v0.1 规格的支持](<https://docs.github.com/en/copilot/how-tos/administer-copilot/manage-mcp-usage/configure-mcp-registry#support-for-the-v01-specification>) 虽然使用v0规格启动的MCP注册,但该版本现在被认为不稳定,不应执行. 相反,按照v0.1规格创建您的注册,该规格在以下表面得到支持: | 表面 | v0.1 支持 | | --- | --- | | VS 代码内置器 | | | VS 代码 | | | 视觉工作室 | | | 剪贴画 | | | JetBrains 接口 | | | Xcode 代码 | | | 副驾驶 CLI | | ### [跨奥里京资源分享需求](<https://docs.github.com/en/copilot/how-tos/administer-copilot/manage-mcp-usage/configure-mcp-registry#cross-origin-resource-sharing-requirements>) 为了确保Copilot在获取您的注册时能够成功提出跨源请求,注册或反向代理必须包含 Cross-Origin 资源共享( CORS ) 标题。 在所有标题中添加以下标题 `/v0.1/servers` 结束点 : ```http Access-Control-Allow-Origin: * Access-Control-Allow-Methods: GET, OPTIONS Access-Control-Allow-Headers: Authorization, Content-Type ``` ## [选项 2:使用Azure API中心作为MCP登记册.](<https://docs.github.com/en/copilot/how-tos/administer-copilot/manage-mcp-usage/configure-mcp-registry#option-2-using-azure-api-center-as-an-mcp-registry>) Azure API Center提供完全管理的MCP注册,拥有自动CORS配置,内置治理功能,没有额外的网络服务器设置. 1. 要完成您的注册初始设置,请参见 [在您的 API 库存中注册和发现远程 MCP 服务器](<https://learn.microsoft.com/azure/api-center/register-discover-mcp-server>) 在 Azure 文档中。 2. 如果您想让您的开发者访问本地的 MCP 服务器, 请在您的注册簿中包含有正确服务器 ID 的服务器。 更多信息请参见 [MCP 私人登记执法](<https://docs.github.com/en/copilot/reference/enterprise-administrators/mcp-private-registry-enforcement>). 3. 为了确保GitHub 副驾驶可以获取您的注册,在您的API中心的能见度设置中,允许匿名访问. 4. 复制您的 API Center 端点 URL 。 在下篇文章中, 您将使用此 URL 在您的公司中提供您的注册 。 ### [定价和限制](<https://docs.github.com/en/copilot/how-tos/administer-copilot/manage-mcp-usage/configure-mcp-registry#pricing-and-limits>) Azure API中心提供 **自由级** 用于基本的 API 编目和发现,包括 MCP 注册管理。如果您需要高于包含自由级的上限,您可以升级到标准计划。详细限值和定价请参见 [Azure API 中心限制](<https://learn.microsoft.com/azure/azure-resource-manager/management/azure-subscription-service-limits#azure-api-center-limits>) 在 Azure 文档中。 ## [今后的步骤](<https://docs.github.com/en/copilot/how-tos/administer-copilot/manage-mcp-usage/configure-mcp-registry#next-steps>) 现在您已经创建了您的 MCP 注册簿, 您可以为您的公司设置 MCP 政策 。 见 [限制 MCP 服务器访问自定义注册](<https://docs.github.com/en/copilot/how-tos/administer-copilot/manage-mcp-usage/restrict-based-on-registry>).
查看原始来源