fastify-mcp
by haroldadmin·★ 27·Score 44
A Fastify plugin that enables running MCP servers with Streamable HTTP and HTTP+SSE transports.
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:
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
Installation
# npm
npm install fastify-mcp
# yarn
yarn add fastify-mcpTo 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
Last updated · Auto-generated from public README + GitHub signals.