From 8acd838829b550c3160b5c4b673d9d7262f26258 Mon Sep 17 00:00:00 2001 From: Matt <77928207+mattzcarey@users.noreply.github.com> Date: Wed, 19 Nov 2025 20:55:46 +0000 Subject: [PATCH] docs: update installation instructions for zod peer dependency (#1139) --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fa407475..bcdf0d84 100644 --- a/README.md +++ b/README.md @@ -47,9 +47,11 @@ The Model Context Protocol allows applications to provide context for LLMs in a ## Installation ```bash -npm install @modelcontextprotocol/sdk +npm install @modelcontextprotocol/sdk zod ``` +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`: + ## Quick Start 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, () => { }); ``` -Install the deps with `npm install @modelcontextprotocol/sdk express zod@3`, and run with `npx -y tsx server.ts`. +Install the deps with `npm install @modelcontextprotocol/sdk express zod`, and run with `npx -y tsx server.ts`. You can connect to it using any MCP client that supports streamable http, such as: