MCP TypeScript SDK — MCP protocol
Official SDK for creating MCP servers and clients in TypeScript
Basic information
| Program name | MCP TypeScript SDK (MCP TypeScript SDK) |
|---|---|
| One-line introduction | Official SDK for creating MCP servers and clients in TypeScript |
| Development and maintenance | Model Context Protocol project |
| Official website | https://modelcontextprotocol.io/docs/sdk |
| Official documentation | https://github.com/modelcontextprotocol/typescript-sdk |
| Installation and distribution | npm install @modelcontextprotocol/sdk |
| Runtime environment | Node.js · Bun · Deno |
| License | MIT license |
| Stable version | 1.32.1 (npm, confirmed 2026-10) — confirmed on 2026-10-18 |
| GitHub repository | https://github.com/modelcontextprotocol/typescript-sdk |
| Category | MCP protocol (tags: MCP, SDK, TypeScript, server development, client) |
What is this program?
MCP TypeScript SDK is the official SDK for creating MCP servers and clients in TypeScript. It was rewritten in 2026 to be based on Web standards (Web Standards) so it is not tied to Node.js, and it runs on Bun, Deno, and Cloudflare Workers.
It provides all core protocol features, including type-safe tool definitions, stdio and Streamable HTTP transports, and OAuth authentication. It is mainly used when creating servers that can connect to various MCP hosts, including Anthropic's Claude.
What problems does it solve?
- Situations where you need to expose external APIs or internal tools as an MCP server
- Situations where you need to build a type-safe MCP client in a TypeScript environment
- Situations where you need a server that also runs on runtimes other than Node.js (Bun, Deno, Workers)
Key features
Type-safe server definition
Define tool inputs and outputs with Zod schemas
- Use case: Prevent invalid calls at compile time
- Result: Generate client code through automatic type inference
- Limitations: Requires learning schema design
Multiple transports
Built-in support for stdio and Streamable HTTP transports
- Use case: Implement both local and remote servers
- Result: Select deployment environments without swapping transports
- Limitations: Requires CORS and authentication configuration for remote deployment
OAuth support
Built-in Bearer token and refresh flow
- Use case: Implement servers that require authentication
- Result: Secure remote access
- Limitations: May require configuring an OAuth provider
Based on Web Standards
Cross-runtime support not tied to Node.js
- Use case: Runs on Bun, Deno, and Workers
- Result: Reduced bundle size and improved portability
- Limitations: Limited when using some Node-only APIs
Installation and execution
npm
Install the SDK in your project.
npm install @modelcontextprotocol/sdk
Bun
Install with the Bun package manager.
bun add @modelcontextprotocol/sdk
Deno
Install via JSR or npm compatibility.
deno add jsr:@modelcontextprotocol/sdk
Real-world usage examples
Creating a server
Create an McpServer instance and register tools.
new McpServer({name:'demo',version:'1.0.0'})
Registering a tool
Define tools and schemas with server.tool().
server.tool('get_weather','City name',{city:z.string()},...)
Connecting a transport
Connect StdioServerTransport or StreamableHTTPServerTransport.
await server.connect(new StdioServerTransport())
Advantages and limitations
Advantages
- Official MCP project; the most actively maintained SDK
- Web Standards-based compatibility with Bun, Deno, and Workers
- Type-safe tool definitions and automatic code generation
- MIT license
Considerations before use
- May require migration to SDK v2 following the 2026-07-28 specification changes
- Learning curve for Zod and TypeScript
- Large servers require bundle size management
Comparison with similar programs
| Program | Characteristics | Suitable for |
|---|---|---|
| MCP Python SDK | Official SDK based on Python decorators | Python backends and data tools |
| Go SDK | Tier 1 SDK based on Go 21+ | Go infrastructure teams |
| mcp-use | Python framework; server and client abstraction | Rapid prototyping |
Official resources and further learning
- Official website — https://modelcontextprotocol.io/docs/sdk
- Official documentation / knowledge base — https://github.com/modelcontextprotocol/typescript-sdk
- Installation / distribution — npm install @modelcontextprotocol/sdk
- Release notes — https://github.com/modelcontextprotocol/typescript-sdk/releases
- Source / development resources — https://github.com/modelcontextprotocol/typescript-sdk
Version and supported environment information was verified on the official site as of 2026-10-18. Installation commands may vary depending on your distribution and version, so check the official installation documentation as well.
Actual execution screen
Synthetic example — not an actual execution result. The screen is a synthetic example and not an actual execution result.
!Example of installing MCP TypeScript SDK and running a server
A server in actual operation
Source (HTML): https://games.aidebatehub.com/programs/mcp/protocol/ts-sdk.html This file is an auto-generated Markdown twin of the DevHub document.
AI Knowledge Hub
Visitor Comments