typescript-sdk  by modelcontextprotocol

TypeScript SDK for Model Context Protocol servers and clients

created 10 months ago
8,903 stars

Top 5.8% on sourcepulse

GitHubView on GitHub
Project Summary

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

  • Install: npm install @modelcontextprotocol/sdk
  • Prerequisites: Node.js, npm/yarn.
  • Quickstart: The README provides a basic server example using stdio transport and zod for schema validation.

Highlighted Details

  • Supports defining static and dynamic resources with URI templating.
  • Enables creation of tools with input validation using zod.
  • Offers Prompt templates for structured LLM interactions.
  • Implements both stateful and stateless Streamable HTTP server transports.
  • Includes a ProxyOAuthServerProvider for integrating external OAuth providers.
  • Provides client-side and server-side compatibility layers for deprecated HTTP+SSE transport.

Maintenance & Community

Licensing & Compatibility

  • Licensed under the MIT License.
  • Compatible with commercial and closed-source applications.

Limitations & Caveats

The README notes that the SSE transport is deprecated in favor of Streamable HTTP, recommending migration for existing SSE implementations.

Health Check
Last commit

2 days ago

Responsiveness

1 week

Pull Requests (30d)
71
Issues (30d)
46
Star History
2,890 stars in the last 90 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), Travis Fischer Travis Fischer(Founder of Agentic), and
1 more.

fastmcp by punkpeye

3.7%
2k
TypeScript framework for building MCP servers handling client sessions
created 7 months ago
updated 2 days ago
Feedback? Help us improve.