explaingit

modelcontextprotocol/typescript-sdk

12,422TypeScriptAudience · developerComplexity · 3/5LicenseSetup · moderate

TLDR

The official TypeScript SDK for building Model Context Protocol servers and clients, letting AI applications share tools, resources, and context with language models in a standardized way.

Mindmap

mindmap
  root((MCP TypeScript SDK))
    What It Is
      Official MCP SDK
      TypeScript and JS
      Servers and clients
    Server Features
      Register tools
      Expose resources
      Stdio transport
      HTTP transport
    Client Features
      Connect to servers
      Call tools
    Runtimes
      Node.js
      Bun
      Deno
    Frameworks
      Express adapter
      Hono adapter
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Build an MCP server that exposes custom tools and data sources to AI models like Claude or GPT

USE CASE 2

Create an MCP client application that connects to MCP servers and calls their tools inside a chatbot

USE CASE 3

Wire an existing Express or Hono web server into the MCP protocol using the provided adapter packages

USE CASE 4

Prototype a weather data server or AI chatbot following the SDK quickstart examples

Tech stack

TypeScriptNode.jsBunDenoExpressHono

Getting it running

Difficulty · moderate Time to first run · 30min

Version 2 is pre-release, use v1 for production. Server and client roles require separate package imports.

MIT for existing code, Apache 2.0 for new contributions, both are permissive and allow use in commercial projects without restriction.

In plain English

This repository contains the official TypeScript SDK for the Model Context Protocol, commonly abbreviated as MCP. MCP is a standard that lets AI applications pass context, tools, and resources to large language models in a consistent way. Rather than each AI app inventing its own approach for connecting external data or actions to a model, MCP defines a shared format so different pieces of software can work together predictably. This SDK implements that standard for developers writing TypeScript or JavaScript. The SDK is split into two main packages. One is for building MCP servers, which are the pieces of software that expose tools, resources, or prompts to an AI model. The other is for building MCP clients, which are the applications that connect to those servers and use what they offer. Both packages run on Node.js, Bun, and Deno. There are also optional thin adapter packages for wiring MCP servers into popular web frameworks like Express or Hono, if you are already using one of those. A simple MCP server created with this SDK registers named tools with defined input shapes, then listens for requests over a transport such as standard input/output or HTTP. The README includes a short working example of a greeting server to illustrate the pattern, as well as pointers to quickstart tutorials for building a weather server and an AI-powered chatbot client. The main branch at this time contains version 2 of the SDK, which is still in pre-release development. Version 1 remains the recommended choice for production use and will continue receiving bug fixes for at least six months after version 2 reaches a stable release. Documentation for both versions is hosted separately, with the v1 source living on a dedicated branch. The project is open to contributions via GitHub issues and pull requests. Existing code is licensed under MIT, new contributions fall under the Apache License 2.0.

Copy-paste prompts

Prompt 1
Using the MCP TypeScript SDK, show me how to create a server that exposes a tool which fetches live weather data for a given city
Prompt 2
How do I build an MCP client with the TypeScript SDK that connects to a local server over stdio and calls its tools?
Prompt 3
Help me add @modelcontextprotocol/sdk to my existing Express app so it can act as an MCP server
Prompt 4
What is the difference between MCP SDK v1 and v2, and which should I use for a production app right now?
Prompt 5
Show me how to define a typed tool input schema in an MCP TypeScript server and handle the incoming request
Open on GitHub → Explain another repo

← modelcontextprotocol on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.