{
 "kind": "tool",
 "slug": "modelcontextprotocol",
 "path": "tools/modelcontextprotocol/",
 "name": "Model Context Protocol SDK (JavaScript)",
 "maker": null,
 "density": "profile",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "Agent, MCP and tool libraries",
   "tools/agent-libraries/"
  ]
 ],
 "lead": "TypeScript SDK for building MCP servers and clients to extend AI agent capabilities.",
 "chips": [
  {
   "label": "Agent, MCP and tool libraries",
   "path": "tools/agent-libraries/"
  },
  {
   "label": "NPM"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "npm install @modelcontextprotocol/sdk"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/modelcontextprotocol/typescript-sdk"
  },
  {
   "label": "Website",
   "href": "https://modelcontextprotocol.io"
  }
 ],
 "track": "New versions, deprecation and license changes on your dashboard",
 "verdicts": [
  {
   "key": "license",
   "label": "License",
   "value": "MIT",
   "status": "yes",
   "sub": "Use it in paid apps",
   "quote": null,
   "note": "License from npm.",
   "src": "https://github.com/modelcontextprotocol/typescript-sdk"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Maintained",
   "status": "yes",
   "sub": "Last change Nov 19, 2026",
   "note": "Latest GitHub release Oct 23, 2026. ",
   "src": "https://github.com/modelcontextprotocol/typescript-sdk"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "600 projects",
   "status": "info",
   "sub": "#1 of 192 in its category",
   "note": "Dependency in 600 public GitHub projects set up for AI coding agents that we scanned (9.6%).",
   "src": null
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Docs for agents",
   "status": "yes",
   "sub": "llms.txt",
   "note": "Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.",
   "src": "https://ts.sdk.modelcontextprotocol.io/v2/llms.txt"
  }
 ],
 "vfoot": "From the package registry and GitHub, checked daily.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What Model Context Protocol SDK (JavaScript) does",
   "parts": [
    {
     "t": "prose",
     "text": "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."
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "Model Context Protocol SDK (JavaScript) popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "82",
       "of": "/ 100",
       "l": "Gid Score, #70 overall"
      },
      {
       "n": "93.8M",
       "l": "downloads a week, npm"
      },
      {
       "n": "13.8K",
       "l": "GitHub stars"
      },
      {
       "n": "600",
       "l": "agent projects use it"
      }
     ]
    },
    {
     "t": "small",
     "text": "Gid Score measures public popularity and activity, not quality.",
     "link": "How the Gid Score is calculated",
     "path": "tools/top/"
    }
   ]
  },
  {
   "id": "usage",
   "nav": "How it is used",
   "h2": "How Model Context Protocol SDK (JavaScript) is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "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%)."
     ]
    },
    {
     "t": "h3",
     "text": "By coding agent"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "318 projects, 10.5%",
       "v": "GitHub Copilot",
       "path": "agents/github-copilot/"
      },
      {
       "l": "302 projects, 9.2%",
       "v": "Claude Code",
       "path": "agents/claude-code/"
      },
      {
       "l": "187 projects, 7.7%",
       "v": "Cursor",
       "path": "agents/cursor/"
      },
      {
       "l": "45 projects, 9.5%",
       "v": "Gemini CLI",
       "path": "agents/gemini-cli/"
      },
      {
       "l": "38 projects, 8.1%",
       "v": "OpenAI Codex",
       "path": "agents/openai-codex/"
      },
      {
       "l": "34 projects, 10.2%",
       "v": "OpenClaw",
       "path": "agents/openclaw/"
      },
      {
       "l": "28 projects, 8.2%",
       "v": "OpenCode",
       "path": "agents/opencode/"
      },
      {
       "l": "16 projects, 5.7%",
       "v": "Devin Desktop",
       "path": "agents/devin-desktop/"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 70.3% of its projects",
       "v": "Zod",
       "path": "tools/zod/"
      },
      {
       "l": "In 81.5% of its projects",
       "v": "TypeScript",
       "path": "tools/typescript/"
      },
      {
       "l": "In 40.3% of its projects",
       "v": "tsx",
       "path": "tools/tsx/"
      },
      {
       "l": "In 22.7% of its projects",
       "v": "Express",
       "path": "tools/express/"
      },
      {
       "l": "In 35.3% of its projects",
       "v": "Vitest",
       "path": "tools/vitest/"
      },
      {
       "l": "In 28.8% of its projects",
       "v": "dotenv",
       "path": "tools/dotenv/"
      },
      {
       "l": "In 13.8% of its projects",
       "v": "Anthropic SDK",
       "path": "tools/anthropic-ai/"
      },
      {
       "l": "In 11.3% of its projects",
       "v": "Commander",
       "path": "tools/commander/"
      }
     ]
    }
   ]
  },
  {
   "id": "profile",
   "nav": "Profile",
   "h2": "Model Context Protocol SDK (JavaScript) in practice",
   "parts": [
    {
     "t": "h3",
     "text": "Strengths"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "Inputs are checked before your handler runs",
       "v": "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."
      },
      {
       "l": "Not tied to Zod",
       "v": "Tool and prompt schemas use Standard Schema. The README says you can use Zod v4, Valibot, ArkType or any compatible library."
      },
      {
       "l": "One SDK across Node.js, Bun and Deno",
       "v": "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."
      },
      {
       "l": "Examples are tested in CI",
       "v": "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."
      }
     ]
    },
    {
     "t": "h3",
     "text": "Watch out for"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "This package is the legacy line",
       "v": "<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."
      },
      {
       "l": "The codemod stops at the API surface",
       "v": "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>."
      },
      {
       "l": "Injected SDK code breaks at runtime",
       "v": "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."
      }
     ]
    },
    {
     "t": "h3",
     "text": "A minimal stdio server with one tool (v2 packages)"
    },
    {
     "t": "tabs",
     "label": "Example",
     "items": [
      {
       "tab": "Typescript",
       "code": "import { McpServer } from '@modelcontextprotocol/server';\nimport { StdioServerTransport } from '@modelcontextprotocol/server/stdio';\nimport * as z from 'zod/v4';\n\nconst server = new McpServer({ name: 'greeting-server', version: '1.0.0' });\n\nserver.registerTool(\n  'greet',\n  {\n    description: 'Greet someone by name',\n    inputSchema: z.object({ name: z.string() })\n  },\n  async ({ name }) => ({ content: [{ type: 'text', text: `Hello, ${name}!` }] })\n);\n\nasync function main() {\n  const transport = new StdioServerTransport();\n  await server.connect(transport);\n}\n\nmain();"
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "profile",
   "h2": "More about Model Context Protocol SDK (JavaScript)",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "Packages around it",
       "items": [
        "@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"
       ]
      },
      {
       "title": "More in Agent, MCP and tool libraries",
       "path": "tools/agent-libraries/",
       "items": [
        {
         "text": "Model Context Protocol SDK (Python)",
         "path": "tools/mcp/"
        },
        {
         "text": "FastMCP (Python)",
         "path": "tools/fastmcp-pypi/"
        },
        {
         "text": "LangChain",
         "path": "tools/langchain-pypi/"
        },
        {
         "text": "LangGraph",
         "path": "tools/langgraph/"
        },
        {
         "text": "Agent Client Protocol SDK",
         "path": "tools/agentclientprotocol-sdk/"
        },
        {
         "text": "LangChain.js",
         "path": "tools/langchain-npm/"
        },
        {
         "text": "Mastra",
         "path": "tools/mastra/"
        },
        {
         "text": "MCP Inspector",
         "path": "tools/modelcontextprotocol-inspector/"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "Model Context Protocol SDK (JavaScript)",
       "me": true,
       "facts": [
        "MIT",
        "Gid 82",
        "93.8M/wk"
       ]
      },
      {
       "name": "fastMCP (JavaScript)",
       "why": "TypeScript framework for building Model Context Protocol servers.",
       "path": "tools/fastmcp-npm/",
       "facts": [
        "MIT",
        "Gid 47",
        "685K/wk"
       ]
      }
     ],
     "more": "Compare Model Context Protocol SDK (JavaScript) with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "install",
     "intro": "Install it.",
     "code": "npm install @modelcontextprotocol/sdk"
    },
    {
     "t": "h3",
     "text": "Rules for your agent"
    },
    {
     "t": "rules",
     "label": "Paste into AGENTS.md or CLAUDE.md",
     "text": "## MCP TypeScript SDK\n- For new code, install `@modelcontextprotocol/server` or `@modelcontextprotocol/client` (v2). `@modelcontextprotocol/sdk` is the v1 package.\n- Define a tool with `registerTool(name, config, handler)` and a `z.object(...)` `inputSchema`. Serve it over stdio with `serveStdio`.\n- Import types and error classes from the client or server package you depend on. Never import `@modelcontextprotocol/core-internal`.\n- 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.\n- Grep files that receive the SDK by injection for `setRequestHandler(`, `ErrorCode.` and `extra.`. The codemod skips them, and they fail at runtime.\n- Report tool failures as a successful result with `isError: true`, so the model can read the error and recover.\n- Fetch docs as markdown: every page in `https://ts.sdk.modelcontextprotocol.io/v2/llms.txt` is served at its `.md` URL.\n"
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "npm @modelcontextprotocol/sdk"
  ],
  [
   "Category",
   "Agent, MCP and tool libraries"
  ],
  [
   "License",
   "MIT"
  ],
  [
   "Latest version",
   "v2.3.1, October 5, 2026"
  ],
  [
   "On GitHub since",
   "September 2024"
  ],
  [
   "Gid Score",
   "81.9"
  ],
  [
   "Rank in category",
   "#1 of 192"
  ],
  [
   "GitHub",
   "modelcontextprotocol/typescript-sdk"
  ],
  [
   "Last change",
   "Nov 19, 2026"
  ]
 ],
 "good": [],
 "checked_line": "From the package registry, GitHub and our scan of public agent projects; numbers update daily.",
 "logo": "https://agentgid.com/media/avatars/modelcontextprotocol.png"
}