A FastAPI-based gateway for the Model Context Protocol (MCP) designed to unify and scale AI toolchains.
A powerful, FastAPI-based gateway for the Model Context Protocol (MCP), designed to unify and scale your AI toolchain.
MCPilot is now fully functional with the following working features:
The API wrapper successfully converts REST APIs to MCP tools:
# Example: JSONPlaceholder API โ MCP Tool
result = await gateway.call_tool(
"api:jsonplaceholder:get_user",
{"user_id": "1"}
)
# Returns: Full user data from REST API
src/mcpilot/
โโโ main.py # FastAPI application entry point
โโโ config.py # Configuration management
โโโ gateway.py # Core MCP federation logic
โโโ api.py # REST API endpoints
โโโ admin.py # Admin management endpoints
โโโ transports.py # Transport layer implementations
โโโ api_wrapper.py # REST API to MCP tool wrapper
โโโ middleware.py # Request/response middleware
โโโ server.py # Original MCP server implementation
# Using uv (recommended)
uv sync
# Or using pip
pip install -e .
# Run the FastAPI server
uv run python -m mcpilot.main
# Or using uvicorn directly
uvicorn mcpilot.main:app --reload --host 0.0.0.0 --port 8000
Open your browser to http://localhost:8000
to access the admin dashboard.
http://localhost:8000/docs
http://localhost:8000/redoc
MCPilot can be configured via environment variables or a .env
file:
# Server Configuration
MCPILOT_HOST=0.0.0.0
MCPILOT_PORT=8000
MCPILOT_DEBUG=false
# CORS Settings
MCPILOT_CORS_ORIGINS=["*"]
# Logging
MCPILOT_LOG_LEVEL=INFO
Configure MCP servers via the admin API or by setting up the configuration:
from mcpilot.config import MCPServerConfig
server_config = MCPServerConfig(
name="my-server",
type="stdio",
command="python",
args=["-m", "my_mcp_server"],
enabled=True
)
Convert REST APIs to MCP tools:
from mcpilot.config import APIWrapperConfig
api_config = APIWrapperConfig(
name="my-api",
base_url="https://api.example.com",
auth_type="bearer",
auth_config={"token": "your-token"},
endpoints=[
{
"name": "get_user",
"method": "GET",
"path": "/users/{user_id}",
"description": "Get user information",
"path_params": [
{"name": "user_id", "type": "string", "required": True}
]
}
]
)
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 resourceGET /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 wrapperGET /health
- Health check endpointGET /api/v1/status
- Gateway and server statusGET /admin/metrics
- System metricsConnect to the WebSocket endpoint for real-time MCP communication:
const ws = new WebSocket('ws://localhost:8000/api/v1/ws');
// Send MCP JSON-RPC message
ws.send(JSON.stringify({
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list",
"params": {}
}));
# Install development dependencies
uv sync --dev
# Run with auto-reload
uvicorn mcpilot.main:app --reload --host 0.0.0.0 --port 8000
# Run tests (when implemented)
uv run pytest
# Type checking
uv run mypy src/mcpilot
This project is licensed under the MIT License.
Contributions are welcome! Please feel free to submit a Pull Request.
MCPilot also includes the original MCP server functionality for development and testing:
The server implements a simple note storage system with:
The server provides a single prompt:
The server implements one tool:
[TODO: Add configuration details specific to your implementation]
On MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json
To prepare the package for distribution:
uv sync
uv build
This will create source and wheel distributions in the dist/
directory.
uv publish
Note: You'll need to set PyPI credentials via environment variables or command flags:
--token
or UV_PUBLISH_TOKEN
--username
/UV_PUBLISH_USERNAME
and --password
/UV_PUBLISH_PASSWORD
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:
npx @modelcontextprotocol/inspector uv --directory C:\Users\ary7s\OneDrive\Desktop\MCPilot run mcpilot
Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.
Provides Go language updates and best practices in a structured Markdown format for LLM coding agents.
Set up and interact with your unstructured data processing workflows in Unstructured Platform
Manage DDEV projects, enabling LLM applications to interact with local development environments through the MCP protocol.
๐ MCP server for Xcode's xctrace, xcrun, xcodebuild.
Interact with the Glide API to build applications from data sources like Google Sheets.
Retrieve on-chain information for EVM contracts locally using an Ethereum RPC node and Etherscan API.
Interact with CodeRabbit AI reviews on GitHub pull requests.
A server for monitoring and analyzing Java Virtual Machine (JVM) processes using Arthas, with a Python interface.
Connects Blender to Claude AI via the Model Context Protocol (MCP), enabling direct interaction and control for prompt-assisted 3D modeling, scene creation, and manipulation.
Analyzes GitLab merge requests and links them to Confluence documentation.