Skip to content

Commit 8acd838

Browse files
authored
docs: update installation instructions for zod peer dependency (modelcontextprotocol#1139)
1 parent 8eb2bea commit 8acd838

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,11 @@ The Model Context Protocol allows applications to provide context for LLMs in a
4747
## Installation
4848

4949
```bash
50-
npm install @modelcontextprotocol/sdk
50+
npm install @modelcontextprotocol/sdk zod
5151
```
5252

53+
This SDK has a **required peer dependency** on `zod` for schema validation. The SDK internally imports from `zod/v4`, but maintains backwards compatibility with projects using Zod v3.25 or later. You can use either API in your code by importing from `zod/v3` or `zod/v4`:
54+
5355
## Quick Start
5456

5557
Let's create a simple MCP server that exposes a calculator tool and some data. Save the following as `server.ts`:
@@ -130,7 +132,7 @@ app.listen(port, () => {
130132
});
131133
```
132134

133-
Install the deps with `npm install @modelcontextprotocol/sdk express zod@3`, and run with `npx -y tsx server.ts`.
135+
Install the deps with `npm install @modelcontextprotocol/sdk express zod`, and run with `npx -y tsx server.ts`.
134136

135137
You can connect to it using any MCP client that supports streamable http, such as:
136138

0 commit comments

Comments
 (0)