File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5252 "types" : " ./dist/server/mcp.d.ts" ,
5353 "import" : " ./dist/server/mcp.mjs"
5454 },
55+ "./server/zod-compat.js" : {
56+ "types" : " ./dist/server/zod-compat.d.ts" ,
57+ "import" : " ./dist/server/zod-compat.mjs"
58+ },
59+ "./server/zod-compat" : {
60+ "types" : " ./dist/server/zod-compat.d.ts" ,
61+ "import" : " ./dist/server/zod-compat.mjs"
62+ },
5563 "./server/stdio.js" : {
5664 "types" : " ./dist/server/stdio.d.ts" ,
5765 "import" : " ./dist/server/stdio.mjs"
Original file line number Diff line number Diff line change 1+ // v1 compat: `@modelcontextprotocol/sdk/server/zod-compat.js`
2+ // v1 unified Zod v3 + v4 types. v2 is Zod v4-only, so these collapse to the
3+ // v4 types. Prefer `StandardSchemaV1` / `StandardSchemaWithJSON` for new code.
4+
5+ import type * as z from 'zod' ;
6+
7+ /** @deprecated Use `StandardSchemaV1` (any Standard Schema) or a Zod type directly in v2. */
8+ export type AnySchema = z . core . $ZodType ;
9+
10+ /** @deprecated Use `Record<string, z.ZodType>` directly in v2. */
11+ export type ZodRawShapeCompat = Record < string , AnySchema > ;
12+
13+ /** @deprecated */
14+ export type AnyObjectSchema = z . core . $ZodObject | AnySchema ;
15+
16+ export type { StandardSchemaV1 , StandardSchemaWithJSON } from '@modelcontextprotocol/server' ;
Original file line number Diff line number Diff line change 11// v1 compat: `@modelcontextprotocol/sdk/shared/protocol.js`
2- // Protocol class is no longer public in v2; subclass Client or Server instead.
3- // Re-exporting the option types and context types that v1 callers commonly
4- // imported from this path.
52
63export type {
74 BaseContext ,
85 ClientContext ,
96 NotificationOptions ,
107 ProtocolOptions ,
8+ ProtocolSpec ,
119 RequestOptions ,
1210 ServerContext
1311} from '@modelcontextprotocol/server' ;
12+ export { DEFAULT_REQUEST_TIMEOUT_MSEC , Protocol } from '@modelcontextprotocol/server' ;
1413
1514/** @deprecated Use {@link ServerContext} (server handlers) or {@link ClientContext} (client handlers) in v2. */
1615// eslint-disable-next-line @typescript-eslint/no-unused-vars
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ export default defineConfig({
1010 'src/experimental/tasks.ts' ,
1111 'src/server/index.ts' ,
1212 'src/server/mcp.ts' ,
13+ 'src/server/zod-compat.ts' ,
1314 'src/server/completable.ts' ,
1415 'src/server/sse.ts' ,
1516 'src/server/stdio.ts' ,
You can’t perform that action at this time.
0 commit comments