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.

By 0xScorPionSon

7 min read

@prefecthq/fastmcp-ts 1.11.0 vs. @modelcontextprotocol/server 2.4.0: TypeScript MCP Architecture and Dependency Trade-Offs

fastmcp-ts 1.11 vs MCP SDK v2.4.0 architecture showing Zod / Standard Schema, FastMCP-TS 1.11.0, MCP SDK v2.4.0, Middleware & Proxy, Bearer Auth Gate, and Dual-Era Negotiation

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.0 requiring "types": ["node"] in tsconfig.json)
  • Verification Date: November 23, 2026
  • AI & Agent Relevance: Core TypeScript server, client, and interactive-app packages implementing the 2026-07-28 Model Context Protocol (MCP) specification
  • Primary Takeaway: @modelcontextprotocol/server 2.4.0 is the official, minimal-dependency (2 dependencies) v2 protocol layer replacing the monolithic v1 @modelcontextprotocol/sdk, while @prefecthq/fastmcp-ts 1.11.0 builds directly on top of v2 to add Standard Schema support (Zod, Valibot, ArkType), middleware, createProxy(), dual-era (2025 + 2026-07-28) negotiation, and interactive FastMCPApp UI 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 via zod/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

  1. SDK v1 to v2 Split (July 27, 2026): The single @modelcontextprotocol/sdk package (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/express 2.0.2, @modelcontextprotocol/node 2.1.2, @modelcontextprotocol/fastify, @modelcontextprotocol/hono).
  2. API Renaming (server.tool -> registerTool): Tutorials importing @modelcontextprotocol/sdk and calling server.tool(...) target v1. In @modelcontextprotocol/server 2.4.0, tools are registered via server.registerTool(name, { description, inputSchema, annotations }, handler) inside a createServer() factory.
  3. Dual-Era Negotiation in @prefecthq/fastmcp-ts 1.x: FastMCP TS 1.x (1.11.0) serves both the 2025 legacy MCP era and the 2026-07-28 modern era simultaneously, while its Client probes once at connect and falls back to legacy automatically (or opts out with versionNegotiation: { 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 enforces Host and Origin header validation when bound to 127.0.0.1 (returning 403 Invalid Host on mismatched headers). Binding to 0.0.0.0 requires explicit allowedHosts configuration.
  • Bearer Auth Expiry Requirement: The requireBearerAuth middleware from @modelcontextprotocol/express rejects any verified token object that omits expiresAt with 401 Token has no expiration time—even for static API keys, which must return a synthetic future expiresAt alongside a redacted token string.
  • Logging Deprecation in 2026-07-28: SDK-level MCP log notifications are marked deprecated in the 2026-07-28 specification; servers should write structured JSON lines to stderr (never stdout, which corrupts stdio JSON-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, and jwtVerifier({ jwksUri, issuer, audience }) out of the box.
  • Composition & Proxying: createProxy({ type: 'http', url: ... }) and gateway.mount(service, 'prefix') compose remote and local servers under unified namespacing (prefix_tool_name).
  • CLI & Interactive Apps: Bundles the fastmcp CLI (fastmcp inspect, fastmcp call, fastmcp install claude-code|cursor|claude-desktop) and FastMCPApp / GenerativeUI components (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

  1. Add "types": ["node"] on TypeScript >= 6.0: Both @modelcontextprotocol/server 2.4.0 and v2-backed projects using TypeScript 6.0/7.0 (7.0.2) no longer auto-include @types/*; add "types": ["node"] and "module": "NodeNext" in tsconfig.json, and set "type": "module" in package.json.
  2. Pin @modelcontextprotocol/inspector@2.16.0 for CLI Testing: Unpinned npx @modelcontextprotocol/inspector can resolve to older cached versions (such as 0.15.0) that reject URL-based MCP server flags. Pin @2.16.0 explicitly when testing HTTP endpoints.
  3. Never Log to stdout in stdio Servers: Keep all structured JSON logs on stderr and redact keys matching /authorization|token|secret|api[-_]?key|password/i.
  4. Enforce expiresAt in Custom Token Verifiers: When using @modelcontextprotocol/express's requireBearerAuth, always populate expiresAt on the returned AuthInfo object or valid keys will fail with HTTP 401.
  5. Choose Based on Dependency Budget: Pick @modelcontextprotocol/server 2.4.0 for minimal, 2-dependency microservices with custom Express/Hono/Fastify wiring; pick @prefecthq/fastmcp-ts 1.11.0 when you need middleware, JWT verification, server proxying, dual-era client negotiation, or interactive FastMCPApp UIs 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

  1. 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)
  2. 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)
  3. Maulik.dev (Secondary Implementation Guide) — Build an MCP server in TypeScript: three tools, API key, logging by Maulik Joshi (tested on @modelcontextprotocol/server 2.4.0, zod 4.6.7, typescript 7.0.2, inspector 2.16.0): https://www.maulik.dev/blog/build-mcp-server-typescript-api-key-auth-logging (Published November 21, 2026; checked November 22, 2026)
  4. 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)

More on Packages

Tell us what is not working

A thirty-minute call, no deck and no obligation. You will leave with a straight answer about whether this is worth building - including if that answer is no.

Start a project

Direct line

hello@codebumble.net
Dhaka, Bangladesh  :   local timeCalls in English or Bangla