Skip to content
Agents tracked: 506 Releases (7d): 634 Agent status: 4 with issuesSince last limit reset: Claude 15d · Codex 0d For AI agents: Markdown Updated Nov 26, 2026

Model Context Protocol SDK (JavaScript)

TypeScript SDK for building MCP servers and clients to extend AI agent capabilities.

Agent, MCP and tool librariesNPM

GitHubWebsite

From the package registry and GitHub, checked daily. Tap a verdict to see its source.How we checkedReport an error

What Model Context Protocol SDK (JavaScript) does

The npm package <code>@modelcontextprotocol/sdk</code> is now the v1 line of the official TypeScript MCP SDK: new work goes to the split v2 packages <code>@modelcontextprotocol/server</code> and <code>@modelcontextprotocol/client</code>, and the maintainers ship a codemod that moves v1 code across.

Model Context Protocol SDK (JavaScript) popularity

82 / 100
Gid Score, #70 overall
93.8M
downloads a week, npm
13.8K
GitHub stars
600
agent projects use it
Model Context Protocol SDK (JavaScript): downloads per weeknpm, @modelcontextprotocol/sdk 93,779,332
Model Context Protocol SDK (JavaScript): GitHub starsmodelcontextprotocol/typescript-sdk 13,814

Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated

How Model Context Protocol SDK (JavaScript) is used

  • Model Context Protocol SDK (JavaScript) is a dependency in 600 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (12.3% of the 4,867 JavaScript/TypeScript ones), #1 of 192 in agent, mcp and tool libraries.
  • Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 1,449; those are left out of every share on this page.
  • The most used alternative in our scan is fastMCP (JavaScript) (32 projects).
  • Projects that use it most often also use Zod (70.3%), TypeScript (81.5%), tsx (40.3%).
  • It is more common in projects set up for GitHub Copilot (10.5%) than for Devin Desktop (5.7%).

By coding agent

318 projects, 10.5%
302 projects, 9.2%
187 projects, 7.7%
45 projects, 9.5%
38 projects, 8.1%
34 projects, 10.2%
28 projects, 8.2%
16 projects, 5.7%

Often used with

In 70.3% of its projects
In 81.5% of its projects
In 40.3% of its projects
In 22.7% of its projects
In 35.3% of its projects
In 28.8% of its projects
In 13.8% of its projects
In 11.3% of its projects

Model Context Protocol SDK (JavaScript) in practice

Strengths

Inputs are checked before your handler runs

You declare a tool's input with a <code>z.object(...)</code> schema. The docs say the SDK checks every call against that schema before your handler is invoked.

Not tied to Zod

Tool and prompt schemas use Standard Schema. The README says you can use Zod v4, Valibot, ArkType or any compatible library.

One SDK across Node.js, Bun and Deno

The docs present this SDK as the TypeScript implementation of the MCP spec. It runs on Node.js, Bun and Deno, and the llms.txt index adds Workers.

Examples are tested in CI

Every example is a full client–server pair. CI runs each one on every pull request. <code>cli-client/</code> and <code>todos-server/</code> are the reference pair: a full LLM chat host and the server it drives.

Watch out for

This package is the legacy line

<code>@modelcontextprotocol/sdk</code> is v1 and lives on the <code>v1.x</code> branch. The README promises bug fixes and security updates for at least six months after the v2 release.

The codemod stops at the API surface

Adopting the 2026-07-28 protocol revision is a separate, manual job. That covers <code>createMcpHandler</code>, multi-round-trip requests and <code>versionNegotiation</code>.

Injected SDK code breaks at runtime

The codemod only rewrites files that import the SDK. Code that receives the SDK as a parameter keeps its v1 idioms. Those idioms then fail at runtime, not at compile time.

A minimal stdio server with one tool (v2 packages)

import { McpServer } from '@modelcontextprotocol/server';
import { StdioServerTransport } from '@modelcontextprotocol/server/stdio';
import * as z from 'zod/v4';

const server = new McpServer({ name: 'greeting-server', version: '1.0.0' });

server.registerTool(
  'greet',
  {
    description: 'Greet someone by name',
    inputSchema: z.object({ name: z.string() })
  },
  async ({ name }) => ({ content: [{ type: 'text', text: `Hello, ${name}!` }] })
);

async function main() {
  const transport = new StdioServerTransport();
  await server.connect(transport);
}

main();

More about Model Context Protocol SDK (JavaScript)

Packages around it
  • @modelcontextprotocol/server: v2 server package
  • @modelcontextprotocol/inspector: @modelcontextprotocol/inspector
  • @modelcontextprotocol/client: v2 client package
  • @modelcontextprotocol/ext-apps: @modelcontextprotocol/ext-apps
  • @modelcontextprotocol/server-filesystem: Reference filesystem server
  • @modelcontextprotocol/node: Node.js HTTP transport adapter
More in Agent, MCP and tool libraries

Alternatives

Model Context Protocol SDK (JavaScript) This page

MITGid 8293.8M/wk

fastMCP (JavaScript)

TypeScript framework for building Model Context Protocol servers.

MITGid 47685K/wk

Compare Model Context Protocol SDK (JavaScript) with another tool

Get started

Install it.

npm install @modelcontextprotocol/sdk

Rules for your agent

Paste into AGENTS.md or CLAUDE.md
## MCP TypeScript SDK
- For new code, install `@modelcontextprotocol/server` or `@modelcontextprotocol/client` (v2). `@modelcontextprotocol/sdk` is the v1 package.
- Define a tool with `registerTool(name, config, handler)` and a `z.object(...)` `inputSchema`. Serve it over stdio with `serveStdio`.
- Import types and error classes from the client or server package you depend on. Never import `@modelcontextprotocol/core-internal`.
- To upgrade v1 code, run `npx @modelcontextprotocol/codemod@latest v1-to-v2 .` at the package root, not `./src`. Then run `grep -rn '@mcp-codemod-error' .` and `tsc --noEmit`, and run the formatter on the changed files.
- Grep files that receive the SDK by injection for `setRequestHandler(`, `ErrorCode.` and `extra.`. The codemod skips them, and they fail at runtime.
- Report tool failures as a successful result with `isError: true`, so the model can read the error and recover.
- Fetch docs as markdown: every page in `https://ts.sdk.modelcontextprotocol.io/v2/llms.txt` is served at its `.md` URL.