diff --git a/.changeset/drop-zod-peer-dep.md b/.changeset/drop-zod-peer-dep.md new file mode 100644 index 000000000..c5e283274 --- /dev/null +++ b/.changeset/drop-zod-peer-dep.md @@ -0,0 +1,9 @@ +--- +'@modelcontextprotocol/client': patch +'@modelcontextprotocol/server': patch +--- + +Drop `zod` from `peerDependencies` (kept as direct dependency) + +Since Standard Schema support landed, `zod` is purely an internal runtime dependency used for protocol message parsing. User-facing schemas (`registerTool`, `registerPrompt`) accept any Standard Schema library. `zod` remains in `dependencies` and auto-installs; users no longer +need to install it alongside the SDK. diff --git a/README.md b/README.md index f068ec915..d32d61810 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ This monorepo publishes split packages: - **`@modelcontextprotocol/server`**: build MCP servers - **`@modelcontextprotocol/client`**: build MCP clients -Both packages have a **required peer dependency** on `zod` for schema validation. The SDK uses Zod v4. +Tool and prompt schemas use [Standard Schema](https://standardschema.dev/) — bring Zod v4, Valibot, ArkType, or any compatible library. ### Middleware packages (optional) @@ -56,21 +56,21 @@ They are intentionally thin adapters: they should not introduce new MCP function ### Server ```bash -npm install @modelcontextprotocol/server zod +npm install @modelcontextprotocol/server # or -bun add @modelcontextprotocol/server zod +bun add @modelcontextprotocol/server # or -deno add npm:@modelcontextprotocol/server npm:zod +deno add npm:@modelcontextprotocol/server ``` ### Client ```bash -npm install @modelcontextprotocol/client zod +npm install @modelcontextprotocol/client # or -bun add @modelcontextprotocol/client zod +bun add @modelcontextprotocol/client # or -deno add npm:@modelcontextprotocol/client npm:zod +deno add npm:@modelcontextprotocol/client ``` ### Optional middleware packages @@ -157,7 +157,8 @@ The `docs:multi` script checks out both the `v1.x` and `main` branches via git w ## v1 (legacy) documentation and fixes -If you are using the **v1** generation of the SDK, the **v1 API documentation** is available at [`https://ts.sdk.modelcontextprotocol.io/`](https://ts.sdk.modelcontextprotocol.io/). The v1 source code and any v1-specific fixes live on the long-lived [`v1.x` branch](https://github.com/modelcontextprotocol/typescript-sdk/tree/v1.x). V2 API docs are at [`/v2/`](https://ts.sdk.modelcontextprotocol.io/v2/). +If you are using the **v1** generation of the SDK, the **v1 API documentation** is available at [`https://ts.sdk.modelcontextprotocol.io/`](https://ts.sdk.modelcontextprotocol.io/). The v1 source code and any v1-specific fixes live on the long-lived +[`v1.x` branch](https://github.com/modelcontextprotocol/typescript-sdk/tree/v1.x). V2 API docs are at [`/v2/`](https://ts.sdk.modelcontextprotocol.io/v2/). ## Contributing diff --git a/packages/client/package.json b/packages/client/package.json index e205903b8..a8f5b051b 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -68,15 +68,11 @@ "zod": "catalog:runtimeShared" }, "peerDependencies": { - "@cfworker/json-schema": "catalog:runtimeShared", - "zod": "catalog:runtimeShared" + "@cfworker/json-schema": "catalog:runtimeShared" }, "peerDependenciesMeta": { "@cfworker/json-schema": { "optional": true - }, - "zod": { - "optional": false } }, "devDependencies": { diff --git a/packages/server/package.json b/packages/server/package.json index 92eab267d..043585e1f 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -63,15 +63,11 @@ "zod": "catalog:runtimeShared" }, "peerDependencies": { - "@cfworker/json-schema": "catalog:runtimeShared", - "zod": "catalog:runtimeShared" + "@cfworker/json-schema": "catalog:runtimeShared" }, "peerDependenciesMeta": { "@cfworker/json-schema": { "optional": true - }, - "zod": { - "optional": false } }, "devDependencies": {