Skip to content

Commit b5af226

Browse files
cliffhallclaude
andcommitted
chore: migrate the TypeScript servers to TS SDK v2 (#4856)
Run @modelcontextprotocol/codemod v1-to-v2 (2.3.1) on everything, filesystem, memory and sequentialthinking, and finish what it leaves: - Manifests: drop @modelcontextprotocol/sdk; depend on @modelcontextprotocol/server (plus node and server-legacy in everything), with client (and core, for everything's skipped task tests) as devDependencies; zod ^4.2.0; engines node >=20. The root devDependency for the boot smoke moves to @modelcontextprotocol/client. - everything: wrap the three raw-shape prompt argsSchemas in z.object(); drop the result schemas from ctx.mcpReq.send(); keep HTTP+SSE on the frozen server-legacy bridge. - Experimental tasks are gone in v2 (SEP-2663): remove simulate-research-query and the two trigger-*-async tools and the tasks capability, pending #4852. Their tests stay, skipped, behind typed stand-ins for the removed v1 surface. - Re-baseline the Part 1 (#4854) assertions that SDK v2's documented wire changes move: unknown tools reject with -32602, the "MCP error <code>: " prefix is gone, validation issues read "field: message", tool schemas declare JSON Schema 2020-12, tools no longer advertise execution.taskSupport, and the resource-not-found message reads "Resource not found: <uri>". - Docs, skills and the smoke script follow; one major changeset per server records the breaking changes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: cliffhall <[email protected]>
1 parent b5cea9d commit b5af226

88 files changed

Lines changed: 674 additions & 1695 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.changeset/everything-sdk-v2.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@modelcontextprotocol/server-everything": major
3+
---
4+
5+
Move to the TypeScript SDK v2 packages (`@modelcontextprotocol/server`, `@modelcontextprotocol/node`, and `@modelcontextprotocol/server-legacy` for the deprecated HTTP+SSE transport) from `@modelcontextprotocol/sdk` 1.x (#4856). The task tools `simulate-research-query`, `trigger-sampling-request-async` and `trigger-elicitation-request-async` are removed, and the server no longer advertises the `tasks` capability, because SDK v2 dropped the experimental tasks layer they were built on; they return on the tasks extension in #4852. Breaking for clients: the server now requires Node.js 20 or later; an unknown tool name is rejected with JSON-RPC error `-32602` instead of returning an `isError` result; error messages no longer carry the `MCP error <code>: ` prefix, and input-validation messages name the field first (`field: message`); tool schemas in `tools/list` declare JSON Schema 2020-12 instead of draft-07; and tools no longer advertise `execution.taskSupport`. The optional `state` argument of `args-prompt` now carries its description.

‎.changeset/filesystem-sdk-v2.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@modelcontextprotocol/server-filesystem": major
3+
---
4+
5+
Move to the TypeScript SDK v2 packages (`@modelcontextprotocol/server`) from `@modelcontextprotocol/sdk` 1.x (#4856). Breaking for clients: the server now requires Node.js 20 or later; an unknown tool name is rejected with JSON-RPC error `-32602` instead of returning an `isError` result; error messages no longer carry the `MCP error <code>: ` prefix, and input-validation messages name the field first (`field: message`); and tools no longer advertise `execution.taskSupport`.

‎.changeset/memory-sdk-v2.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@modelcontextprotocol/server-memory": major
3+
---
4+
5+
Move to the TypeScript SDK v2 packages (`@modelcontextprotocol/server`) from `@modelcontextprotocol/sdk` 1.x (#4856). Breaking for clients: the server now requires Node.js 20 or later; an unknown tool name is rejected with JSON-RPC error `-32602` instead of returning an `isError` result; error messages no longer carry the `MCP error <code>: ` prefix, and input-validation messages name the field first (`field: message`); tool schemas in `tools/list` declare JSON Schema 2020-12 instead of draft-07; and tools no longer advertise `execution.taskSupport`.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@modelcontextprotocol/server-sequential-thinking": major
3+
---
4+
5+
Move to the TypeScript SDK v2 packages (`@modelcontextprotocol/server`) from `@modelcontextprotocol/sdk` 1.x (#4856). Breaking for clients: the server now requires Node.js 20 or later; an unknown tool name is rejected with JSON-RPC error `-32602` instead of returning an `isError` result; error messages no longer carry the `MCP error <code>: ` prefix, and input-validation messages name the field first (`field: message`); tool schemas in `tools/list` declare JSON Schema 2020-12 instead of draft-07; and tools no longer advertise `execution.taskSupport`.

‎.claude/skills/security-advisory/SKILL.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ this order:
140140
Servers listed in the README or the Registry are third-party; their reports
141141
go to their own maintainers.
142142
2. **Is the code path the server's, or an SDK's?** The TypeScript servers are
143-
built on `@modelcontextprotocol/sdk`
143+
built on the TypeScript SDK's v2 packages (`@modelcontextprotocol/server`,
144+
`@modelcontextprotocol/node` and the frozen `@modelcontextprotocol/server-legacy`)
144145
([typescript-sdk](https://github.com/modelcontextprotocol/typescript-sdk)),
145146
the Python servers on `mcp`
146147
([python-sdk](https://github.com/modelcontextprotocol/python-sdk)). Transport

‎.claude/skills/testing/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Each `connect` returns the `client` and a `close()`; call `close()` in
8383

8484
```ts
8585
import { afterEach, beforeEach, describe, expect, it } from "vitest";
86-
import type { Client } from "@modelcontextprotocol/sdk/client/index.js";
86+
import type { Client } from "@modelcontextprotocol/client";
8787
import { connect, contentOf, textOf, type Session } from "./harness.js";
8888

8989
describe("echo, over the protocol", () => {

0 commit comments

Comments
 (0)