> ## Documentation Index
> Fetch the complete documentation index at: https://mcp.developerdoc.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP 注册表聚合器

<Note>
  MCP 注册表目前处于预览阶段。正式可用前可能发生破坏性变更或数据重置。如果遇到问题，请在 [GitHub](https://github.com/modelcontextprotocol/registry/issues) 上反馈。
</Note>

聚合器是 MCP 注册表的下游消费者，会在注册表数据之上提供额外价值。例如，服务器市场可以提供用户评分和安全扫描。

MCP 注册表提供无需认证的只读 REST API，聚合器可以用它填充自己的数据存储。聚合器应以固定但不频繁的节奏抓取数据（例如每小时一次），并将数据持久化到自己的数据存储中。MCP 注册表**不保证可用时间或数据持久性**。

## 使用 MCP 注册表 REST API

MCP 注册表 REST API 的基础 URL 是 `https://registry.modelcontextprotocol.io`。它支持以下端点：

* [`GET /v0.1/servers`](https://registry.modelcontextprotocol.io/docs#/operations/list-servers-v0.1) — 列出所有服务器。
* [`GET /v0.1/servers/{serverName}/versions`](https://registry.modelcontextprotocol.io/docs#/operations/get-server-versions-v0.1) — 列出某个服务器的所有版本。
* [`GET /v0.1/servers/{serverName}/versions/{version}`](https://registry.modelcontextprotocol.io/docs#/operations/get-server-version-v0.1) — 获取某个服务器的特定版本。使用特殊版本 `latest` 可获取该服务器的最新版本。

<Warning>
  `serverName` 和 `version` 等 URL 路径参数**必须**进行 URL 编码。例如，`io.modelcontextprotocol/everything` 必须编码为 `io.modelcontextprotocol%2Feverything`。
</Warning>

聚合器最常抓取的通常是 `GET /v0.1/servers` 端点。

### 分页

`GET /v0.1/servers` 端点支持基于游标的分页。

例如，可以使用 `limit` 查询参数获取第一页：

```bash theme={null}
curl "https://registry.modelcontextprotocol.io/v0.1/servers?limit=100"
```

```jsonc Output highlight={5} theme={null}
{
  "servers": [
    /* ... */
  ],
  "metadata": {
    "count": 100,
    "nextCursor": "com.example/my-server:1.0.0",
  },
}
```

之后可以将 `nextCursor` 的值作为 `cursor` 查询参数传入，以获取后续页面：

```bash theme={null}
curl "https://registry.modelcontextprotocol.io/v0.1/servers?limit=100&cursor=com.example/my-server:1.0.0"
```

### 按更新时间过滤

`GET /v0.1/servers` 端点支持按给定时间戳过滤之后更新过的服务器。

例如，可以使用 [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339) 日期时间格式的 `updated_since` 查询参数，获取自 2025-10-23 以来更新过的服务器：

```bash theme={null}
curl "https://registry.modelcontextprotocol.io/v0.1/servers?updated_since=2025-10-23T00:00:00.000Z"
```

## 服务器状态

服务器元数据通常不可变，只有 `status` 字段可能更新，例如更新为 `"deprecated"` 或 `"deleted"`。建议聚合器保持其副本中每个服务器的 `status` 为最新状态。

`"deleted"` 状态通常表示某个服务器违反了宽松的[审核政策](./moderation-policy)，可能是垃圾内容、恶意软件或非法内容。聚合器可以选择将这些服务器从索引中移除。

## 作为子注册表运行

子注册表是一类同时实现 MCP 注册表定义的 [OpenAPI 规范](https://github.com/modelcontextprotocol/registry/blob/main/docs/reference/api/openapi.yaml)的聚合器。这使 MCP host 应用等客户端能够通过标准化接口消费服务器元数据。

子注册表 OpenAPI 规范允许子注册表通过 `_meta` 字段注入自定义元数据。例如，子注册表可以注入用户评分、下载次数和安全扫描结果：

```json server.json highlight={17-26} theme={null}
{
  "$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"
      }
    }
  ],
  "_meta": {
    "com.example.subregistry/custom": {
      "user_rating": 4.5,
      "download_count": 12345,
      "security_scan": {
        "last_scanned": "2025-10-23T12:00:00Z",
        "vulnerabilities_found": 0
      }
    }
  }
}
```

建议将自定义元数据放在能够反映该子注册表身份的键下（例如上例中的 `"com.example.subregistry/custom"`）。
