typescript-sdk (modelcontextprotocol/typescript-sdk)

Searching Database…

What is this?This is the official TypeScript SDK for the Model Context Protocol (MCP), letting apps provide standardized context to LLMs by building MCP servers and clients.
Is this one SDK, or split into separate packages?It is a monorepo that publishes separate @modelcontextprotocol/server and @modelcontextprotocol/client packages, plus optional thin middleware adapters for Express, Fastify, Hono, and Node's http module.
How do I build my first MCP server with it?Follow the official step-by-step tutorial: install the server package and expose a minimal example, like a single greet tool served over stdio, in about ten minutes.
Which JavaScript runtimes does it support?It runs on Node.js, Bun, and Deno — package.json requires Node >=20 if you go that route, with no other runtime dependencies.
Is v2 ready to adopt right now?v2 is the new stable line matching the 2026-07-28 spec, but it's still settling: the maintainers are currently capping external pull requests at one per new contributor and prefer issue feedback. v1.x keeps getting bug/security fixes for at least 6 months after v2's release.
What transports does the SDK support for MCP communication?Both stdio and Streamable HTTP transports are built in, alongside OAuth helpers for securing client-server connections.
Do middleware packages like Express or Hono add extra MCP features?No — they're intentionally thin adapters handling things like Host header validation and body parsing, and shouldn't introduce new MCP functionality or business logic.
Can I use any schema library for tools and prompts?Yes, schemas use the Standard Schema interface, so Zod v4, Valibot, ArkType, or any compatible library works instead of being locked to one validator.
Where can I find runnable examples beyond the tutorials?The examples/ directory has self-verifying client/server example pairs, one story per directory, documented in examples/README.md.
Size
22.2 MB
Stars
13.8K
Age
2y
Commits · 90 Days