MCP TypeScript SDK 2.4.0 adds Skills support and strict header validation
MCP TypeScript SDK 2.4.0 introduces Skills over MCP, rejects x-mcp-header on number parameters, and updates outputSchema handling for 2025-11-25 connections.
The Model Context Protocol TypeScript SDK releases version 2.4.0, introducing Skills support and enforcing strict header validation. This update modifies how servers handle specific parameter annotations and changes the structure of output schema results for recent protocol revisions.
The new Skills over MCP feature allows servers to publish skill folders using the loadSkills and skills.attach methods. Clients interact with these skills through the new SkillsClient class, which supports listing, reading, and verifying skills. This client implementation supports both the 2025-11-25 and 2026-07-28 protocol revisions.
Strict header validation now rejects the x-mcp-header annotation on number parameters. Developers must use z.int() or remove the annotation to avoid errors. When a client calls a tool with an invalid x-mcp-header on a number parameter, servers respond with error code -32020. Additionally, the bundled Ajv validator now uses fast-uri 3.1.8, which rejects $id or $ref values containing invalid URI schemes.
For connections using the 2025-11-25 revision, outputSchema results from z.object(...).meta({ id }) are no longer wrapped in a result object. Developers must read structuredContent directly instead of accessing structuredContent.result for these specific schema definitions. The ServerEvent class now accepts optional params, enabling gateways to forward change notifications with their _meta data. The createMcpHandler function also sends an Allow: POST header on every 405 response.
- Packages
@modelcontextprotocol/client,server,core,server-legacy, andcodemodupdate to version 2.4.0. - The
@modelcontextprotocol/nodepackage updates to version 2.1.2, whileexpress,hono, andfastifypackages remain unchanged. - An opt-in
scopeparameter for token refresh is available via thescopeForRefreshmethod onOAuthClientProvider. - The
@modelcontextprotocol/nodepackage accepts@hono/node-serverversions 1.x or 2.x, with new installs resolving to 2.x.