Back to Home
haroldadmin icon

fastify-mcp

Verified Safe

by haroldadmin

Overview

Integrates Model Context Protocol (MCP) server functionality into Fastify web applications, supporting streamable HTTP and legacy HTTP+SSE transports.

Installation

Run Command
npx ts-node examples/stateless-streamable-http-server.ts

Security Notes

The codebase appears well-structured and follows good practices for a Fastify plugin. It correctly handles session management (add, remove, close events) and provides generic error responses for invalid requests, minimizing information leakage. There are no obvious signs of 'eval' usage, obfuscation, hardcoded secrets, or malicious patterns. The use of `reply.raw` is inherent to Fastify's low-level access and the underlying MCP SDK transport layer. The primary security consideration for deployment is the in-memory session management, which, while secure for single-node instances, would require a distributed session store for horizontally scaled applications to prevent state loss or unauthorized access across instances. This is a design choice inherent to how the MCP SDK handles sessions, not a vulnerability in the plugin itself.

Similar Servers

Stats

Interest Score40
Security Score9
Cost ClassLow
Stars21
Forks5
Last Update2025-12-10

Tags

FastifyModel Context Protocol (MCP)AI/ML IntegrationWeb APIsServer Plugin