> ## Documentation Index
> Fetch the complete documentation index at: https://mcp.zhcndoc.com/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) 以来对模型上下文协议 (MCP) 规范所做的更改。

## 重大变更

1. 移除流式 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`：服务器必须实现此 RPC，以公布其支持的协议版本、能力和标识。客户端可以在任何其他请求之前调用它，以便提前选择版本；或者在 STDIO 上将其用作向后兼容探测 ([SEP-2575](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2575))。

4. 将 HTTP GET 端点以及 `resources/subscribe`/`resources/unsubscribe` 替换为 `subscriptions/listen`：为已选择接收的服务器到客户端变更通知提供单个长生命周期的 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` 按请求设置；对于未包含此字段的请求，服务器**不得**发送 `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`。服务器返回一个 `InputRequiredResult`（`resultType: "input_required"`），其 `inputRequests` 字段携带处理该请求所需的附加信息请求。客户端在重试原始请求时通过 `inputResponses` 响应，并提供所请求的信息。([SEP-2322](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2322))。

8. 现在所有结果都带有必需的 `resultType` 字段：普通结果为 `"complete"`，而 [multi round-trip request](/specification/draft/basic/patterns/mrtr) 的中间结果为 `"input_required"`。客户端**必须**将来自早期协议服务器且省略该字段的结果视为 `"complete"` ([SEP-2322](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2322))。

9. 从 Streamable HTTP 传输中移除 SSE 流恢复能力和消息重投递（`Last-Event-ID` 标头和 SSE 事件 ID）。响应流中断将丢失进行中的请求；客户端**必须**以新的请求 ID 重新发起一个新请求 ([SEP-2575](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2575))。

## 次要变更

1. 为 `ClientCapabilities` 和 `ServerCapabilities` 添加 `extensions` 字段，以支持核心协议之外的可选[扩展](/docs/extensions/overview)。
2. 记录 `_meta` 键（`traceparent`、`tracestate`、`baggage`）的 OpenTelemetry 跟踪上下文传播约定 ([SEP-414](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/414))。
3. 服务器**应当**以确定性顺序从 `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`（无效参数），以与 JSON-RPC 规范保持一致。
7. 授权服务器**应当**按 [RFC 9207](https://datatracker.ietf.org/doc/html/rfc9207) 在授权响应中包含 `iss` 参数，而 MCP 客户端**必须**在兑换授权码前，将收到的 `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. 明确客户端凭据与签发它们的授权服务器绑定：客户端**必须**按颁发者标识符对持久化凭据建立键，**不得**与其他授权服务器复用这些凭据，并且在授权服务器变更时**必须**重新注册 ([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))。
11. 移除 `notifications/elicitation/complete` 通知以及 URL 模式 elicitation 请求的 `elicitationId` 字段，这两者都引入于 `2025-11-25`。在
    [Multi Round-Trip Requests](/specification/draft/basic/patterns/mrtr) 模式下，客户端通过重试原始请求来了解带外交互的结果，因此服务器发起的完成信号——以及用于关联它的标识符——不再适合该协议。需要跨重试关联一次 elicitation 的服务器，应将自己的标识符编码到 `requestState` 中。
12. 定义一项[错误码分配策略](/specification/draft/basic/index#error-codes)，将 JSON-RPC 服务器错误范围进行划分：`-32000` 到 `-32019` 保持实现定义（现有 SDK 用法予以保留），`-32020` 到 `-32099` 保留给 MCP 规范。相应地重编号本草案中引入的错误码——`HeaderMismatch` `-32001` → `-32020`、`MissingRequiredClientCapability` `-32003` → `-32021`、`UnsupportedProtocolVersion` `-32004` → `-32022`——并将此前仅存在于传输说明中的 `HeaderMismatchError` 添加到 schema 中。

## 已弃用

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

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

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

3. 将 `includeContext` 值 `"thisServer"` 和 `"allServers"`
   （自协议版本 `2025-11-25` 起已软弃用）重新归类为“已弃用”
   ([SEP-2596](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2596))。
   省略该字段或使用 `"none"`；这些值最迟将在
   Sampling 功能本身移除时一并删除。

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

## 其他 schema 变更

1. `schema.json` 现在正确反映了 Typescript 定义中的 minimum/maximum/default 是 `number`，而不只是 `integers`。这由使用 `--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)。
