Production-Ready FastMCP Server

Production-Ready FastMCP Server

A production-grade MCP server and client implementation with comprehensive features including structured logging, health checks, metrics, authentication, and RAG capabilities with PostgreSQL vector search. Supports both stdio and SSE transports with containerization and security features for enterprise deployment.

Category
Visit Server

README

MCP Server (FastMCP) and Client

Production-ready FastMCP server and a production-grade client with structured logging, env config, health checks, metrics, and containerization.

Features

  • Server: Stdio and SSE runtimes via FastMCP, CORS & security headers, token auth, basic rate limiting
  • Client: SSE and stdio transports, CLI to list tools/call tools/get resources, structured logs
  • Structured JSON logging with structlog
  • Env-based configuration
  • Health endpoints and CLI checks
  • Prometheus metrics primitives
  • Dockerfile and Makefile

Requirements

  • Python 3.9+

Setup

python3 -m venv .venv
. .venv/bin/activate
pip install -U pip
pip install -e .[dev]

Copy and adjust environment:

cp .env.example .env || true

Run (stdio)

mcp-server-stdio

Run (SSE)

mcp-server-sse  # uses HOST, PORT, AUTH_TOKEN, CORS_ORIGINS

Health

mcp-server-health

Docker

docker build -t mcp-server:latest .
docker run --rm -p 8000:8000 -e AUTH_TOKEN=changeme mcp-server:latest

Client CLI

Environment (SSE example):

export MCP_CLIENT_TRANSPORT=sse
export MCP_SSE_URL=http://localhost:8000/sse
export AUTH_TOKEN=changeme  # if server requires it

List tools:

mcpx list-tools

Call tool:

mcpx call-tool add --args '{"a": 1, "b": 2}'

Get resource:

mcpx get-resource time://now

Health check:

mcpx health

Security

  • Set a strong AUTH_TOKEN in production for SSE mode
  • Restrict CORS_ORIGINS to trusted origins
  • Run the container as non-root (Dockerfile does)
  • Prefer TLS for SSE (VERIFY_TLS=1)
  • Limit client network egress in production and rotate tokens regularly

RAG (Postgres + pgvector)

  • Set DATABASE_URL (or PG* envs) and OPENAI_API_KEY.
  • Enable vector extension in Postgres (the app will attempt to create it).

Ingest files via CLI:

python -m rag.cli ingest path/to/dir path/to/file.pdf

Ask a question via CLI:

python -m rag.cli ask "What does the document say about refunds?"

HTTP endpoints (when server running):

  • POST /rag/upload (multipart form with files)
  • POST /rag/query JSON { "question": "..." }

MCP tool:

  • rag_ask(question: str) -> str

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured