@modelcontextprotocol/node@2.0.0
MCP Node SDK v2.0.0 released with support for the MCP 2026-07-28 spec, dual ESM/CommonJS builds, strict Content-Type checking, and updated security documentation.
原始内容为英文;当前页面提供中文导航与来源说明,具体事实请以原文为准。
为什么值得关注
@modelcontextprotocol/node@2.0.0 introduces the first beta release of SDK v2 supporting the MCP 2026-07-28 specification revision. The release ships CommonJS builds alongside ESM using dual .mjs/.cjs and .d.mts/.d.cts outputs with require conditions. Inbound POST requests without an application/json media type are now strictly parsed and rejected with 415 Unsupported Media Type, supported by the newly exported isJsonContentType(header) helper. Additionally, documentation has been updated to cover host and origin validation guards when wiring node:http servers.
可执行摘要
Release @modelcontextprotocol/node@2.0.0 adds MCP 2026-07-28 specification support, dual ESM/CJS exports (.mjs/.cjs), and stricter Content-Type validation returning 415 for non-application/json POST requests via the new isJsonContentType helper.
- Agent 实用度
- 82/100
- 可信度
- 96%
- 机器格式
- JSON + Markdown
开发者应核对什么
- Review migration guides (docs/migration/upgrade-to-v2.md and docs/migration/support-2026-07-28.md) for v2 breaking changes and new specification requirements.
- Ensure incoming HTTP POST requests send a valid Content-Type: application/json header to avoid 415 Unsupported Media Type responses.
- Transport or framework-adapter authors composing custom endpoints should apply the exported isJsonContentType(header) helper.
- Implement recommended host and origin validation guards before toNodeHandler for hand-wired node:http servers.