MCP TypeScript SDK
The official TypeScript SDK for building MCP servers and clients.
About
The MCP TypeScript SDK is the official TypeScript implementation of the Model Context Protocol — the open standard for connecting LLMs to external tools, data sources, and prompts. It runs on Node.js, Bun, and Deno, and ships server libraries (tools/resources/prompts, Streamable HTTP and stdio transports, auth helpers), client libraries (transports, high-level helpers, OAuth), and thin middleware adapters for Express, Fastify, Hono, and raw Node HTTP. Version 2 (the current stable line) implements the 2026-07-28 MCP spec as the split packages @modelcontextprotocol/server and @modelcontextprotocol/client; the v1 @modelcontextprotocol/sdk package remains on a maintenance branch.
What it can do
- **MCP server libraries** (README-verified): tools, resources, and prompts with Standard Schema validation (Zod v4, Valibot, ArkType), Streamable HTTP and stdio transports, and auth helpers — implementing the **2026-07-28 MCP specification**.
- **MCP client libraries**: transports, high-level helpers, and OAuth helpers for connecting to any MCP server from TypeScript.
- **Runs on Node.js, Bun, and Deno** (README-verified) with framework middleware packages for Express, Fastify, Hono, and Node's native HTTP — described as intentionally thin adapters that add no MCP business logic.
- Runnable examples under `examples/`, full v2 docs at ts.sdk.modelcontextprotocol.io/v2, and a v1→v2 migration guide; v1.x (`@modelcontextprotocol/sdk`) continues on a maintenance branch with bug/security fixes.
Setup
Install the package(s) you need (Node.js, Bun, or Deno — README-verified):
```bash
npm install @modelcontextprotocol/server
# or
npm install @modelcontextprotocol/client
# Bun / Deno equivalents:
bun add @modelcontextprotocol/server
deno add npm:@modelcontextprotocol/server
```
Optional thin middleware adapters for your framework (no new MCP functionality, per README):
```bash
npm install @modelcontextprotocol/express express # Express
npm install @modelcontextprotocol/fastify fastify # Fastify
npm install @modelcontextprotocol/hono hono # Hono
npm install @modelcontextprotocol/node # raw Node http
```
Start with the v2 ten-minute server tutorial: https://ts.sdk.modelcontextprotocol.io/v2/ — runnable examples live in the repo's examples/ directory, and a migration guide covers v1 -> v2.
Prerequisites
Node.js 18+ (v2 docs; Bun/Deno also supported). For tool schemas, bring your own validator: Zod v4, Valibot, ArkType, or any Standard Schema-compatible library. If exposing a server over HTTP, standard TLS/hosting for your app.
Use cases
Works with
Trust score — 9/10
13,561 stars and the official SDK of the Model Context Protocol, with the README's quickstart (npm install @modelcontextprotocol/server|client, Node/Bun/Deno runtimes) and v2/spec-version claims verified directly. Split-package structure, middleware list, and examples dir all confirmed in the repo. Docked one point: v2 only became the stable line on 2026-07-27 (contributor PRs still throttled while it settles), and the codebase is mid-transition from MIT to Apache-2.0 licensing — both disclosed in the README, but commercial users should check which license covers the files they use.
★ 13,561 GitHub stars
How the trust score is built
Full methodology →- Adoption · stars/downloads, log-scaled vs peers
- 8.5/10
- Maintenance · recency, releases, issue load
- 8.4/10
- Openness · license + docs
- 10.0/10
- Manual review · sanity read + red-flag check
- 9.0/10
- · 13,561 GitHub stars (log-scaled vs catalog peers)
- · blended with ~35,493,497 monthly package downloads
- · last push 0d ago; 100 releases/12mo; 557 open issues
- · manual review: v2 stable since Jul 2026, still settling; contributor PRs throttled
Sources
Every fact above was checked against these sources. Where a claim comes from the provider and couldn't be independently verified, the text says so.