@modelcontextprotocol/server@2.0.0
Release v2.0.0 of @modelcontextprotocol/server aligns the 2026 wire protocol with the final specification revision, extracts schema sources into @modelcontextprotocol/core, exports the Protocol class from the root, and adds runtime-neutral Bearer authentication and OAuth discovery handlers.
原始内容为英文;当前页面提供中文导航与来源说明,具体事实请以原文为准。
为什么值得关注
The 2.0.0 release of @modelcontextprotocol/server brings key architectural adjustments and wire-protocol alignment. Wire schemas for the 2026-07-28 version now conform to spec PR 3002: serverInfo moves from DiscoverResult.body to ResultMeta under 'io.modelcontextprotocol/serverInfo' (SERVER INFO META KEY), and clientInfo within RequestMetaEnvelope is demoted from required to optional. Schema sources and constants have been centralized into @modelcontextprotocol/core, standardizing runtime object identity across MCP packages. Additional enhancements include root exports of Protocol and mergeCapabilities, support for Standard Schema (e.g., Zod) in inputRequired.elicit() with restricted JSON Schema transformation, configurable SSE keep-alive comments in Streamable HTTP transports, preloadSchemas() for eager schema loading on isolate runtimes (enabled by default for Cloudflare Workers), and runtime-agnostic helpers for OAuth discovery (oauthMetadataResponse) and Bearer authentication (requireBearerAuth).
可执行摘要
@modelcontextprotocol/server@2.0.0 introduces breaking type updates aligning with spec PR 3002: DiscoverResult drops serverInfo from the body in favor of meta ('io.modelcontextprotocol/serverInfo'), and RequestMetaEnvelope.clientInfo becomes optional. Schemas now resolve via shared runtime dependency @modelcontextprotocol/core, standard schemas (e.g., Zod) are supported in inputRequired.elicit(), and runtime-neutral…
- Agent 实用度
- 82/100
- 可信度
- 96%
- 机器格式
- JSON + Markdown
开发者应核对什么
- Update type references: remove usage of DiscoverResult.serverInfo on the response body and access it via result meta key 'io.modelcontextprotocol/serverInfo'.
- Adjust client handshake logic to account for clientInfo in RequestMetaEnvelope being optional.
- Update imports of Protocol and mergeCapabilities to point directly to the @modelcontextprotocol/server package root instead of shared/protocol.js.
- Verify compatibility with @modelcontextprotocol/core as a shared dependency if consuming multiple MCP packages.