fastify-mcp
@haroldadmin
About fastify-mcp
A Fastify plugin to run Model Context Protocol (MCP) servers
Config
No standard config provided
This server doesn't expose a parseable MCP config block in its README. See the repository for install instructions.
RepositoryTools
No tools detected
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
What is fastify-mcp?
fastify-mcp integrates Model Context Protocol (MCP) servers with your Fastify application. It supports both the Streamable HTTP transport and the legacy HTTP+SSE transport, and is designed for developers building MCP-compatible tools and resources on top of Fastify.
How to use fastify-mcp?
Install with npm install fastify-mcp or yarn add fastify-mcp. Define an MCP server using McpServer from the MCP TypeScript SDK, then register the streamableHttp plugin on a Fastify app, passing options such as stateful, mcpEndpoint, sessions, and createServer. The plugin handles session management automatically using an in-memory mapping.
Key features of fastify-mcp
- Integrates MCP servers into any Fastify application.
- Supports Streamable HTTP and legacy HTTP+SSE transports.
- Built‑in session management with event emitters (
connected,terminated,error). - Works with the official MCP TypeScript SDK.
- Configurable endpoint path and stateful/stateless modes.
Use cases of fastify-mcp
- Expose MCP tools and resources through a Fastify web server.
- Build stateful MCP servers that manage multiple client sessions.
- Add MCP endpoints to existing Fastify applications with minimal overhead.
- Leverage Fastify’s plugin ecosystem for logging, authentication, and routing.
FAQ from fastify-mcp
Which MCP transports does fastify-mcp support?
It supports the Streamable HTTP transport (2025-03-26 spec) and the legacy HTTP+SSE transport (2024-11-05 spec).
How does session management work?
The package uses an in-memory mapping of session IDs to transport instances. The Sessions class emits connected, terminated, and error events, and you can listen for them to track session lifecycle.
What options does the plugin accept?
The streamableHttp plugin accepts: stateful (boolean), mcpEndpoint (string path), sessions (a Sessions instance), and createServer (a function that returns an MCP server).
Frequently asked questions
Which MCP transports does fastify-mcp support?
It supports the Streamable HTTP transport (2025-03-26 spec) and the legacy HTTP+SSE transport (2024-11-05 spec).
How does session management work?
The package uses an in-memory mapping of session IDs to transport instances. The `Sessions` class emits `connected`, `terminated`, and `error` events, and you can listen for them to track session lifecycle.
What options does the plugin accept?
The `streamableHttp` plugin accepts: `stateful` (boolean), `mcpEndpoint` (string path), `sessions` (a `Sessions` instance), and `createServer` (a function that returns an MCP server).
Basic information
More Other MCP servers
Reactive Resume
amruthpillaiA one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!
Maestro
mobile-dev-incPainless E2E Automation for Mobile and Web
Production-ready MCP integrations for AI applications
Klavis-AIKlavis AI: MCP integration platforms that let AI agents use tools reliably at any scale

Figs, Relationship Expert
Figs O'Sullivan, LMFTCouples therapist Figs O'Sullivan (LMFT, 17 years, endorsed by Sue Johnson, creator of EFT) inside your AI. Ask relationship questions answered from his clinical writing, name the pattern in a fight, get a three-step rep
MCP Go 🚀
mark3labsA Go implementation of the Model Context Protocol (MCP), enabling seamless integration between LLM applications and external data sources and tools.
Comments