modelcontextprotocol/typescript-sdk

The official TypeScript SDK for Model Context Protocol servers and clients

What it solves

This SDK provides a standardized way for applications to provide context (such as tools, resources, and prompts) to Large Language Models (LLMs), separating the logic of context provision from the actual LLM interaction.

How it works

It implements the Model Context Protocol (MCP) specification using TypeScript. The SDK is split into two primary libraries: a server library for building MCP servers that expose tools and resources, and a client library for connecting to those servers. It supports multiple runtimes (Node.js, Bun, and Deno) and provides transport options like stdio and Streamable HTTP, along with optional middleware for frameworks like Express, Fastify, and Hono.

Who it’s for

Developers building AI applications who want to implement a consistent, interoperable standard for connecting LLMs to external data sources and tools.

Highlights

  • Multi-runtime support: Works across Node.js, Bun, and Deno.
  • Flexible Transports: Supports stdio and Streamable HTTP for communication.
  • Framework Adapters: Includes thin middleware for Express, Fastify, and Hono.
  • Schema Validation: Uses Standard Schema, allowing compatibility with libraries like Zod, Valibot, and ArkType.

Related

  • Project
  • Project
  • Project
  • Project
  • Project