You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,9 +47,11 @@ The Model Context Protocol allows applications to provide context for LLMs in a
47
47
## Installation
48
48
49
49
```bash
50
-
npm install @modelcontextprotocol/sdk
50
+
npm install @modelcontextprotocol/sdk zod
51
51
```
52
52
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
+
53
55
## Quick Start
54
56
55
57
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, () => {
130
132
});
131
133
```
132
134
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`.
134
136
135
137
You can connect to it using any MCP client that supports streamable http, such as:
0 commit comments