Skip to content
PluginStats

@modelcontextprotocol/fastify weekly downloads statistics

By modelcontextprotocol (8 listings) · npm · MCP servers

Fastify adapters for the Model Context Protocol TypeScript server SDK - Fastify middleware

View on npm Fresh · Oct 18, 2026

@modelcontextprotocol/fastify has 47,248 recorded weekly downloads on npm, an increase of 162% over the past 30 days, ranking #604 of 2,322 tracked listings.

Weekly downloads
47,248
Official API · Oct 18, 2026
7-day growth
+19.8%
+7.8K weekly downloads
30-day growth
+162%
+29.2K weekly downloads
90-day growth
+1978%
+45K weekly downloads
Rank
#604
Among tracked npm listings

About @modelcontextprotocol/fastify

@modelcontextprotocol/fastify

Fastify adapters for the MCP TypeScript server SDK.

This package is a thin Fastify integration layer for @modelcontextprotocol/server.

It does not implement MCP itself. Instead, it helps you:

  • create a Fastify app with sensible defaults for MCP servers
  • add DNS rebinding protection via Host header validation (recommended for localhost servers)

Install

npm install @modelcontextprotocol/server @modelcontextprotocol/fastify fastify

# For MCP Streamable HTTP over Node.js (IncomingMessage/ServerResponse):
npm install @modelcontextprotocol/node

Exports

  • createMcpFastifyApp(options?)
  • hostHeaderValidation(allowedHostnames)
  • localhostHostValidation()

Usage

Create a Fastify app (localhost DNS rebinding protection by default)
import { createMcpFastifyApp } from '@modelcontextprotocol/fastify';

const app = createMcpFastifyApp(); // default host is 127.0.0.1; protection enabled
Streamable HTTP endpoint (Fastify)
import { createMcpFastifyApp } from '@modelcontextprotocol/fastify';
import { NodeStreamableHTTPServerTransport } from '@modelcontextprotocol/node';
import { McpServer } from '@modelcontextprotocol/server';

const app = createMcpFastifyApp();

app.post('/mcp', async (request, reply) => {
    // Stateless example: create a server and a transport per request (with sessions: one pair per session).
    const mcpServer = new McpServer({ name: 'my-server', version: '1.0.0' });
    const transport = new NodeStreamableHTTPServerTransport({ sessionIdGenerator: undefined });
    await mcpServer.connect(transport);

    // Clean up when the client closes the connection (e.g. during SSE streaming).
    reply.raw.on('close', () => {
        transport.close();
        mcpServer.close();
    });

    await transport.handleRequest(request.raw, reply.raw, request.body);
});

To reject non-POST requests with 405 Method Not Allowed, add routes for GET and DELETE that send a JSON-RPC error response.

Host header validation (DNS rebinding protection)
import { hostHeaderValidation } from '@modelcontextprotocol/fastify';

app.addHook('onRequest', hostHeaderValidation(['localhost', '127.0.0.1', '[::1]']));

Description from the npm listing.

  • modelcontextprotocol
  • mcp
  • fastify
  • middleware

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

@modelcontextprotocol/fastify weekly downloads on npm, last 90 days: 47,248 weekly downloads as of Oct 18, 2026, +1978% over 90 days.@modelcontextprotocol/fastifyWeekly downloads on npm · Last 90 days47,248downloads / week+1978% over 90 days010K20K30K40K50KJul 20Aug 4Aug 19Sep 3Sep 18Oct 3Oct 18downloads / weekobservedarchived (Internet Archive)no observationsJul 22, 2026 – Oct 18, 2026 · 89 observations · Updated Oc…pluginstats.com
@modelcontextprotocol/fastify weekly downloads on npm, last 90 days: 47,248 weekly downloads as of Oct 18, 2026, +1978% over 90 days.

7/30/90-day growth

@modelcontextprotocol/fastify weekly downloads growth on npm: +19.8% over 7 days, +162% over 30 days, +1978% over 90 days.@modelcontextprotocol/fastifyWeekly downloads growth on npm47,248downloads / week now7-day growth+7,802 weekly downloads+19.8%30-day growth+29,228 weekly downloads+162%90-day growth+44,974 weekly downloads+1978%Growth vs. nearest observation to each baseline date · Updated Oct 18, 2026pluginstats.com
@modelcontextprotocol/fastify weekly downloads growth on npm: +19.8% over 7 days, +162% over 30 days, +1978% over 90 days.

Ranking history

@modelcontextprotocol/fastify npm ranking history: currently #604 (by weekly downloads).@modelcontextprotocol/fastifynpm ranking · by weekly downloads · Last 90 days#604current rank#600#610#620#630#640#650#660Jul 22Aug 6Aug 21Sep 5Sep 20Oct 5Oct 20rankOct 18, 2026 – Oct 20, 2026 · 3 observations · Updated Oct 18, 2026pluginstats.com
@modelcontextprotocol/fastify npm ranking history: currently #604 (by weekly downloads).

Listing placement

All npm2,320 listings · 116 pages · 1,162 shown · page 31, #4 (overall #604)
All npm: every listing in weekly downloads order

Listing placement

MCP servers277 listings · 14 pages · page 4, #7 (overall #67)
MCP servers: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (122)
Recent weekly downloads observations for @modelcontextprotocol/fastify
Date (UTC)Weekly downloadsChange vs. previous
47,248+15.5K
31,765-4.5K
36,285+7.2K
29,074-8.2K
37,282-6.5K
43,7830
43,783+4.3K
39,446+4.4K
35,001-337
35,338+4.1K
31,191+4K
27,196+1.9K
25,296-4.8K
30,103—

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/@modelcontextprotocol/fastify. First seen Oct 16, 2026; last successful collection Oct 20, 2026. See the methodology.