AI 研究助理

基于站内最新资料,回答 AI 前沿问题

回答带出处引用,支持多轮追问,当前页面内容会作为上下文

快速响应
AI 前沿跟踪
今日首页重点内容GitHub 趋势榜
领域
学术研究
大模型
具身智能
AI 基础设施
智能体 · Skill · MCP
机器人
多模态
自动驾驶
数据 / MLOps
AI 硬件
安全对齐
综述与报告
发布智能体 · Skill · MCP重点★ 重点来源MCPAgent SkillsSEP-2640TypeScript

typescript-sdk 2.4.0

查看发布页
AI 解读已生成 · AI 生成,数字以原文为准
AI 全文总结值得深入基于版本说明 2115 字 · 完整阅读

TypeScript SDK 2.4.0 发布 Skills over MCP,升级需处理 三处 行为变更。

TypeScript SDK 发布 2.4.0,client/server/core/server-legacy/codemod 同步更新,node 为 2.1.2。升级注意:数字参数上的 x-mcp-header 按 2026-07-28 规范被拒绝,客户端不列出该工具、服务端返回 -32020,需改用 z.int() 或移除注解;旧版连接上 outputSchema 结果不再包在 { result } 中,读 structuredContent;内置 Ajv 拒绝非法 URI scheme 的 $id/$ref(如 my_tool:output)。新增 SEP-2640 Skills over MCP:服务端用 loadSkills(folder) 与 skills.attach(server) 发布技能,客户端用 SkillsClient 列出、读取并验证;OAuth 刷新可选 scopeForRefresh(tokens) 应对 Microsoft Entra ID 缺 scope 的拒绝;ServerEvent 可带 params 转发 _meta,v1→v2 升级指南成为可安装 skill。修复包括 update({ title }) 出现在列表、现代 revision 不再误答错误码、错误响应补发 Allow: POST、node 兼容新版 @hono/node-server。

  1. 1新增 Skills over MCP,支持两个协议版本。
  2. 2升级有三处行为变更,可能弄坏现有工具调用。
  3. 3OAuth 刷新新增 opt-in scope,默认请求不变。

为什么重要 MCP 服务端/客户端开发者需评估:新增技能能力可按 SEP-2640 接入,但三处升级变更会直接影响工具列出、结构化输出与校验。适合 MCP TypeScript 服务端/客户端开发者,需评估升级影响。

版本v2.4.0
技能SEP-2640
协议2025-11-25/2026-07-28
升级注意3 项行为变更
node 包2.1.2
来源
github.com
发布
2026/10/24
作者
modelcontextprotocol

破坏性变更3 项

  • 数字参数上的 x-mcp-header 被拒绝:客户端不列出该工具,服务端返回 -32020。
  • z.object(...).meta({ id }) 的 outputSchema 在 2025-11-25 连接上不再包裹 { result }。
  • bundled Ajv 使用 fast-uri 3.1.8,拒绝非法 URI scheme(如 my_tool:output)。

新增4 项

  • 新增 Skills over MCP (SEP-2640):服务端 loadSkills(folder) + skills.attach(server),客户端 SkillsClient,支持 2025-11-25 与 2026-07-28。
  • OAuth 刷新新增 opt-in scopeForRefresh(tokens),适用于 Entra ID AADSTS90009,默认请求不变。
  • ServerEvent 增加可选 params,网关可转发带 _meta 的变更通知。
  • v1→v2 升级指南打包为可安装 agent skill。

修复4 项

  • update({ title }) 后 resource/resource template 在 list 响应中可见。
  • Server 在 per-request transport 现代 revision 绑定该 revision,不再返回 -32022。
  • createMcpHandler 在每个 405 上返回 Allow: POST。
  • @modelcontextprotocol/node 接受 @hono/node-server 1.x 或 2.x,新装解析 2.x。

中文(AI 翻译)

包名版本
@modelcontextprotocol/client2.4.0
@modelcontextprotocol/server2.4.0
@modelcontextprotocol/core2.4.0
@modelcontextprotocol/server-legacy2.4.0
@modelcontextprotocol/codemod2.4.0
@modelcontextprotocol/node2.1.2
@modelcontextprotocol/express、hono、fastify不变

升级说明

  • number 参数上的 x-mcp-header 会被拒绝,这是 2026-07-28 规范的要求:客户端不会列出此类工具,服务器对其调用会返回 -32020。请改用 z.int() 或移除该注解。(#2762, #2960)
  • 来自 z.object(...).meta({ id }) 的 outputSchema。 在 2025-11-25 连接上,结果不再包裹在 { result } 里:应读取 structuredContent,而不是 structuredContent.result。(#3081)
  • 内置的 Ajv 校验器使用了 fast-uri 3.1.8。 它会拒绝带有无效 URI scheme 的 $id 或 $ref,例如 my_tool:output。(#3083)

新增

  • Skills over MCP(SEP-2640)。 服务器可通过 loadSkills(folder) 和 skills.attach(server) 发布一个技能文件夹;客户端可用 SkillsClient 列出、读取并校验这些技能。它在 2025-11-25 和 2026-07-28 上均可工作。attach 是实验性的,可能在次要版本中发生变化。(#3047, #3080)
  • 令牌刷新时的可选 scope。 若授权服务器拒绝不带 scope 的刷新请求(Microsoft Entra ID,AADSTS90009),可在你的 OAuthClientProvider 上实现 scopeForRefresh(tokens)。

原文

PackageVersion
@modelcontextprotocol/client2.4.0
@modelcontextprotocol/server2.4.0
@modelcontextprotocol/core2.4.0
@modelcontextprotocol/server-legacy2.4.0
@modelcontextprotocol/codemod2.4.0
@modelcontextprotocol/node2.1.2
@modelcontextprotocol/express, hono, fastifyunchanged

Upgrade notes

  • x-mcp-header on a number parameter is rejected, as the 2026-07-28 spec requires: the client does not list such a tool, and the server answers a call to it with -32020. Use z.int() or remove the annotation. (#2762, #2960)
  • outputSchema from z.object(...).meta({ id }). On a 2025-11-25 connection the result is no longer wrapped in { result }: read structuredContent, not structuredContent.result. (#3081)
  • The bundled Ajv validator uses fast-uri 3.1.8. It rejects a $id or $ref with an invalid URI scheme, such as my_tool:output. (#3083)

New

  • Skills over MCP (SEP-2640). A server publishes a folder of skills with loadSkills(folder) and skills.attach(server); a client lists, reads and verifies them with SkillsClient. It works on 2025-11-25 and 2026-07-28. attach is experimental and may change in a minor release. (#3047, #3080)
  • Opt-in scope on token refresh. Implement scopeForRefresh(tokens) on your OAuthClientProvider for an authorization server that rejects a refresh without scope (Microsoft Entra ID, AADSTS90009). The default request doe…

深度总结

1 / 8
2.4.0
版本矩阵· 表格

2.4.0 覆盖 client/server/core/server-legacy/codemod 五包;node 停在 2.1.2,HTTP 集成包未

包版本
@modelcontextprotocol/client2.4.0
@modelcontextprotocol/server2.4.0
@modelcontextprotocol/core2.4.0
@modelcontextprotocol/server-legacy2.4.0
@modelcontextprotocol/codemod2.4.0
@modelcontextprotocol/node2.1.2
@modelcontextprotocol/express, hono, fastifyunchanged

注释 · Express/Hono/Fastify 三个适配器不变;升级时只需关注五个核心包与 node。出自 发布说明·版本表格