MCP TypeScript SDK
The official TypeScript SDK for building Model Context Protocol servers and clients, running on Node.js, Bun and Deno, with optional middleware adapters for common web frameworks.
This is the official TypeScript implementation of the Model Context Protocol, which lets an application provide context to a large language model in a standardized way, separate from the LLM call itself. It runs on Node.js, Bun and Deno, and ships server libraries for building tools, resources and prompts over Streamable HTTP or stdio transports with authentication helpers, client libraries with transports, high-level helpers and OAuth support, and a set of runnable examples.
It is published as split packages for building servers and clients, with tool and prompt schemas defined using the Standard Schema interface, so a project can bring its own validation library, such as Zod, Valibot or ArkType. A set of small, optional middleware packages wire the SDK into specific runtimes and frameworks, including plain Node.js HTTP, Express, Fastify and Hono, and are deliberately kept thin, adding no protocol logic of their own.
The current major version implements the newest Model Context Protocol specification, while the previous version continues to receive fixes and security updates for a period after the new release.