wellworn
traps · 4 served

MCP TypeScript SDK

@modelcontextprotocol/sdk · latest 1.30.0 · MIT

Official MCP server and client SDK; 1.x is the mature line.

symptom and fix
major · >=1.0.0 <2.0.0 · published · verified 2026-09-08
Upgrading to v2 by bumping the version fails, because there is no 2.x of this package.
v2 ships as separate packages, @modelcontextprotocol/client and @modelcontextprotocol/server, not as a major of @modelcontextprotocol/sdk. Install the new package and follow the v2 upgrade guide; 1.x keeps getting bug and security fixes for at least six months after the v2 release.
evidence
major · >=1.25.0 <2.0.0 · published · verified 2026-09-08
registerTool inputSchema written as z.object(...) is accepted by TypeScript but tools/list shows an empty schema.
In 1.x pass the raw zod shape `{ a: z.string() }` as `inputSchema`, not `z.object({...})`; the object form is the v2 API.
minor · >=1.0.0 · published · verified 2026-09-08
A client written for an SSE endpoint cannot connect to a server built this year.
The 2026-07-28 spec defines two standard bindings, stdio and Streamable HTTP, where each message is an HTTP POST to one endpoint and replies come back as JSON or a request-scoped SSE stream. Point the client at the single MCP endpoint with the Streamable HTTP transport rather than an /sse path.
evidence
minor · >=1.25.0 <2.0.0 · published · verified 2026-09-08
The SDK imports zod/v4 internally; a project on zod 3.24 or older fails at import.
Install zod ^3.25 (which ships zod/v3 and zod/v4 entry points) or zod ^4.

Sorted by severity. Your agent sees the subset that matches the version you have installed: traps(library: "modelcontextprotocol-sdk", version: "1.30.0").