Packages
@prefecthq/fastmcp-ts 1.11.0 vs. @modelcontextprotocol/server 2.4.0: TypeScript MCP Architecture and Dependency Trade-Offs
Published November 23, 2026, @prefecthq/fastmcp-ts 1.11.0 builds on the official v2 TypeScript MCP SDK (@modelcontextprotocol/server 2.4.0) to add middleware, JWT verification, server composition, and dual-era 2025/2026-07-28 negotiation. Here is how both packages compare on npm download velocity, dependency footprint, TypeScript 6/7 tsconfig gotchas, and bearer-auth implementation.
7 min read
@prefecthq/fastmcp-ts 1.11.0 vs. @modelcontextprotocol/server 2.4.0: TypeScript MCP Architecture and Dependency Trade-Offs
Executive Summary
- Featured Packages:
@prefecthq/fastmcp-ts(v1.11.0, published November 23, 2026) and@modelcontextprotocol/server(v2.4.0) - Ecosystem & Runtime Floor: TypeScript / Node.js (
engines >= 20, ESM"type": "module", TypeScript>= 6.0requiring"types": ["node"]intsconfig.json) - Verification Date: November 23, 2026
- AI & Agent Relevance: Core TypeScript server, client, and interactive-app packages implementing the
2026-07-28Model Context Protocol (MCP) specification - Primary Takeaway:
@modelcontextprotocol/server2.4.0is the official, minimal-dependency (2dependencies) v2 protocol layer replacing the monolithic v1@modelcontextprotocol/sdk, while@prefecthq/fastmcp-ts1.11.0builds directly on top of v2 to add Standard Schema support (Zod, Valibot, ArkType), middleware,createProxy(), dual-era (2025+2026-07-28) negotiation, and interactiveFastMCPAppUI components.
TypeScript teams building MCP servers in late 2026 face a split ecosystem. Many tutorials still reference the deprecated v1 monolith @modelcontextprotocol/sdk (1.32.2), whereas the official v2 line (shipped July 27, 2026) split server, client, and HTTP framework adapters into scoped packages. Meanwhile, Prefect's @prefecthq/fastmcp-ts (1.11.0, published November 23, 2026) wraps those scoped v2 packages into an opinionated application framework mirroring Python's FastMCP.
Adoption Telemetry and Version Changelog
Package registry data from npm (verified November 23, 2026) shows the scale gap between the foundational protocol SDK and the higher-level framework layer:
@modelcontextprotocol/server(v2.4.0): Records 33,946,422 weekly downloads, 4,256 dependents, and just 2 direct dependencies under an Apache-2.0 license (npm).@prefecthq/fastmcp-ts(v1.11.0): Published November 23, 2026, recording 21,457 weekly downloads, 9 dependents, and 18 dependencies under an Apache-2.0 license (npm). It depends directly on@modelcontextprotocol/server,@modelcontextprotocol/client, and@modelcontextprotocol/ext-apps.- Schema Layer (
zod): As documented in Maulik Joshi's November 21–22, 2026 TypeScript MCP build,zod(4.6.7, imported viazod/v4) remains the standard input-validation dependency across both ecosystems, recording 475.49 million weekly npm downloads as of November 22, 2026 (Tally).
Key Architectural Milestones in the v2 TypeScript Transition
- SDK v1 to v2 Split (July 27, 2026): The single
@modelcontextprotocol/sdkpackage (1.32.2) entered maintenance mode (receiving bug and security fixes for at least six months), replaced by@modelcontextprotocol/server,@modelcontextprotocol/client, and optional adapters (@modelcontextprotocol/express2.0.2,@modelcontextprotocol/node2.1.2,@modelcontextprotocol/fastify,@modelcontextprotocol/hono). - API Renaming (
server.tool->registerTool): Tutorials importing@modelcontextprotocol/sdkand callingserver.tool(...)target v1. In@modelcontextprotocol/server2.4.0, tools are registered viaserver.registerTool(name, { description, inputSchema, annotations }, handler)inside acreateServer()factory. - Dual-Era Negotiation in
@prefecthq/fastmcp-ts1.x: FastMCP TS1.x(1.11.0) serves both the2025legacy MCP era and the2026-07-28modern era simultaneously, while itsClientprobes once at connect and falls back to legacy automatically (or opts out withversionNegotiation: { mode: 'legacy' }).
Architecture, Breaking Changes, and Internals
Understanding where @modelcontextprotocol/server stops and @prefecthq/fastmcp-ts begins prevents over-engineering small tools—or under-architecting production gateways.
1. Official SDK v2.4.0: Per-Request Factories, Auth Gates, and Logging
In @modelcontextprotocol/server 2.4.0, HTTP deployments use createMcpHandler(createServer) (wrapped by toNodeHandler from @modelcontextprotocol/node and createMcpExpressApp() from @modelcontextprotocol/express). Crucially:
- Per-Request Server Factory:
createServer()is invoked per HTTP request or stdio session rather than sharing a mutable global server instance. - DNS Rebinding Protection:
createMcpExpressApp()automatically enforcesHostandOriginheader validation when bound to127.0.0.1(returning403 Invalid Hoston mismatched headers). Binding to0.0.0.0requires explicitallowedHostsconfiguration. - Bearer Auth Expiry Requirement: The
requireBearerAuthmiddleware from@modelcontextprotocol/expressrejects any verified token object that omitsexpiresAtwith401 Token has no expiration time—even for static API keys, which must return a synthetic futureexpiresAtalongside a redacted token string. - Logging Deprecation in
2026-07-28: SDK-level MCP log notifications are marked deprecated in the2026-07-28specification; servers should write structured JSON lines tostderr(neverstdout, which corruptsstdioJSON-RPC streams) or export OpenTelemetry traces.
2. @prefecthq/fastmcp-ts 1.11.0: Middleware, Proxies, and Standard Schema
@prefecthq/fastmcp-ts wraps the v2 SDK with ergonomic primitives designed for multi-server gateways and rich UI apps:
- Standard Schema Support: Accepts Zod, Valibot, ArkType, or any Standard Schema-compatible validator in
server.tool({ input: ... }). - Built-In Middleware & JWT: Ships
LoggingMiddleware,RateLimitingMiddleware, andjwtVerifier({ jwksUri, issuer, audience })out of the box. - Composition & Proxying:
createProxy({ type: 'http', url: ... })andgateway.mount(service, 'prefix')compose remote and local servers under unified namespacing (prefix_tool_name). - CLI & Interactive Apps: Bundles the
fastmcpCLI (fastmcp inspect,fastmcp call,fastmcp install claude-code|cursor|claude-desktop) andFastMCPApp/GenerativeUIcomponents (Approval,Choice,FileUpload,FormInput).
Here is a minimal, verified TypeScript server snippet using @prefecthq/fastmcp-ts/server with Zod validation, JWT verification, and rate-limiting middleware:
import {
FastMCP,
LoggingMiddleware,
RateLimitingMiddleware,
jwtVerifier,
} from '@prefecthq/fastmcp-ts/server';
import { z } from 'zod';
const server = new FastMCP({
name: 'secure-gateway',
version: '1.0.0',
auth: jwtVerifier({
jwksUri: 'https://auth.example.com/.well-known/jwks.json',
issuer: 'https://auth.example.com',
audience: 'my-mcp-server',
}),
});
server.use(new LoggingMiddleware());
server.use(new RateLimitingMiddleware(100, 60_000));
server.tool(
{
name: 'health_check',
description: 'Return service status',
input: z.object({ verbose: z.boolean().default(false) }),
},
({ verbose }) => (verbose ? 'ok:2026-07-28' : 'ok')
);
await server.run({ transport: 'http', port: 3000 });
Ecosystem Comparison and Upgrade Checklist
| Attribute | @prefecthq/fastmcp-ts (1.11.0) |
@modelcontextprotocol/server (2.4.0) |
@modelcontextprotocol/sdk (1.32.2) |
|---|---|---|---|
| Status (Nov 23, 2026) | Active (1.11.0 published Nov 23, 2026) |
Active stable v2 line | Legacy maintenance mode (fixes only) |
| Weekly npm Downloads | 21,457 |
33,946,422 |
Legacy v1 bundle |
| Direct Dependencies | 18 (9 dependents) |
2 (4,256 dependents) |
Monolithic |
| MCP Spec Support | 2026-07-28 + 2025 dual-era |
2026-07-28 |
2025 legacy era |
| Schema Validation | Standard Schema (Zod, Valibot, ArkType) | Zod (zod/v4) |
Zod |
| Auth & Middleware | Built-in jwtVerifier, RateLimitingMiddleware, LoggingMiddleware |
requireBearerAuth via @modelcontextprotocol/express |
Manual Express wiring |
| Proxying & Apps | createProxy(), mount(), FastMCPApp, GenerativeUI |
Bring your own or @modelcontextprotocol/ext-apps |
Manual |
| License | Apache-2.0 | Apache-2.0 | MIT / Apache-2.0 |
Safe Upgrade & Pinning Checklist
- Add
"types": ["node"]on TypeScript>= 6.0: Both@modelcontextprotocol/server2.4.0and v2-backed projects using TypeScript6.0/7.0(7.0.2) no longer auto-include@types/*; add"types": ["node"]and"module": "NodeNext"intsconfig.json, and set"type": "module"inpackage.json. - Pin
@modelcontextprotocol/inspector@2.16.0for CLI Testing: Unpinnednpx @modelcontextprotocol/inspectorcan resolve to older cached versions (such as0.15.0) that reject URL-based MCP server flags. Pin@2.16.0explicitly when testing HTTP endpoints. - Never Log to
stdoutinstdioServers: Keep all structured JSON logs onstderrand redact keys matching/authorization|token|secret|api[-_]?key|password/i. - Enforce
expiresAtin Custom Token Verifiers: When using@modelcontextprotocol/express'srequireBearerAuth, always populateexpiresAton the returnedAuthInfoobject or valid keys will fail with HTTP401. - Choose Based on Dependency Budget: Pick
@modelcontextprotocol/server2.4.0for minimal, 2-dependency microservices with custom Express/Hono/Fastify wiring; pick@prefecthq/fastmcp-ts1.11.0when you need middleware, JWT verification, server proxying, dual-era client negotiation, or interactiveFastMCPAppUIs out of the box.
Frequently Asked Questions
1. Should new TypeScript MCP projects install @modelcontextprotocol/sdk or @modelcontextprotocol/server?
Install @modelcontextprotocol/server (2.4.0). @modelcontextprotocol/sdk (1.32.2) is the legacy v1 package in maintenance mode, whereas v2 splits server, client, and framework adapters into scoped packages implementing the 2026-07-28 specification.
2. How does @prefecthq/fastmcp-ts relate to @modelcontextprotocol/server?
@prefecthq/fastmcp-ts (1.11.0) is built directly on top of @modelcontextprotocol/server, @modelcontextprotocol/client, and @modelcontextprotocol/ext-apps, adding middleware, Standard Schema support, server proxying, dual-era negotiation, and a CLI.
3. Why does TypeScript 6.0 or 7.0 fail to compile @modelcontextprotocol/server 2.4.0?
TypeScript >= 6.0 no longer auto-includes @types/* packages, and @modelcontextprotocol/server's .d.mts declarations reference Buffer. Add "types": ["node"] to compilerOptions in tsconfig.json and install @types/node.
4. Why does requireBearerAuth return 401 Token has no expiration time for an API key?
The v2 SDK's requireBearerAuth middleware requires expiresAt on the AuthInfo object returned by verifyAccessToken(). Set a short rolling expiresAt timestamp (e.g., Math.floor(Date.now() / 1000) + 60) even for static API keys.
5. Can @prefecthq/fastmcp-ts 1.11.0 talk to legacy 2025-era MCP servers?
Yes. Its Client probes the server once at connect to use 2026-07-28 when available and falls back to the 2025 legacy era automatically, or you can force legacy mode via versionNegotiation: { mode: 'legacy' }.
Sources
- npm —
@prefecthq/fastmcp-ts(Primary Registry) — Version 1.11.0, published November 23, 2026 (21,457 weekly downloads, Apache-2.0): https://www.npmjs.com/package/@prefecthq/fastmcp-ts (Verified November 23, 2026) - npm —
@modelcontextprotocol/server(Primary Registry) — Version 2.4.0 (33,946,422 weekly downloads, 4,256 dependents, 2 dependencies, TypeScript >= 6.0 note): https://www.npmjs.com/package/@modelcontextprotocol/server (Verified November 23, 2026) - Maulik.dev (Secondary Implementation Guide) — Build an MCP server in TypeScript: three tools, API key, logging by Maulik Joshi (tested on
@modelcontextprotocol/server2.4.0,zod4.6.7,typescript7.0.2,inspector2.16.0): https://www.maulik.dev/blog/build-mcp-server-typescript-api-key-auth-logging (Published November 21, 2026; checked November 22, 2026) - Tally Catalog (Secondary Package Telemetry) — Zod weekly npm downloads in 2026 (475.49M on November 22, 2026): https://tallycatalog.com/c/zod/npm-downloads-weekly/2026 (Published November 21, 2026)