Official TypeScript SDK for building Model Context Protocol servers and clients.
Official TypeScript SDK for building Model Context Protocol servers and clients.
MCP TypeScript SDK
IMPORTANT:
This is the main branch: v2 of the SDK (@modelcontextprotocol/server, @modelcontextprotocol/client), the stable release line, implementing the 2026-07-28 MCP spec. Start with the v2 documentation; coming from v1, see the migration guide.
v1.x (@modelcontextprotocol/sdk) lives on the v1.x branch and continues to receive bug fixes and security updates for at least six months after the v2 release (2026-07-27). Its documentation is at ts.sdk.modelcontextprotocol.io.
Found a problem in v2? Open an issue.
NOTE:
Contributors without write access can have one open pull request at a time. Draft pull requests don't count toward the limit. For a feature or a larger change, please open an issue first; see CONTRIBUTING.md.
• Overview
• Packages
• Installation
• Getting Started
• Documentation
• Contributing
• License
The Model Context Protocol (MCP) allows applications to provide context for LLMs in a standardized way, separating the concerns of providing context from the actual LLM interaction.
This repository contains the TypeScript SDK implementation of the MCP specification. It runs on Node.js, Bun, and Deno, and ships:
• MCP server libraries (tools/resources/prompts, Streamable HTTP, stdio, auth helpers)
• MCP client libraries (transports, high-level helpers, OAuth helpers)
• Optional middleware packages for specific runtimes/frameworks (Express, Fastify, Hono, Node.js HTTP)
• Runnable examples (under examples/)
This monorepo publishes split packages:
• @modelcontextprotocol/server: build MCP servers
• @modelcontextprotocol/client: build MCP clients
Tool and prompt schemas use Standard Schema — bring Zod v4, Valibot, ArkType, or any compatible library.
The SDK also publishes small "middleware" packages under packages/middleware/ that help you wire MCP into a specific runtime or web framework.
They are intentionally thin adapters: they should not introduce new MCP functionality or business logic. See packages/middleware/README.md for details.
• @modelcontextprotocol/node: Node.js Streamable HTTP transport wrapper for IncomingMessage / ServerResponse
• @modelcontextprotocol/express: Express helpers (app defaults + Host header validation)
• @modelcontextprotocol/fastify: Fastify helpers (app defaults + Host header validation)
• @modelcontextprotocol/hono: Hono helpers (app defaults + JSON body parsing hook + Host header validation)
npm install @modelcontextprotocol/server
bun add @modelcontextprotocol/server
deno add npm:@modelcontextprotocol/server
npm install @modelcontextprotocol/client
bun add @modelcontextprotocol/client
deno add npm:@modelcontextprotocol/client
The SDK also publishes optional “middleware” packages that help you wire MCP into a specific runtime or web framework (for example Express, Fastify, Hono, or Node.js http).
These packages are intentionally thin adapters and should not introduce additional MCP features or business logic. See packages/middleware/README.md for details.
npm install @modelcontextprotocol/node …
Agent framework · Agent frameworks / MCP SDK · Open Source · MIT/Apache-2.0 (transitioning) · TypeScript
Website https://ts.sdk.modelcontextprotocol.io/v2/ · Repo https://github.com/modelcontextprotocol/typescript-sdk
13,749 stars · 2,380 forks · 665 open issues · pushed 2026-11-10 · verified 2026-11-12
Tags: ai-agents, framework, mcp-sdk
What is MCP TypeScript SDK? MCP TypeScript SDK is a coding tool listed on Scriptiii AI Tools. Official TypeScript SDK for building Model Context Protocol servers and clients. Pricing: Free. Free to use. Best for: ai-agents, framework, mcp-sdk.
Everything you need to know about MCP TypeScript SDK
Similar tools in Coding
Open-source vector database that stores objects and vectors with hybrid search and filtering.
Coding·Free