typescript-sdk

The official TypeScript SDK for Model Context Protocol servers and clients

12.0k
Stars
+263
Stars/month
10
Releases (6m)

Star Growth

+55 (0.5%)
11.8k12.0k12.3kMar 27Apr 1

Overview

The official TypeScript SDK for implementing Model Context Protocol (MCP), which enables applications to provide standardized context to Large Language Models. MCP separates the concerns of providing context from actual LLM interactions, creating a cleaner architecture for AI applications. This SDK supports building both MCP servers (that provide tools, resources, and prompts) and clients (that consume them), running across Node.js, Bun, and Deno environments. It includes comprehensive libraries for authentication, transport protocols, and streamable HTTP connections. The SDK also provides optional middleware packages for popular frameworks like Express and Hono, making integration straightforward. With over 12,000 GitHub stars, it represents the standard implementation for MCP in the TypeScript ecosystem. Currently, v1.x is recommended for production use while v2 is in pre-alpha development with a stable release planned for Q1 2026.

Deep Analysis

Key Differentiator

The official reference TypeScript implementation of MCP — ensures full spec compliance and first-party support vs community implementations

Capabilities

  • Official TypeScript implementation of Model Context Protocol (MCP)
  • MCP server libraries (tools, resources, prompts, Streamable HTTP, stdio)
  • MCP client libraries (transports, OAuth helpers)
  • Standard Schema support (Zod v4, Valibot, ArkType)
  • Middleware packages for Express, Hono, Node.js HTTP
  • Multi-runtime support (Node.js, Bun, Deno)

🔗 Integrations

ExpressHonoNode.js HTTP

Best For

  • Building MCP-compatible tools and servers in TypeScript
  • Exposing data sources and tools to LLM applications via standard protocol

Not Ideal For

  • Python-only teams (use Python MCP SDK instead)
  • Projects not using MCP protocol

Languages

TypeScript

Deployment

npm install (library)

Pricing Detail

Free: Fully open source (Apache 2.0 / MIT)
Paid: N/A

Known Limitations

  • v2 is pre-alpha (v1.x recommended for production)
  • TypeScript only — no Python (use Python SDK separately)
  • MCP specification itself is still evolving

Pros

  • + Official SDK with comprehensive server and client libraries supporting multiple runtimes (Node.js, Bun, Deno)
  • + Includes middleware packages for popular frameworks (Express, Hono) enabling easy integration
  • + Strong community adoption with 12,000+ GitHub stars and active development

Cons

  • - Version 2 is currently in pre-alpha development, making it unstable for production use
  • - Requires peer dependency on Zod v4 for schema validation, adding complexity to setup
  • - May be over-engineered for simple context provision scenarios that don't need full MCP protocol

Use Cases

  • Building MCP servers that provide tools, resources, and prompts to LLM applications
  • Creating MCP clients that consume standardized context from various servers
  • Integrating MCP capabilities into existing Express or Hono web applications

Getting Started

1. Install the SDK with `npm install @modelcontextprotocol/server zod` for servers or `@modelcontextprotocol/client zod` for clients. 2. Import the library and create your first MCP server or client using the provided APIs and examples. 3. Test your implementation with the runnable examples provided in the repository's examples directory.

Compare typescript-sdk