MCP TypeScript SDK
Understand how the SDK equips AI agents, verify npm figures, and decide when to prefer MCP over a CLI or direct integration.
Understand how the SDK equips AI agents, verify npm figures, and decide when to prefer MCP over a CLI or direct integration.
Question: when is it useful to expose a business capability to AI agents through MCP rather than having them call a CLI or API directly? The official TypeScript SDK makes it easier to create an MCP server or client. It does not improve the model itself: through its host application, it gives the model a standardized way to obtain data or trigger an operation defined by the server.
The four figures cited in the LinkedIn post can be reproduced, to rounding, by adding the download counts for three official packages. The table links point to the public npm downloads API, queried for each complete calendar month, inclusive of both endpoints. The historical v1 package is named @modelcontextprotocol/sdk; the stable v2 separates server and client into two packages.
| Month 2026 | sdk (v1) |
server (v2) |
client (v2) |
Total | Cited figure |
|---|---|---|---|---|---|
| February | 71 656 771 | 0 | 0 | 71 656 771 | 71.7 M |
| March | 141 911 796 | 0 | 0 | 141 911 796 | 141.9 M |
| October | 324 524 213 | 66 022 420 | 45 776 457 | 436 323 090 | 436.3 M |
| November | 378 566 920 | 131 603 143 | 84 255 007 | 594 425 070 | 594.4 M |
What is verified: npm volume increases across all four months, including for the v1 package alone, which rises from 71.7 to 378.6 million between February and November. Therefore, the 594.4 million figure is not for the sdk package alone.
What the measurement does not tell us: npm counts archives served, including those served to CI, mirrors, and bots. A single build can download several of the three packages, while a reinstall from cache may add no downloads. This is a distribution signal, not a measure of unique users, MCP calls in production, or agent effectiveness. These figures are not enough to settle the slogan “MCP is dead.”
@modelcontextprotocol/server, you register executable tools (registerTool), resources retrievable by URI (for example, an operating procedure), and reusable prompts. For a tool, the SDK exposes a JSON schema to the client, validates arguments at runtime, and lets the server return a structured result with outputSchema and structuredContent. Business logic remains in the handler or the service it calls. Tool guide · Protocol primitives@modelcontextprotocol/client, an application can connect to a server, discover its tools, among other things, and invoke them. If the agent already runs in a compatible host, that host provides the client: you do not need to write one for each server. First client · Integration with VS Code, Claude Code, and Cursorstdio suits a local process launched by the host; Streamable HTTP supports a shared remote service. The SDK’s npm version alone does not tell you which protocol revision it serves: in v2, serveStdio and createMcpHandler can serve both 2025 clients and revision 2026-07-28, unlike the older transport entry points. Test the target host and transport before deployment. Protocol versions · Migration guidesequenceDiagram
participant H as MCP host and client
participant M as Model
participant S as TypeScript MCP server
H->>S: tools/list
S-->>H: Tools and JSON schemas
H->>M: Question and available tools
M-->>H: Tool call request with arguments
H->>S: tools/call after approval if required
S->>S: Validate, then run handler
S-->>H: Tool result
H->>M: Result to use
Flow documented by the SDK integration guide: the model proposes the call, the host sends it, and the server runs the business logic.
| Need | Example | Expected benefit, not measured |
|---|---|---|
| Get an up-to-date fact | For “Is release 1.4 ready?”, a tool receives the version and returns CI status, blocking checks, and their links. | Less manual research and a verifiable answer from the sources, if the service returns fresh data. |
| Apply the same rules everywhere | A lookup tool returns only the checks for the repository the user can access, regardless of host. | One implementation of filtering and return format, instead of different recipes for every host. |
| Reuse an integration | The same server is configured in two hosts used by the team. | One tool contract to maintain; configuration, approvals, and presentation remain specific to each host. |
Compared with a CLI or direct API. A CLI with JSON output is often the simplest route for one agent that already has a shell and a reliable command. A direct function call is enough when you control a single host application. MCP becomes interesting when multiple hosts need to discover and invoke the same operations, or when you want to expose a focused business interface instead of generic access. It replaces neither the business API behind the server nor the LSP for code navigation: to get TypeScript definitions and references, use the host’s native LSP when available. An MCP bridge to an LSP would be a separate server, not a capability of the SDK.
Limitations. Schema validation checks the shape of arguments, not permission to access a repository or whether a call is appropriate. Apply least privilege on the server, keep tokens out of the model’s context, and treat retrieved descriptions and comments as untrusted data, not instructions. For writes, enforce authorization on the server and provide explicit approval. The protocol guarantees neither that a host exposes every primitive nor that the model chooses the right tool. A catalogue that is too large or responses that are too long can also consume context; the benefit needs to be measured. Protocol scope · Security best practices
Take a recurring request, such as release status, and expose the same logic through a TypeScript MCP v2 tool over stdio and a JSON CLI. Prepare three cases with reference answers: all checks passing, a blocking check, and a repository outside the user’s scope. Compare the CLI and MCP in the same host with the same model and prompt, then check whether the server works in a second host without rewriting the handler. Record answer and link accuracy, number of calls, latency, and, if the host exposes it, token cost. The out-of-scope case must return no repository data.
Adopt MCP if the same server is useful in both hosts and maintains at least the CLI’s quality without disproportionate operational cost. Otherwise, keep the CLI. This pilot is proposed, not run: the npm figures were verified and the SDK capabilities come from its official documentation.