Skip to main content
MCP 注册表目前处于预览阶段。在正式发布之前,可能会发生破坏性更改或数据重置。如果遇到任何问题,请在 GitHub 上报告。

包类型

MCP 注册表支持几种不同的包类型,每种包类型都有其自己的验证方法。

npm 包

对于 npm 包,MCP 注册表目前仅支持 npm 公共注册表(https://registry.npmjs.org)。 npm 包在 server.json 中使用 "registryType": "npm"。例如:
server.json
{
  "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
  "name": "io.github.username/email-integration-mcp",
  "title": "Email Integration",
  "description": "Send emails and manage email accounts",
  "version": "1.0.0",
  "packages": [
    {
      "registryType": "npm",
      "identifier": "@username/email-integration-mcp",
      "version": "1.0.0",
      "transport": {
        "type": "stdio"
      }
    }
  ]
}

所有权验证

MCP 注册表通过检查 package.json 中的 mcpName 来验证 npm 包的所有权。mcpName 属性必须server.json 中的服务器名称匹配。例如:
package.json
{
  "name": "@username/email-integration-mcp",
  "version": "1.0.0",
  "mcpName": "io.github.username/email-integration-mcp"
}

PyPI 包

对于 PyPI 包,MCP 注册表目前仅支持官方 PyPI 注册表(https://pypi.org)。 PyPI 包在 server.json 中使用 "registryType": "pypi"。例如:
server.json
{
  "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
  "name": "io.github.username/database-query-mcp",
  "title": "Database Query",
  "description": "Execute SQL queries and manage database connections",
  "version": "1.0.0",
  "packages": [
    {
      "registryType": "pypi",
      "identifier": "database-query-mcp",
      "version": "1.0.0",
      "transport": {
        "type": "stdio"
      }
    }
  ]
}

所有权验证

MCP 注册表通过检查包 README 中是否存在 mcp-name: $SERVER_NAME 字符串来验证 PyPI 包的所有权(该 README 会成为 PyPI 上的包描述)。该字符串可以隐藏在注释中,但 $SERVER_NAME 部分必须server.json 中的服务器名称匹配。例如:
README.md
# Database Query MCP Server

This MCP server executes SQL queries and manages database connections.

<!-- mcp-name: io.github.username/database-query-mcp -->

NuGet 包

对于 NuGet 包,MCP 注册表目前仅支持官方 NuGet 注册表(https://api.nuget.org/v3/index.json)。 NuGet 包在 server.json 中使用 "registryType": "nuget"。例如:
server.json
{
  "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
  "name": "io.github.username/azure-devops-mcp",
  "title": "Azure DevOps",
  "description": "Manage Azure DevOps work items and pipelines",
  "version": "1.0.0",
  "packages": [
    {
      "registryType": "nuget",
      "identifier": "Username.AzureDevOpsMcp",
      "version": "1.0.0",
      "transport": {
        "type": "stdio"
      }
    }
  ]
}

所有权验证

MCP 注册表通过检查包 README 中是否存在 mcp-name: $SERVER_NAME 字符串来验证 NuGet 包的所有权。该字符串可以隐藏在注释中,但 $SERVER_NAME 部分必须server.json 中的服务器名称匹配。例如:
README.md
# Azure DevOps MCP Server

This MCP server manages Azure DevOps work items and pipelines.

<!-- mcp-name: io.github.username/azure-devops-mcp -->

Docker/OCI 镜像

对于 Docker/OCI 镜像,MCP 注册表目前支持:
  • Docker Hub (docker.io)
  • GitHub 容器注册表 (ghcr.io)
  • Google Artifact Registry(任何 *.pkg.dev 域名)
  • Azure 容器注册表 (*.azurecr.io)
  • Microsoft 容器注册表 (mcr.microsoft.com)
Docker/OCI 镜像在 server.json 中使用 "registryType": "oci"。例如:
server.json
{
  "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
  "name": "io.github.username/kubernetes-manager-mcp",
  "title": "Kubernetes Manager",
  "description": "Deploy and manage Kubernetes resources",
  "version": "1.0.0",
  "packages": [
    {
      "registryType": "oci",
      "identifier": "docker.io/yourusername/kubernetes-manager-mcp:1.0.0",
      "transport": {
        "type": "stdio"
      }
    }
  ]
}
identifier 的格式是 registry/namespace/repository:tag。例如,docker.io/user/app:1.0.0ghcr.io/user/app:1.0.0。标签也可以指定为摘要。

所有权验证

MCP 注册表通过检查 io.modelcontextprotocol.server.name 注解来验证 Docker/OCI 镜像的所有权。io.modelcontextprotocol.server.name 注解的值必须server.json 中的服务器名称匹配。例如:
Dockerfile
LABEL io.modelcontextprotocol.server.name="io.github.username/kubernetes-manager-mcp"

MCPB 包

对于 MCPB 包,MCP 注册表目前支持通过 GitHub 或 GitLab 发布版本托管的 MCPB 工件。 MCPB 包在 server.json 中使用 "registryType": "mcpb"。例如:
server.json
{
  "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
  "name": "io.github.username/image-processor-mcp",
  "title": "Image Processor",
  "description": "Process and transform images with various filters",
  "version": "1.0.0",
  "packages": [
    {
      "registryType": "mcpb",
      "identifier": "https://github.com/username/image-processor-mcp/releases/download/v1.0.0/image-processor.mcpb",
      "fileSha256": "fe333e598595000ae021bd27117db32ec69af6987f507ba7a63c90638ff633ce",
      "transport": {
        "type": "stdio"
      }
    }
  ]
}

验证

MCPB 包 URL(server.json 中的 identifier必须包含字符串 “mcp”。这可以是 .mcpb 文件扩展名的一部分,也可以是存储库名称的一部分。 server.json 中的包元数据必须包含一个 fileSha256 属性,其中包含 MCPB 工件的 SHA-256 哈希值,可以使用 openssl 命令计算:
openssl dgst -sha256 image-processor.mcpb
MCP 注册表不验证此哈希;但是,MCP 客户端在安装前验证哈希以确保文件完整性。下游注册表也可能实施自己的验证。