TypeScript SDK for Model Context Protocol servers and clients
Top 5.8% on sourcepulse
This TypeScript SDK provides a comprehensive framework for building servers and clients that adhere to the Model Context Protocol (MCP). It enables developers to standardize how applications provide context, tools, and prompts to Large Language Models (LLMs), abstracting away LLM interaction details.
How It Works
The SDK implements the MCP specification, allowing developers to define Resources
(data endpoints) and Tools
(executable functions) that LLM applications can consume. It supports various communication transports, including stdio
for command-line interfaces and Streamable HTTP
for network-based interactions, with options for stateful session management or stateless request handling. The core McpServer
class manages protocol compliance and message routing, while ResourceTemplate
aids in defining dynamic resources.
Quick Start & Requirements
npm install @modelcontextprotocol/sdk
stdio
transport and zod
for schema validation.Highlighted Details
zod
.Prompt
templates for structured LLM interactions.Streamable HTTP
server transports.ProxyOAuthServerProvider
for integrating external OAuth providers.Maintenance & Community
Licensing & Compatibility
Limitations & Caveats
The README notes that the SSE transport is deprecated in favor of Streamable HTTP, recommending migration for existing SSE implementations.
2 days ago
1 week