# Model Context Protocol TypeScript SDK: Build MCP Servers and Clients

This repository profile is provided by osrepos.com, an open source repository discovery platform.

Source: osrepos.com
Repository profile: https://osrepos.com/repo/modelcontextprotocol-typescript-sdk
Generated for open source discovery and AI-assisted research.

The `modelcontextprotocol/typescript-sdk` is the official TypeScript SDK for interacting with Model Context Protocol (MCP) servers and clients. It provides a standardized way for applications to offer context to Large Language Models (LLMs), separating context provision from LLM interaction. Developers can use it to easily create MCP servers that expose resources, prompts, and tools, as well as build MCP clients to connect to any MCP server.

GitHub: https://github.com/modelcontextprotocol/typescript-sdk
OSRepos URL: https://osrepos.com/repo/modelcontextprotocol-typescript-sdk

## Summary

The `modelcontextprotocol/typescript-sdk` is the official TypeScript SDK for interacting with Model Context Protocol (MCP) servers and clients. It provides a standardized way for applications to offer context to Large Language Models (LLMs), separating context provision from LLM interaction. Developers can use it to easily create MCP servers that expose resources, prompts, and tools, as well as build MCP clients to connect to any MCP server.

## Topics

- TypeScript
- SDK
- Model Context Protocol
- LLM
- AI
- Server
- Client
- Developer Tools

## Repository Information

Last analyzed by OSRepos: Tue Dec 09 2025 16:01:49 GMT+0000 (Western European Standard Time)
Detail views: 5
GitHub clicks: 2

## Safety Notice

OSRepos shares public repositories for knowledge and discovery only. Review source code, dependencies, licenses, and security implications before running or installing anything.

## Content

## Introduction

The `modelcontextprotocol/typescript-sdk` is the official TypeScript SDK for the Model Context Protocol (MCP). This protocol enables applications to provide context for Large Language Models (LLMs) in a standardized manner, decoupling context provision from LLM interaction. The SDK implements the full MCP specification, simplifying the creation of MCP servers that expose resources, prompts, and tools, as well as the development of MCP clients that can connect to any MCP server using standard transports like stdio and Streamable HTTP.

## Installation

To get started with the Model Context Protocol TypeScript SDK, install it via npm:

bash
npm install @modelcontextprotocol/sdk zod


Note that `zod` is a required peer dependency for schema validation, ensuring robust data handling within your applications. The SDK is compatible with Zod v3.25 or later.

## Examples

The SDK ships with a comprehensive set of runnable examples under the `src/examples` directory, designed to help you quickly understand and implement its capabilities. A quick start guide demonstrates an end-to-end interaction, featuring an example Streamable HTTP server and an interactive client.

You can explore various scenarios, including different server types (stateful, stateless, JSON response mode), client interactions (interactive, parallel tool calls, OAuth), and advanced capabilities like form and URL elicitation, sampling, and tasks. These examples provide practical insights into building sophisticated LLM-powered applications.

## Why Use It

The Model Context Protocol TypeScript SDK offers a robust solution for integrating LLMs into applications by standardizing context provision. It simplifies the development process with clear APIs for creating servers and clients, supporting various transports. Its rich feature set, including tools for LLM actions, resources for data exposure, reusable prompts, and advanced capabilities like sampling and elicitation, empowers developers to build sophisticated and interactive LLM-powered applications efficiently. This standardization ensures better interoperability and maintainability for your LLM integrations.

## Links

For more in-depth information and to explore the Model Context Protocol further, refer to the official documentation:

*   [Model Context Protocol Documentation](https://modelcontextprotocol.io){:target='_blank'}
*   [MCP Specification](https://spec.modelcontextprotocol.io){:target='_blank'}
*   [GitHub Repository](https://github.com/modelcontextprotocol/typescript-sdk){:target='_blank'}