MCP TypeScript SDK
The official TypeScript SDK for building Model Context Protocol servers and clients on Node.js, Bun, and Deno.
At a Glance
About MCP TypeScript SDK
The MCP TypeScript SDK is the official TypeScript implementation of the Model Context Protocol (MCP), published from the modelcontextprotocol GitHub organization. It lets developers write servers that expose tools, resources, and prompts to AI hosts, and clients that connect to those servers. The current v2 line implements the 2026-07-28 MCP spec and runs on Node.js, Bun, and Deno.
What It Is
MCP is described in the docs as an open standard that connects AI applications to the systems where data and tools live. This SDK provides the TypeScript side: split packages @modelcontextprotocol/server and @modelcontextprotocol/client, plus optional middleware packages for Node.js HTTP, Express, Fastify, and Hono. Any MCP host, such as Claude Code, VS Code, or Cursor, can connect to a server built with it.
How the Server Workflow Works
A developer creates an McpServer, registers a tool with registerTool(name, config, handler) and an input schema, and serves it over stdio or HTTP. Tool and prompt schemas use Standard Schema, so Zod v4, Valibot, ArkType, or other compatible libraries work. The SDK validates each call against the schema before the handler runs. Server docs cover tools, resources, prompts, completion, logging, progress, cancellation, elicitation, notifications, errors, sessions and scaling, and authorization.
Client Side and Authentication
Client documentation covers connecting, calling tools, handling server requests, subscriptions, OAuth, machine auth, middleware, caching, and protocol versions. Transports include stdio, Streamable HTTP, and legacy SSE.
Migration and Versions
v2 is the current stable line. The v1.x line (@modelcontextprotocol/sdk) is on a maintenance branch and, per the docs, receives bug fixes and security updates for at least six months after the v2 release on 2026-07-27. A @modelcontextprotocol/codemod package and a migration guide support upgrades from v1. The repository's latest listed release is v2.3.1.
Community Discussions
Be the first to start a conversation about MCP TypeScript SDK
Share your experience with MCP TypeScript SDK, ask questions, or help others learn from your insights.
Pricing
Open Source
MCP TypeScript SDK (v2) is free to use under the Apache License 2.0 for new contributions, with existing code under MIT. No paid tiers are listed.
- Apache-2.0 for new contributions; existing code under MIT where relicensing consent has not been obtained
- Documentation contributions (excluding specifications) under CC-BY-4.0
- Server and client libraries (@modelcontextprotocol/server, @modelcontextprotocol/client)
- Optional middleware packages for Node.js, Express, Fastify and Hono
- Runs on Node.js, Bun and Deno
Capabilities
Key Features
- MCP server library for tools, resources, and prompts
- MCP client library with transports and high-level helpers
- Stdio and Streamable HTTP transports
- OAuth and machine authentication helpers
- Standard Schema support (Zod v4, Valibot, ArkType)
- Middleware packages for Node.js, Express, Fastify, and Hono
- Elicitation, logging, progress, and cancellation
- Codemod package for migrating from v1 to v2
- Runs on Node.js, Bun, and Deno
