typescript-sdk
The official TypeScript SDK for Model Context Protocol servers and clients
claude mcp add --transport stdio modelcontextprotocol-typescript-sdk node path/to/server.js \ --env VAR_NAME="description or placeholder"
How to use
The MCP TypeScript SDK provides both server-side utilities to build MCP servers and client-side helpers to consume MCP services. It ships with core server libraries for building MCP-enabled transports, resources, prompts, and deployment patterns, as well as client libraries for transports, high-level helpers, and OAuth utilities. Optional middleware packages are available to simplify wiring MCP into runtimes such as Express, Hono, or Node.js HTTP servers, enabling you to plug MCP capabilities into your existing application stack. The runnable examples under examples illustrate end-to-end usage, including setting up a server, exposing MCP tools and prompts, and then using a client to interact with those capabilities. When using the v1.x API (stable for production now) you’ll find documentation and examples aligned with that version, while v2 is in development with newer API surfaces and docs available at /v2/.
How to install
Prerequisites:
- Node.js (LTS recommended) and npm or pnpm/bun
- Basic understanding of npm workspaces/monorepos if you plan to install from the monorepo
Installation steps:
- Install Node.js and a package manager (npm, pnpm, or bun) on your system.
- In your project, install the MCP server and/or client packages as needed. For the server:
- npm install @modelcontextprotocol/server zod
- or with bun: bun add @modelcontextprotocol/server zod
- or with deno: deno add npm:@modelcontextprotocol/server npm:zod
- If you plan to use the client libraries:
- npm install @modelcontextprotocol/client zod
- or with bun: bun add @modelcontextprotocol/client zod
- or with deno: deno add npm:@modelcontextprotocol/client npm:zod
- Optional middleware packages can be installed as needed, for example:
- npm install @modelcontextprotocol/node
- npm install @modelcontextprotocol/express express
- npm install @modelcontextprotocol/hono hono
- Explore the runnable examples under examples/ to see end-to-end usage and adapt them to your project.
Note: The repository supports Node.js, Bun, and Deno runtimes. Use the approach that aligns with your runtime and project setup.
Additional notes
Tips and notes:
- The SDK relies on Zod for schema validation (v4); ensure it is installed as a peer dependency where required.
- The monorepo publishes separate packages: @modelcontextprotocol/server and @modelcontextprotocol/client. They are designed to be used together but can be adopted independently depending on whether you’re building MCP servers or MCP clients.
- Optional middleware packages are lightweight adapters; they do not add new MCP functionality, only framework/runtime integration.
- For v2 development, refer to the /v2/ API docs. For production stability, v1.x remains the recommended version until v2 is released.
- When running examples, pnpm is recommended as shown in the Quick Start; if you don’t have pnpm, you can translate commands to npm equivalents or use your preferred package manager.
Related MCP Servers
iterm
A Model Context Protocol server that executes commands in the current iTerm session - useful for REPL and CLI assistance
mcp
Octopus Deploy Official MCP Server
furi
CLI & API for MCP management
editor
MCP Server for Phaser Editor
DoorDash
MCP server from JordanDalton/DoorDash-MCP-Server
mcp
MCP сервер для автоматического создания и развертывания приложений в Timeweb Cloud