Implements a FastAPI-based gateway for MCP, offering REST API endpoints, admin dashboard, and interactive documentation via OpenAPI/Swagger UI.
Supports publishing the MCP server package to PyPI for easy distribution and installation.
Supports testing of the MCP server implementation.
Provides OpenAPI/Swagger UI documentation for API endpoints at /docs, enabling interactive exploration of the gateway's capabilities.
MCPilot - MCP Gateway
A powerful, FastAPI-based gateway for the Model Context Protocol (MCP), designed to unify and scale your AI toolchain.
✅ Current Status
MCPilot is now fully functional with the following working features:
✅ Working Features
- FastAPI Gateway Server - Running on http://localhost:8000/docs
- Admin Dashboard - Beautiful web UI at http://localhost:8000
- REST API Endpoints - Full CRUD operations via /api/v1/*
- API Wrapper System - Convert REST APIs to MCP tools (tested with JSONPlaceholder)
- Configuration Management - Environment-based settings
- Transport Framework - Ready for HTTP, WebSocket, SSE, stdio
- Modular Architecture - Clean separation of concerns
- Interactive Documentation - OpenAPI/Swagger UI at /docs
🔄 In Progress
- MCP Server Federation - Basic framework ready, needs MCP client integration fixes
- WebSocket Real-time Communication - Framework ready
- Admin UI Management - Backend ready, frontend interactions needed
🧪 Tested Examples
The API wrapper successfully converts REST APIs to MCP tools:
- Federation of multiple MCP servers into one unified endpoint
- REST API and function wrapping as virtual MCP-compliant tools
- Multiple transport support: HTTP/JSON-RPC, WebSocket, SSE, and stdio
- Centralized tools, prompts, and resources with full JSON-Schema validation
- Admin UI with built-in auth, observability, and transport layers
📁 Project Structure
🛠️ Installation
Prerequisites
- Python 3.10 or higher
- uv package manager (recommended) or pip
Install Dependencies
🚀 Quick Start
1. Start the Gateway Server
2. Access the Admin UI
Open your browser to http://localhost:8000
to access the admin dashboard.
3. API Documentation
- OpenAPI/Swagger UI:
http://localhost:8000/docs
- ReDoc:
http://localhost:8000/redoc
🔧 Configuration
MCPilot can be configured via environment variables or a .env
file:
Adding MCP Servers
Configure MCP servers via the admin API or by setting up the configuration:
Adding API Wrappers
Convert REST APIs to MCP tools:
📖 API Endpoints
Core MCP Operations
GET /api/v1/tools
- List all available toolsPOST /api/v1/tools/call
- Call a toolGET /api/v1/prompts
- List all available promptsPOST /api/v1/prompts/get
- Get a promptGET /api/v1/resources
- List all available resourcesPOST /api/v1/resources/read
- Read a resource
Admin Operations
GET /admin/servers
- List MCP serversPOST /admin/servers
- Add new MCP serverPUT /admin/servers/{name}
- Update MCP serverDELETE /admin/servers/{name}
- Remove MCP serverGET /admin/api-wrappers
- List API wrappersPOST /admin/api-wrappers
- Add new API wrapper
Health & Monitoring
GET /health
- Health check endpointGET /api/v1/status
- Gateway and server statusGET /admin/metrics
- System metrics
🔌 WebSocket Support
Connect to the WebSocket endpoint for real-time MCP communication:
🧪 Development
Running in Development Mode
Testing
📄 License
This project is licensed under the MIT License.
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Original MCP Server Components
MCPilot also includes the original MCP server functionality for development and testing:
Resources
The server implements a simple note storage system with:
- Custom note:// URI scheme for accessing individual notes
- Each note resource has a name, description and text/plain mimetype
Prompts
The server provides a single prompt:
- summarize-notes: Creates summaries of all stored notes
- Optional "style" argument to control detail level (brief/detailed)
- Generates prompt combining all current notes with style preference
Tools
The server implements one tool:
- add-note: Adds a new note to the server
- Takes "name" and "content" as required string arguments
- Updates server state and notifies clients of resource changes
Configuration
[TODO: Add configuration details specific to your implementation]
Quickstart
Install
Claude Desktop
On MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json
Development
Building and Publishing
To prepare the package for distribution:
- Sync dependencies and update lockfile:
- Build package distributions:
This will create source and wheel distributions in the dist/
directory.
- Publish to PyPI:
Note: You'll need to set PyPI credentials via environment variables or command flags:
- Token:
--token
orUV_PUBLISH_TOKEN
- Or username/password:
--username
/UV_PUBLISH_USERNAME
and--password
/UV_PUBLISH_PASSWORD
Debugging
Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, we strongly recommend using the MCP Inspector.
You can launch the MCP Inspector via npm
with this command:
Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.
This server cannot be installed
A powerful gateway for the Model Context Protocol (MCP) that unifies AI toolchains by federating multiple MCP servers, wrapping REST APIs as MCP tools, and supporting multiple transport methods with an admin dashboard.
Related MCP Servers
- -securityFlicense-qualityFacilitates interaction and context sharing between AI models using the standardized Model Context Protocol (MCP) with features like interoperability, scalability, security, and flexibility across diverse AI systems.Last updated -1Python
- -securityFlicense-qualityA Model Context Protocol server implementation that enables connection between OpenAI APIs and MCP clients for coding assistance with features like CLI interaction, web API integration, and tool-based architecture.Last updated -28Python
- -securityFlicense-qualityImplements the Model Context Protocol (MCP) to provide AI models with a standardized interface for connecting to external data sources and tools like file systems, databases, or APIs.Last updated -90Python
- -security-license-qualityAn open-source implementation of the Model Context Protocol (MCP) that bridges AI agents with enterprise systems, enabling secure access to real-world data and capabilities.Last updated -1PythonApache 2.0