The official TypeScript SDK for Model Context Protocol servers and clients
by modelcontextprotocolLast 12 weeks ยท 94 commits
5 of 6 standards met
Remove the Zod result schema argument from Protocol.request(), BaseContext.mcpReq.send(), Client.callTool(), and ExperimentalServerTasks.requestStream(). The SDK now resolves the correct result schema internally based on the method name via a new getResultSchema() function. This simplifies the public API surface โ callers no longer need to import and pass result schemas like CallToolResultSchema or ElicitResultSchema when making requests. BREAKING CHANGE: Protocol.request(), ctx.mcpReq.send(), Client.callTool(), and ExperimentalServerTasks.requestStream() no longer accept a schema parameter. Internal SDK methods use the new protected _requestWithSchema()/_requestStreamWithSchema() escape hatches. Motivation and Context How Has This Been Tested? Breaking Changes Types of changes [ ] Bug fix (non-breaking change which fixes an issue) [ ] New feature (non-breaking change which adds functionality) [ ] Breaking change (fix or feature that would cause existing functionality to change) [ ] Documentation update Checklist [ ] I have read the MCP Documentation [ ] My code follows the repository's style guidelines [ ] New and existing tests pass locally [ ] I have added appropriate error handling [ ] I have added or updated documentation as needed Additional context
Repository: modelcontextprotocol/typescript-sdk. Description: The official TypeScript SDK for Model Context Protocol servers and clients Stars: 11709, Forks: 1638. Primary language: TypeScript. Languages: TypeScript (97.3%), JavaScript (2.5%), Shell (0.2%). Homepage: https://modelcontextprotocol.io Latest release: v1.27.1 (4d ago). Open PRs: 100, open issues: 238. Last activity: 19h ago. Community health: 87%. Top contributors: jspahrsummers, ihrpr, ochafik, bhosmer-ant, felixweinberger, KKonstantinov, jerome3o-anthropic, cliffhall, allenzhou101, mattzcarey and others.
TypeScript
Add integration tests that run MCP server/client round-trips natively on Bun and Deno using their respective test runners, verifying the SDK works across runtimes beyond Node.js. Add bun.test.ts using bun:test + Bun.serve() Add deno.test.ts using Deno.test + Deno.serve() + node:assert Add test-runtimes CI job (Bun 1.x + Deno v2.x matrix) Gate publish job on test-runtimes passing Exclude runtime-specific tests from vitest and tsconfig Motivation and Context How Has This Been Tested? Breaking Changes Types of changes [ ] Bug fix (non-breaking change which fixes an issue) [x] New feature (non-breaking change which adds functionality) [ ] Breaking change (fix or feature that would cause existing functionality to change) [x] Documentation update Checklist [x] I have read the MCP Documentation [x] My code follows the repository's style guidelines [x] New and existing tests pass locally [x] I have added appropriate error handling [x] I have added or updated documentation as needed Additional context
Problem When is passed as to , the SDK silently interprets it as instead of an input schema. The tool registers with empty parameters and arguments are stripped without any error. This is because correctly identifies ZodObject instances as not raw shapes (they have internal / properties, not field schemas as values). But the fallback branch at line 1026 unconditionally treats any remaining object as . Root Cause Fix Added that detects ZodObject schemas (both Zod v3 and v4) by checking for a property whose values are Zod type instances. When detected, the raw shape is extracted and used as . Both forms now work identically: Tests Added test for auto-unwrap with schema verification and argument passing Added test for combined with annotations All 1551 tests pass (2 consecutive clean runs) Fixes #1291