A centralized MCP server that acts as a proxy for REST microservices, built with FastMCP and SQLite.
The gateway follows a strict discovery hierarchy to guide the LLM:
- Agent Identification: Call
list_agentsto find an agent matching the user's intent. - Skill Discovery: Call
list_skills(agent_ids)to find high-level business logic (prompts). - Global Fallback: If no agent matches, calling
list_skills([])returns standalone skills. - Tool Selection: Use
get_detailsto read the skill'spromptand identify requiredtools. - Atomic Fallback: If no skills are relevant, calling
list_tools([])exposes all atomic REST endpoints. - Proxy Execution: All actions are performed via
execute(name, params).
# Install dependencies
pip install -e .
# Run the MCP server (stdio transport)
python -m mcp_gateway.main
# Run with admin API enabled (port 8080)
python -m mcp_gateway.main --admin
# Use MCP Inspector for interactive testing
npx @modelcontextprotocol/inspector --config src/mcp_gateway/mcp.json --server mcp-gatewayLLM ──► FastMCP Server (5 tools) ──► SQLite DB ──► REST Microservices
(via proxy executor)
Developer ──► FastAPI Admin (/apis, /skills, /agents) ──► SQLite DB
| Tool | Purpose |
|---|---|
list_agents() |
Scope check — find the right agent for the job |
list_skills(agent_ids) |
Find skills belonging to agents (or all if filtered list is empty) |
list_tools(skills) |
Find tools in skills (empty = all tools) |
get_details(name, type) |
Full config for a skill or tool |
execute(name, params) |
Proxy executor (httpx) |
The Admin API runs on port 8080 (by default) when started with the --admin flag. Interactive documentation is available at http://localhost:8080/docs.
| Area | Endpoints | Operations |
|---|---|---|
| APIs | /apis, /apis/{name} |
Register (OpenAPI), List, Re-sync, Delete |
| Skills | /skills, /skills/{name} |
Create, List, Update (prompt/tools), Delete |
| Agents | /agents, /agents/{id} |
Create, List, Get, Update, Delete |
| Tools | /tools, /tools/{name} |
List recorded tools, Get schema, Delete |