# MCP TypeScript SDK

> The official TypeScript SDK for building Model Context Protocol servers and clients on Node.js, Bun, and Deno.

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.

## 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

## Integrations
Claude Code, VS Code, Cursor, Express, Hono, Fastify, Node.js, Bun, Deno, Zod, Valibot, ArkType

## Platforms
WINDOWS, LINUX, API, VSC_EXTENSION, DEVELOPER_SDK, CLI

## Pricing
Open Source

## Version
2.3.1

## Links
- Website: https://ts.sdk.modelcontextprotocol.io/v2
- Documentation: https://ts.sdk.modelcontextprotocol.io/v2/
- Repository: https://github.com/modelcontextprotocol/typescript-sdk
- EveryDev.ai: https://www.everydev.ai/tools/mcp-typescript-sdk
