MCP Catalogs
Home

fastify-mcp

by haroldadmin·27·Score 44

A Fastify plugin that enables running MCP servers with Streamable HTTP and HTTP+SSE transports.

developer-toolsai-llmops-infra
6
Forks
2
Open issues
this month
Last commit
2d ago
Indexed

Overview

fastify-mcp provides a straightforward integration between Fastify applications and the Model Context Protocol. It supports both the newer Streamable HTTP transport and legacy HTTP+SSE transport options, allowing developers to embed MCP functionality directly into their Fastify-based services. The package includes comprehensive session management capabilities, with an in-memory mapping system that handles multiple active sessions as recommended by the official MCP TypeScript SDK documentation.

Try asking AI

After installing, here are 5 things you can ask your AI assistant:

you:Embedding MCP tools and resources directly into Fastify web applications
you:Creating MCP-enabled APIs that expose AI capabilities via HTTP endpoints
you:Building stateful MCP servers that maintain session information for clients
you:What session management options are available?
you:Which MCP transports are supported?

When to choose this

Choose fastify-mcp when building Fastify-based applications that need to expose MCP functionality, especially if you need both stateful and stateless server modes with session management.

When NOT to choose this

Not recommended if you're not using Fastify as your web framework, or if you need MCP server features beyond tools and resources like advanced prompt capabilities.

Comparable tools

mcp-serverserver-sse-mcp@modelcontextprotocol/sdk

Installation

# npm
npm install fastify-mcp

# yarn
yarn add fastify-mcp

To use with Claude Desktop, add to claude_desktop_config.json:

{
  "mcpServers": {
    "fastify-mcp": {
      "command": "node",
      "args": ["path/to/your/fastify-server.js"]
    }
  }
}

FAQ

What session management options are available?
The package includes a Sessions class that manages multiple active sessions using an in-memory mapping. It emits events for connection, termination, and errors.
Which MCP transports are supported?
Both the Streamable HTTP transport and legacy HTTP+SSE transport are supported according to the MCP specification.

Compare fastify-mcp with

GitHub →

Last updated · Auto-generated from public README + GitHub signals.