Skip to content

Commit fcde488

Browse files
chore: drop zod from peerDependencies (kept as direct dependency) (modelcontextprotocol#1824)
Co-authored-by: Konstantin Konstantinov <KKonstantinov@users.noreply.github.com>
1 parent 89fb094 commit fcde488

File tree

4 files changed

+20
-18
lines changed

4 files changed

+20
-18
lines changed

.changeset/drop-zod-peer-dep.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
'@modelcontextprotocol/client': patch
3+
'@modelcontextprotocol/server': patch
4+
---
5+
6+
Drop `zod` from `peerDependencies` (kept as direct dependency)
7+
8+
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
9+
need to install it alongside the SDK.

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ This monorepo publishes split packages:
3939
- **`@modelcontextprotocol/server`**: build MCP servers
4040
- **`@modelcontextprotocol/client`**: build MCP clients
4141

42-
Both packages have a **required peer dependency** on `zod` for schema validation. The SDK uses Zod v4.
42+
Tool and prompt schemas use [Standard Schema](https://standardschema.dev/) — bring Zod v4, Valibot, ArkType, or any compatible library.
4343

4444
### Middleware packages (optional)
4545

@@ -56,21 +56,21 @@ They are intentionally thin adapters: they should not introduce new MCP function
5656
### Server
5757

5858
```bash
59-
npm install @modelcontextprotocol/server zod
59+
npm install @modelcontextprotocol/server
6060
# or
61-
bun add @modelcontextprotocol/server zod
61+
bun add @modelcontextprotocol/server
6262
# or
63-
deno add npm:@modelcontextprotocol/server npm:zod
63+
deno add npm:@modelcontextprotocol/server
6464
```
6565

6666
### Client
6767

6868
```bash
69-
npm install @modelcontextprotocol/client zod
69+
npm install @modelcontextprotocol/client
7070
# or
71-
bun add @modelcontextprotocol/client zod
71+
bun add @modelcontextprotocol/client
7272
# or
73-
deno add npm:@modelcontextprotocol/client npm:zod
73+
deno add npm:@modelcontextprotocol/client
7474
```
7575

7676
### Optional middleware packages
@@ -157,7 +157,8 @@ The `docs:multi` script checks out both the `v1.x` and `main` branches via git w
157157

158158
## v1 (legacy) documentation and fixes
159159

160-
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/).
160+
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
161+
[`v1.x` branch](https://github.com/modelcontextprotocol/typescript-sdk/tree/v1.x). V2 API docs are at [`/v2/`](https://ts.sdk.modelcontextprotocol.io/v2/).
161162

162163
## Contributing
163164

packages/client/package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,11 @@
6868
"zod": "catalog:runtimeShared"
6969
},
7070
"peerDependencies": {
71-
"@cfworker/json-schema": "catalog:runtimeShared",
72-
"zod": "catalog:runtimeShared"
71+
"@cfworker/json-schema": "catalog:runtimeShared"
7372
},
7473
"peerDependenciesMeta": {
7574
"@cfworker/json-schema": {
7675
"optional": true
77-
},
78-
"zod": {
79-
"optional": false
8076
}
8177
},
8278
"devDependencies": {

packages/server/package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,11 @@
6363
"zod": "catalog:runtimeShared"
6464
},
6565
"peerDependencies": {
66-
"@cfworker/json-schema": "catalog:runtimeShared",
67-
"zod": "catalog:runtimeShared"
66+
"@cfworker/json-schema": "catalog:runtimeShared"
6867
},
6968
"peerDependenciesMeta": {
7069
"@cfworker/json-schema": {
7170
"optional": true
72-
},
73-
"zod": {
74-
"optional": false
7571
}
7672
},
7773
"devDependencies": {

0 commit comments

Comments
 (0)