fastify
🚀 High-performance MCP (Model Context Protocol) server built with Fastify, TypeScript, and functional programming. Production-ready with authentication, metrics, and auto-discovery capabilities for AI agents and LLM applications.
claude mcp add --transport stdio neddl-fastify-mcp-server node dist/server.js \ --env NODE_ENV="Environment (e.g., development, production)" \ --env MCP_SERVER_HOST="Host for the MCP server" \ --env MCP_SERVER_PORT="Port to run the MCP server on" \ --env MCP_SERVER_TOKEN="Bearer token used for MCP authentication"
How to use
This MCP server provides a high-performance Model Context Protocol implementation built with Fastify and TypeScript. It exposes an MCP-compliant API with endpoints for health checks and metrics, and automatically discovers and registers tools, resources, and prompts from your project folders. Access to the MCP endpoints is secured via a Bearer token configured in MCP_SERVER_TOKEN, ensuring secure connections for AI agents and LLM integrations. Use the included MCP transport (WebSocket/HTTP) to interact with tools, resources, and prompts in a structured, type-safe manner through the @modelcontextprotocol/sdk.
Once running, you can interact with the MCP server through its standard endpoints and the MCP client tooling. The auto-discovery mechanism scans the tools, resources, and prompts directories to register capabilities without manual wiring, making it easy to extend capabilities as your project grows. The server also includes production-ready features such as metrics, health checks, and session management to support long-running deployments in Kubernetes or other orchestration environments.
How to install
Prerequisites:
- Node.js 20.10.0+ (recommended 24.x LTS)
- npm or yarn
- Git
Installation steps:
- Clone the repository:
git clone https://github.com/your-username/neddl-fastify-mcp-server.git
cd neddl-fastify-mcp-server
- Install dependencies:
npm install
- Build the project (TypeScript to JavaScript):
npm run build
- Run the server in development or production mode (see environment variables in configuration):
# Development (with hot reload if configured)
npm run dev
# Production (standalone MCP server)
npm start
- Compose the runtime environment variables (example):
cp .env.example .env
Edit .env with your configuration, including MCP_SERVER_PORT, MCP_SERVER_HOST, and MCP_SERVER_TOKEN.
Additional notes
Tips and notes:
- Ensure MCP_SERVER_TOKEN is kept secret and rotated regularly in production.
- The MCP auto-discovery relies on the presence of Tools, Resources, and Prompts in their respective folders and updates when you modify index.ts in those directories.
- If running in Kubernetes, expose port 9080 (as per .env.example) and configure readiness/liveness probes to monitor /health and /metrics.
- For local development, you can use the dev script (npm run dev) to speed up iteration; for production, use npm start and a process manager like PM2 or a Kubernetes deployment.
- If you encounter TypeScript compilation issues, verify your Node.js version matches the supported range and that dependencies are installed correctly.
Related MCP Servers
context7
Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
mcp-graphql
Model Context Protocol server for GraphQL
mcp-use-ts
mcp-use is the framework for MCP with the best DX - Build AI agents, create MCP servers with UI widgets, and debug with built-in inspector. Includes client SDK, server SDK, React hooks, and powerful dev tools.
mcp-typescript-sdk
A TypeScript SDK for implementing Model Context Protocol (MCP) over MQTT, supporting both browser and Node.js environments.
rohlik
MCP server that lets you shop groceries across the Rohlik Group platforms (Rohlik.cz, Knuspr.de, Gurkerl.at, Kifli.hu, Sezamo.ro)
time
⏰ Time MCP Server: Giving LLMs Time Awareness Capabilities