> ## 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.

# 关键变更

<div id="enable-section-numbers" />

本文档列出自上一版 [2025-11-25](/specification/2025-11-25) 以来对
Model Context Protocol (MCP) 规范所做的变更。

## 主要变更

1. 从 Streamable HTTP 传输中移除协议层会话和 `Mcp-Session-Id` 头。列表端点（`tools/list`、`resources/list`、`prompts/list`）不再按连接变化。需要跨调用状态的服务器使用由服务器生成的显式句柄，并将其作为普通工具参数传递（[SEP-2567](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2567)）。

2. 使 MCP 无状态：移除 `initialize`/`notifications/initialized` 握手。现在每个请求都在 `_meta` 中携带其协议版本、客户端身份和客户端能力（`io.modelcontextprotocol/protocolVersion`、`io.modelcontextprotocol/clientInfo`、`io.modelcontextprotocol/clientCapabilities`）。版本不匹配会返回 `UnsupportedProtocolVersionError`（[SEP-2575](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2575)）。

3. 添加 `server/discover`：服务器 MUST 实现此 RPC，以声明其支持的协议版本、能力和身份。客户端 MAY 在任何其他请求之前调用它以预先选择版本，或将其作为 STDIO 上的向后兼容探测（[SEP-2575](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2575)）。

4. 用 `subscriptions/listen` 替代 HTTP GET 端点以及 `resources/subscribe`/`resources/unsubscribe`：这是一个单一的长生命周期 POST 响应流，用于选择加入的服务器到客户端变更通知。客户端选择加入特定类型（`toolsListChanged`、`promptsListChanged`、`resourcesListChanged`、`resourceSubscriptions`）；服务器确认订阅，并使用 `io.modelcontextprotocol/subscriptionId` 标记通知。请求作用域的通知（例如 `notifications/progress` 和 `notifications/message`）继续在其相关请求的响应流上传递，而不是在 `subscriptions/listen` 流上传递（[SEP-2575](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2575)）。

5. 移除 `ping`、`logging/setLevel` 和 `notifications/roots/list_changed`。现在日志级别通过 `_meta` 中的 `io.modelcontextprotocol/logLevel` 按请求设置；对于未包含此字段的请求，服务器 MUST NOT 发出 `notifications/message`（[SEP-2575](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2575)）。

6. 将实验性任务从核心协议移出，放入官方扩展（`io.modelcontextprotocol/tasks`）。重新设计的扩展用通过 `tasks/get` 轮询以及用于客户端到服务器输入的新 `tasks/update` 替代阻塞式 `tasks/result` 方法，移除 `tasks/list`，并允许服务器在未按请求选择加入的情况下主动返回任务句柄（[SEP-2663](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2663)）。

7. 引入多轮往返请求（Multi Round-Trip Requests，MRTR）模式，用来替代以前发送服务器发起请求的做法，例如 `roots/list`、`sampling/createMessage` 或 `elicitation/create`。服务器返回 `inputRequests`，这是一种新的 `resultType`，包含处理该请求所需的额外信息。客户端在下一次请求中用 `inputResponses` 提供所请求的信息。（[SEP-2322](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2322)）。

## 次要变更

1. 向 `ClientCapabilities` 和 `ServerCapabilities` 添加 `extensions` 字段，以支持核心协议之外的可选[扩展](/docs/extensions/overview)。
2. 记录 `_meta` 键（`traceparent`、`tracestate`、`baggage`）的 OpenTelemetry trace context 传播约定（[SEP-414](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/414)）。
3. 服务器 **SHOULD** 以确定性顺序从 `tools/list` 返回工具，以支持客户端缓存并提高 LLM 提示缓存命中率。
4. 要求 Streamable HTTP POST 请求携带标准 MCP 请求头（`Mcp-Method`、`Mcp-Name`），并添加通过工具参数中的 `x-mcp-header` 支持自定义头的能力（[SEP-2243](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2243)）。
5. 通过新的 `CacheableResult` 接口，要求 `tools/list`、`prompts/list`、`resources/list`、`resources/read` 和 `resources/templates/list` 返回的结果包含 `ttlMs` 和 `cacheScope` 字段。`ttlMs` 是新鲜度提示（以毫秒为单位），允许客户端缓存响应并减少轮询；`cacheScope`（`"public"` 或 `"private"`）控制共享中介是否可以缓存响应。这两个字段补充现有的 `listChanged` 通知（[SEP-2549](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2549)）。
6. 将资源未找到错误码从 `-32002` 改为 `-32602`（Invalid Params），以与 JSON-RPC 规范保持一致。
7. 授权服务器 **SHOULD** 按
   [RFC 9207](https://datatracker.ietf.org/doc/html/rfc9207) 在授权响应中包含 `iss` 参数，并且 MCP 客户端 **MUST** 在兑换授权码之前，根据记录的签发者校验出现的 `iss`
   （[SEP-2468](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2468)）。
8. 要求 MCP 客户端在动态客户端注册期间指定适当的 `application_type`，以避免 OpenID Connect 重定向 URI 冲突
   （[SEP-837](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/837)）。
9. 明确客户端凭据绑定到签发它们的授权服务器：
   客户端 **MUST** 按签发者标识符为持久化凭据建立键，**MUST NOT** 将它们复用于不同的授权服务器，并且当授权服务器变化时 **MUST** 重新注册（[SEP-2352](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2352)）。
10. 放宽 `inputSchema` 和 `outputSchema`，允许任何 JSON Schema 2020-12 关键字，并放宽
    `structuredContent`，允许任何 JSON 值。添加 `$ref` 解析要求和组合关键字资源边界
    （[SEP-2106](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2106)）。

## 已弃用

此处列出的特性仍是规范的一部分，但已根据[特性生命周期和弃用政策](/community/feature-lifecycle)计划移除。新实现不应采用它们。[已弃用特性注册表](/specification/draft/deprecated)跟踪当前处于 Deprecated 状态的所有特性。

1. 弃用根目录、采样和日志特性
   ([SEP-2577](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2577))。
   这些特性在弃用窗口期内仍保持完整功能，但新实现不应再添加对它们的支持。建议迁移：
   使用工具参数、资源 URI 或服务器配置传递目录或文件，而不是使用根目录；直接集成
   LLM 提供商 API，而不是使用采样；将日志写入 `stderr`（stdio）或使用 OpenTelemetry，
   而不是使用日志特性。

2. 根据特性生命周期政策，将 HTTP+SSE 传输（自协议版本
   `2025-03-26` 起弃用）重新分类为 Deprecated
   ([SEP-2596](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2596))。
   迁移到 [Streamable HTTP](/specification/draft/basic/transports/streamable-http)。

3. 将 `includeContext` 值 `"thisServer"` 和 `"allServers"`
   （自协议版本 `2025-11-25` 起软弃用）重新分类为 Deprecated
   ([SEP-2596](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2596))。
   省略该字段或使用 `"none"`；这些值最迟会与采样特性本身一起移除。

4. 弃用作为客户端注册机制的 OAuth 2.0 动态客户端注册协议
   ([RFC7591](https://datatracker.ietf.org/doc/html/rfc7591))，改为推荐
   [客户端 ID 元数据文档](/specification/draft/basic/authorization/client-registration#client-id-metadata-documents)
   ([PR #2858](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2858))。
   为了向后兼容不支持客户端 ID 元数据文档的授权服务器，它仍然可用。

## 其他 schema 变更

1. `schema.json` 现在正确反映 TypeScript 中 minimum/maximum/default 的定义是 `number`，而不只是 `integer`。此前的问题是使用 `--defaultNumberType integer` 运行生成器导致的（[PR#2710](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2710)）。

## 治理和流程更新

1. 采用规范的
   [特性生命周期和弃用政策](/community/feature-lifecycle)，定义 Active、Deprecated 和 Removed 特性状态、至少十二个月的弃用窗口，以及
   [已弃用特性注册表](/specification/draft/deprecated)
   ([SEP-2596](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2596))。

## 流程变更

1. 正式化基于 PR 的 SEP 工作流，包括 `seps/` 目录中的 markdown 文件、从 PR 派生的编号、发起人职责，以及通过 PR 标签进行状态管理（[SEP-1850](https://github.com/modelcontextprotocol/specification/pull/1850)）。

## 完整变更日志

如需查看自上一协议版本以来所有变更的完整列表，
请[参见 GitHub](https://github.com/modelcontextprotocol/specification/compare/2025-11-25...draft)。
