Developer ToolsModel Context Protocol project

MCP TypeScript SDK

Official TypeScript libraries for building MCP servers and clients

The MCP TypeScript SDK is the official Model Context Protocol implementation for TypeScript, maintained in the modelcontextprotocol GitHub organization. Version 2 is the stable release line and implements the 2026-07-28 MCP specification. It ships as split packages: @modelcontextprotocol/server for building servers and @modelcontextprotocol/client for building clients, plus thin optional middleware packages for Node.js HTTP, Express, Fastify and Hono. It runs on Node.js, Bun and Deno, and tool and prompt schemas use Standard Schema, so Zod v4, Valibot or ArkType all work. The v1 line (@modelcontextprotocol/sdk) lives on a separate branch and, per the repository README, keeps getting bug fixes and security updates for at least six months after the v2 release on 27 Jul 2026. On 7 Oct 2026 npm listed 2.3.1 for the v2 packages and 1.32.1 for v1.

Use Cases

  • Expose your product's actions to agents as MCP tools, resources and prompts
  • Build an MCP client into your own agent harness
  • Serve MCP over Streamable HTTP or stdio
  • Plan a v1 to v2 migration before v1 fixes end
  • Put OAuth in front of an MCP server using the SDK's auth helpers

Key Features

Split server and client packages

@modelcontextprotocol/server and @modelcontextprotocol/client install separately, so a server does not pull in client code.

Runtime adapters

Optional middleware for Node.js HTTP, Express, Fastify and Hono. The README describes them as thin adapters that add no MCP features of their own.

Standard Schema

Define tool and prompt input schemas with any Standard Schema library, including Zod v4, Valibot and ArkType.

Transports and auth helpers

Streamable HTTP and stdio transports; OAuth helpers on the client side and auth helpers on the server side.

Migration guide

An upgrade-to-v2 guide on the documentation site covers moving from @modelcontextprotocol/sdk.

Integrations

Node.jsBunDenoExpressFastifyHonoZod