MCP TypeScript SDK

MCP TypeScript SDK
Suited to web teams working with Node.js.
The official library for writing MCP servers and clients in TypeScript / Node.js.
What is MCP TypeScript SDK and who is it for?
MCP TypeScript SDK is an MCP server, listed under MCP in the OPCAIOS tools library. Short label: GitHub. The official library for writing MCP servers and clients in TypeScript / Node.js. The MCP TypeScript SDK is the official set of libraries for building MCP servers and clients in TypeScript. From v2, the SDK is split into separate packages: @modelcontextprotocol/server for building servers and @modelcontextprotocol/client for building clients, plus optional middleware packages for Node, Express, Fastify and Hono. Best suited to: JavaScript and TypeScript developers. According to OPCAIOS, the editorial score of MCP TypeScript SDK is 4.0 out of 5: suited to web teams working with Node.js.
- Platform: Node.js, Bun, Deno.
- Difficulty to get started: intermediate.
Is MCP TypeScript SDK free, and what does it cost?
MCP TypeScript SDK is free to use. Free, open source (Apache 2.0 for new contributions, MIT for older code). Additionally, prices are set by the provider and can change, so compare with the official MCP TypeScript SDK site before you pay. To compare costs, the MCP group of the library also includes Model Context Protocol (free), MCP Servers (free), and MCP specification (free).
What are the main features of MCP TypeScript SDK?
According to OPCAIOS, the standout strengths of MCP TypeScript SDK are clearly separated packages, middleware for web frameworks, and multi-runtime, among others. Additionally, the list below explains each of the 6 recorded features.
- Clearly separated packages: server and client are independent packages; install only what you need.
- Middleware for web frameworks: Ready-made integration packages for Node, Express, Fastify and Hono.
- Multi-runtime: Supports Node.js, Bun and Deno.
- Flexible schema library: Uses Standard Schema, compatible with Zod v4, Valibot and ArkType.
- Authentication support: Includes server-side auth helpers and client-side OAuth.
- Clear upgrade path: A guide for moving from v1 to v2; v1.x remains supported for a while.
When should you use MCP TypeScript SDK?
MCP TypeScript SDK is used for 5 kinds of work. When using MCP TypeScript SDK, the most typical case is add MCP to an existing backend. Additionally, the main audience is JavaScript and TypeScript developers.
- Add MCP to an existing backend: Businesses using Express or Hono attach an MCP server to their current API.
- Expose web app data to AI: Let an AI assistant read orders and appointments from a system written in Node.js.
- Build tools for the engineering team: Write a local stdio server so AI can help with operations on a project.
- Be a client inside a product: Your application connects on its own to external MCP servers.
- Run on edge or Deno: Deploy lightweight servers on modern runtimes.
How do you get started with MCP TypeScript SDK?
When using MCP TypeScript SDK for the first time, you go through 5 steps, which OPCAIOS rates as intermediate difficulty. The first step is to install the server package, and the last is to upgrade from v1. The steps are listed in order below.
- Install the server package. Install the server package with npm (or the equivalent bun add, deno add).
- Install the client package if needed. Only install it when your application needs to connect to other MCP servers.
- Choose middleware. If you use Express, install the integration package along with express.
- Write your first server. Follow the first-server guide in the repo's docs folder or the v2 documentation.
- Upgrade from v1. Projects using @modelcontextprotocol/sdk should read the migration guide to v2.
What is MCP TypeScript SDK?
The MCP TypeScript SDK is the official set of libraries for building MCP servers and clients in TypeScript. From v2, the SDK is split into separate packages: @modelcontextprotocol/server for building servers and @modelcontextprotocol/client for building clients, plus optional middleware packages for Node, Express, Fastify and Hono.
The main branch is currently v2, the stable release implementing the MCP 2026-07-28 specification. The SDK runs on Node.js, Bun and Deno; servers support stdio and Streamable HTTP, with authentication helpers. Schemas for tools and prompts use the Standard Schema spec, so you can choose Zod v4, Valibot or ArkType.
The v1.x branch (the @modelcontextprotocol/sdk package) continues to receive bug and security fixes for at least six months after the v2 release date, so existing projects have time to migrate.
How much does MCP TypeScript SDK cost?
Free, open source (Apache 2.0 for new contributions, MIT for older code)
Prices are set by the provider and can change; check the official site for the latest.
Key features of MCP TypeScript SDK
Clearly separated packages
server and client are independent packages; install only what you need.
Middleware for web frameworks
Ready-made integration packages for Node, Express, Fastify and Hono.
Multi-runtime
Supports Node.js, Bun and Deno.
Flexible schema library
Uses Standard Schema, compatible with Zod v4, Valibot and ArkType.
Authentication support
Includes server-side auth helpers and client-side OAuth.
Clear upgrade path
A guide for moving from v1 to v2; v1.x remains supported for a while.
What is MCP TypeScript SDK used for?
Add MCP to an existing backend
Businesses using Express or Hono attach an MCP server to their current API.
Expose web app data to AI
Let an AI assistant read orders and appointments from a system written in Node.js.
Build tools for the engineering team
Write a local stdio server so AI can help with operations on a project.
Be a client inside a product
Your application connects on its own to external MCP servers.
Run on edge or Deno
Deploy lightweight servers on modern runtimes.
How to use MCP TypeScript SDK
- 1
Install the server package
Install the server package with npm (or the equivalent bun add, deno add).
$npm install @modelcontextprotocol/server - 2
Install the client package if needed
Only install it when your application needs to connect to other MCP servers.
$npm install @modelcontextprotocol/client - 3
Choose middleware
If you use Express, install the integration package along with express.
$npm install @modelcontextprotocol/express express - 4
Write your first server
Follow the first-server guide in the repo's docs folder or the v2 documentation.
- 5
Upgrade from v1
Projects using @modelcontextprotocol/sdk should read the migration guide to v2.
MCP TypeScript SDK video guides
The Ultimate MCP Crash Course - Build From Scratch
Web Dev Simplified
Build your first MCP Server in TypeScript
Roy Derks
Build a Real-world MCP Server with One TypeScript File Full Tutorial
Nader Dabit
Real-world example: MCP TypeScript SDK
A spa services company in Hanoi has a booking system written in Node.js and Express. The developer installs @modelcontextprotocol/server with the Express middleware package, and creates a tool to look up free slots and a resource describing the service list. Receptionists use an AI assistant to check open time slots when customers phone in, instead of opening several screens.
Tips for using MCP TypeScript SDK
Use v2 for new projects
v2 is the stable branch on main and follows the latest specification.
Install only the packages you need
Splitting server, client and middleware keeps the application lean.
Standardize on one schema library
Pick one library such as Zod v4 for the whole project for easier maintenance.
Plan to leave v1
v1.x is guaranteed fixes for only a minimum of six months after the v2 release date.
MCP TypeScript SDK: frequently asked questions
Can the old @modelcontextprotocol/sdk package still be used?
That is v1.x, which still receives bug and security fixes for at least six months after v2 launched.
Is Zod required?
No. The SDK uses Standard Schema, so Zod v4, Valibot or ArkType all work.
Does it run on Bun or Deno?
Yes, the README states support for Node.js, Bun and Deno.
What is the license?
New contributions are under the Apache License 2.0; existing code is under MIT.
Useful links
Want to apply this in your business?
OPCAIOS looks at your workflows, picks the right tools and sets them up with your team. The first call is free.
