Releases: modelcontextprotocol/typescript-sdk
1.3.0
What's Changed
This release introduces a simplified, Express-like API, similar in spirit to the FastMCP API of the Python SDK, but adapted to the conventions of the JavaScript ecosystem.
The simplified API should make it easier to develop and iterate on MCP servers, as tools and resources are now easier to declare incrementally. See the quick start in the README for more information.
Full Changelog: 1.2.0...1.3.0
1.2.0
What's Changed
- fix: add cjs format support by @ycjcl868 in #110
- feat: add optional instructions field to server _oninitialize by @kalvinnchau in #120
New Contributors
- @ycjcl868 made their first contribution in #110
- @kalvinnchau made their first contribution in #120
Full Changelog: 1.1.1...1.2.0
1.1.1
What's Changed
- Improve type inference from Zod schemas by @jspahrsummers in #114
- Added clean shutdown + tests by @jerome3o-anthropic in #115
Full Changelog: 1.1.0...1.1.1
1.1.0
What's Changed
- chore: satisfies npm-pkg-lint & publint by @nekomeowww in #94
- Add missing imports in
README.md
example by @TheFloatingString in #100 - feat(client/sse): add {EventSource,Request}Init options param by @chrisdickinson in #109
- Updates SDK error codes to use JSON-RPC server error range by @sumitesh9 in #103
New Contributors
- @TheFloatingString made their first contribution in #100
- @chrisdickinson made their first contribution in #109
- @sumitesh9 made their first contribution in #103
Full Changelog: 1.0.4...1.1.0
1.0.4
What's Changed
- Add a parsedBody optional parameter by @brn in #81
- chore: bump outdated versions in package-lock.json by @nekomeowww in #93
- fix: propagate notification params by @jerome3o-anthropic in #98
New Contributors
- @brn made their first contribution in #81
- @nekomeowww made their first contribution in #93
- @jerome3o-anthropic made their first contribution in #98
Full Changelog: 1.0.3...1.0.4
1.0.3
What's Changed
- Declare capabilities, fix imports in README examples by @jspahrsummers in #75
- Fix method name in client cancellation send by @efritz in #76
New Contributors
Full Changelog: 1.0.1...1.0.3
1.0.1
What's Changed
- Fix npx and other processes that launch subprocesses by @anaisbetts in #68
Full Changelog: 1.0.0...1.0.1
1.0.0
We're excited to announce the first stable release of the Model Context Protocol (MCP) TypeScript SDK! This release provides a complete implementation of the MCP specification, enabling seamless integration between LLM applications and context providers.
Features
Core Protocol Implementation
- Full implementation of MCP protocol v2024-11-05
- Robust client and server capabilities with promise-based async support
- Type-safe request/response handling using Zod schemas
- Support for all core MCP primitives:
- Prompts and prompt templates
- Resources and resource templates
- Tools with JSON Schema validation
- Progress tracking and notifications
- Logging with severity levels
Transport Layer Support
- Standard input/output (stdio) transport
- Server-Sent Events (SSE) transport
Client Features
- Simple, intuitive client API
- Automatic protocol negotiation
- Request timeout handling
- Progress tracking
- Error handling with typed exceptions
Server Features
- Flexible request handler registration
- Built-in capability negotiation
- Request context management
- Support for experimental capabilities
- Automatic request/response routing
Installation
npm install --save @modelcontextprotocol/sdk
Basic Usage
Creating a Client
import { Client } from "@modelcontextprotocol/sdk/client";
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio";
const client = new Client(
{ name: "example-client", version: "1.0.0" },
{ capabilities: { sampling: {} } }
);
const transport = new StdioClientTransport({
command: "path/to/server",
});
await client.connect(transport);
const resources = await client.listResources();
Creating a Server
import { Server } from "@modelcontextprotocol/sdk/server";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio";
const server = new Server(
{ name: "example-server", version: "1.0.0" },
{ capabilities: { resources: {} } }
);
server.setRequestHandler(ListResourcesRequestSchema, async () => ({
resources: [
{ uri: "file:///example.txt", name: "Example Resource" }
]
}));
const transport = new StdioServerTransport();
await server.connect(transport);
Requirements
- Node.js 18.0.0 or later
- TypeScript 5.0 or later (for development)
Breaking Changes
This is the initial stable release, establishing the baseline API for future versions.
License
MIT License
For more information:
0.7.0
What's Changed
- Add way to get child process stderr pipe by @jspahrsummers in #65
Full Changelog: 0.6.1...0.7.0
0.6.1
What's Changed
- Bump cross-spawn from 7.0.3 to 7.0.5 in the npm_and_yarn group across 1 directory by @dependabot in #59
- Add code of conduct by @dsp-ant in #61
- Use detached: true on Windows by @anaisbetts in #62
- Add CONTRIBUTING.md by @jspahrsummers in #64
- Fix package homepage by @jspahrsummers in #63
New Contributors
Full Changelog: 0.6.0...0.6.1