lightspeed_mcp
Lightspeed MCP: FastAPI + FastMCP integration with automatic discovery of api routes, tools/resources/prompts.
claude mcp add --transport stdio techwithty-lightspeed_mcp python model_context_protocol/server.py \ --env MCP_SSL="enabled (configured via deployment proxy such as NGINX/HTTPS gateway)" \ --env FASTAPI_APP_IMPORT="app.api.main:app"
How to use
This MCP server integrates a FastAPI application with FastMCP, exposing all FastAPI endpoints as MCP tools and resources. At startup it dynamically discovers modules under tools/, prompts/, and resources/ and auto-registers any MCP-decorated functions. You can extend the server by adding new Python modules to those folders without editing server.py. The server supports Context for logging, progress updates, and LLM sampling, and includes image workflows via Image data types. Start the server with python model_context_protocol/server.py, then connect as an MCP client to query tools, resources, and prompts exposed by your FastAPI app. When secured deployment is required, run behind an SSL-enabled proxy (e.g., NGINX) to keep all MCP communications encrypted.
How to install
Prerequisites:
- Python 3.9+
- A FastAPI project to integrate with (the MCP folder should sit at the root of your FastAPI app)
- Access to install Python dependencies (pip)
Installation steps:
-
Create a Python virtual environment: python -m venv venv source venv/bin/activate # on macOS/Linux venv\Scripts\activate # on Windows
-
Install required dependencies (adjust as needed for your project): pip install fastapi fastmcp
If you have a requirements.txt for your project, install them too:
pip install -r requirements.txt
-
Ensure your FastAPI app exposes an app object importable as app.api.main:app (as described in the README).
-
Place the model_context_protocol directory at the root of your FastAPI app folder as described in the guide.
-
Run the MCP server: python model_context_protocol/server.py
Optional (Docker):
- Build and run the container as shown in the guide's docker section: docker build -t mcp-server -f app/mcp_server/docker/Dockerfile . docker run -d -p 8000:8000 --name mcp-server mcp-server
Additional notes
Notes and tips:
- The MCP server auto-imports modules from tools/, prompts/, and resources/ using dynamic import at startup; add modules with @mcp.tool, @mcp.resource, or @mcp.prompt decorators to register them automatically.
- If you relocate the model_context_protocol folder, update the import paths in server.py accordingly.
- The platform supports SSL/TLS; deploy behind a reverse proxy (e.g., NGINX) or an HTTPS-enabled gateway to secure MCP communications by default.
- Blocked/privileged routes like /system, /service, and /mcp_deny are intentionally excluded from public MCP access.
- For production, consider using Docker or a process manager to ensure reliability and SSL termination at the edge.
Related MCP Servers
mcp -odoo
A Model Context Protocol (MCP) server that enables AI assistants to securely interact with Odoo ERP systems through standardized resources and tools for data retrieval and manipulation.
pfsense
pfSense MCP Server enables security administrators to manage their pfSense firewalls using natural language through AI assistants like Claude Desktop. Simply ask "Show me blocked IPs" or "Run a PCI compliance check" instead of navigating complex interfaces. Supports REST/XML-RPC/SSH connections, and includes built-in complian
mcp -memos-py
A Python package enabling LLM models to interact with the Memos server via the MCP interface for searching, creating, retrieving, and managing memos.
Vector-Knowledge-Base
A semantic search engine that transforms your documents into an intelligent, searchable knowledge base using vector embeddings and AI
cbi
CB Insights' MCP Server
mcp-raganything
API/MCP wrapper for RagAnything