FastMCP Enterprise Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@FastMCP Enterprise Serversearch our docs for the data retention policy"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
FastMCP Enterprise Server
An enterprise-grade Model Context Protocol (MCP) server built with FastMCP and FastAPI. Designed for high concurrency, robust security, and scalable AI integrations, this server provides tools for semantic document search, SSRF-protected external context fetching, and cached profile retrieval.
๐ Tech Stack
Database: PostgreSQL with
pgvector(Async viaasyncpg& SQLAlchemy)Caching & Rate Limiting: Redis,
fastapi-limiterAuthentication: Firebase Admin SDK (JWT Validation)
Testing:
pytest-asyncio,httpx,locust(Load Testing)Infrastructure: Docker, Kubernetes
Related MCP server: Customer Support MCP Server
๐๏ธ Architecture & Features
1. Robust Security Model
Firebase Authentication: Custom FastAPI middleware validating Firebase JWT tokens for the
/sseand/messagesendpoints.Confused Deputy Mitigation: Scope validation (
db.read) enforced at the middleware level before tool execution.SSRF Protection: Outbound external context fetches route through a hardened
safe_fetchprotocol blocklist, preventing internal metadata enumeration (e.g., AWS/GCP169.254.169.254).Schema Drift Protection: Dynamic execution-time SHA-256 hash validation ensures AI tools (like
search_docs) have not had their schemas silently modified or manipulated.
2. High-Concurrency Optimizations
SSE Rate Limiting: AI client loops are strictly rate-limited (e.g., 50 requests/min) on a per-Firebase-UID basis via Redis and
fastapi-limiter.HNSW Vector Search: Document embeddings are indexed in PostgreSQL using Hierarchical Navigable Small World (
hnsw) graphs for sub-millisecond semantic search retrieval.Read-Through Caching: Heavy SQL queries (like user profiles) are cached in Redis to offload PostgreSQL overhead.
3. Integrated Tools
search_docs: Semantic search against theDocumentpgvector embeddings. Supports pagination (limit/offset).fetch_external_context: Safely retrieves and truncates external URL payloads.get_user_profile: Retrieves cached RBAC and department metadata for an authenticated user.
๐ ๏ธ Setup & Local Development
Prerequisites
Python 3.11+
PostgreSQL (with
pgvectorextension installed)Redis Server
Docker & Kubernetes (for deployment)
1. Environment Configuration
Clone the repository and install the dependencies:
git clone <repository-url>
cd mcp-server
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txtSet your environment variables (or create a .env file):
DATABASE_URL=postgresql+asyncpg://user:password@localhost:5432/mcpdb
REDIS_URL=redis://localhost:6379/02. Running the Server
Launch the application using Uvicorn:
uvicorn src.main:app --host 0.0.0.0 --port 8000 --reload๐งช Testing
The repository maintains a formal test suite and a load-testing infrastructure.
Unit & Integration Testing
Run the pytest suite to validate health checks, SSE connections, and Auth middleware.
pytest tests/test_api.py -vLoad Testing
Simulate high-concurrency AI clients maintaining SSE connections and dispatching search_docs queries.
locust -f locustfile.pyNavigate to http://localhost:8089 to start the Locust UI.
๐ข Kubernetes Deployment
The application is containerized and ready for Kubernetes orchestration.
Build the Docker Image:
docker build -t fastmcp-app:latest .Apply Manifests:
kubectl apply -f k8s/deployment.yaml
kubectl apply -f k8s/service.yamlThe Deployment is configured with:
3ReplicasResource requests/limits configured for memory and CPU.
Readiness and Liveness probes pointing to
/health.
๐ Workflow Protocol (FastMCP SSE)
This server natively exposes the MCP SSE protocol via FastAPI routes:
Connect: Client connects via
GET /sse(requiresAuthorization: Bearer <token>).Handshake: Server opens the stream and emits an
endpointevent containing the POST URL.RPC Calls: Client posts JSON-RPC payloads to
POST /messagesto invoke registered tools.
This server cannot be deployed
Maintenance
Related MCP Connectors
Team docs served to AI agents over MCP - search, Markdown reads, version pinning, read audit.
Give AI agents identity, scoped access, trusted context, and verifiable actions through MCP.
Zero-setup MCP gateway securely connecting AI to your tools with authentication and workflows
Your memory, everywhere AI goes. Build knowledge once, access it via MCP anywhere.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI applications to access and contextualize organizational knowledge sources including GitHub repositories and internal documentation through standardized MCP protocol integration. Features OAuth 2.1 authentication, vector-based semantic search, and optimized context chunking for enterprise development workflows.-
- AlicenseNot gradedqualityDmaintenanceEnables AI-powered customer support with real-time access to CRM, ticketing, and communication tools via MCP, supporting context-aware conversations and automated actions.Apache 2.0
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to search, retrieve, and summarize content from workplace tools including Google Drive, Notion, Slack, and Confluence through secure Model Context Protocol.-
- FlicenseCqualityDmaintenanceProvides RAG (Retrieval-Augmented Generation) capabilities via Contextual AI, enabling query processing and context-aware responses with citations. Integrates with MCP clients like Cursor IDE and Claude Desktop.1-