- KomodoClient for Komodo Core API - MCP tools: list_servers, list_deployments, list_stacks, get_container_status - Raw API pass-through: komodo_api_call - API documentation resource: komodo://api-reference - Docker multi-stage build with uv
3.9 KiB
3.9 KiB
Implementation Details
Technical documentation for the Komodo MCP Server.
Architecture
┌─────────────────────────────────────────────────────────┐
│ MCP Client (AI Agent) │
└─────────────────────────┬───────────────────────────────┘
│ SSE
▼
┌─────────────────────────────────────────────────────────┐
│ Docker Container (komodo-mcp) │
│ ┌───────────────────────────────────────────────────┐ │
│ │ FastMCP + uvicorn (:8000) │ │
│ └───────────────────────────────────────────────────┘ │
│ ┌───────────────────────────────────────────────────┐ │
│ │ KomodoClient │ │
│ │ (httpx → Komodo Core API) │ │
│ └─────────────────────────┬─────────────────────────┘ │
└─────────────────────────────┼───────────────────────────┘
│ HTTPS
▼
┌──────────────────┐
│ Komodo Core │
│ (REST API) │
└────────┬─────────┘
│
┌─────────────────┼─────────────────┐
▼ ▼ ▼
┌──────────┐ ┌──────────┐ ┌──────────┐
│ Periphery│ │ Periphery│ │ Periphery│
│ Server 1 │ │ Server 2 │ │ Server N │
└──────────┘ └──────────┘ └──────────┘
Components
KomodoClient
- HTTP client using
httpx - Handles authentication via
X-Api-KeyandX-Api-Secretheaders - Methods:
read(),write(),execute()mapping to API endpoints
Transport Security
TransportSecuritySettingsvalidates Host headers- Configurable via
MCP_ALLOWED_HOSTS
Tool Strategy
Layer 1: Curated Tools
list_servers()- Server discoverylist_deployments()- Container listinglist_stacks()- Stack listingget_container_status(deployment)- Container details
Layer 2: Raw Access
komodo_api_call(endpoint, request_type, params)- Any API operation
API Docs Resource
- URI:
komodo://api-reference - Provides structured API documentation for AI agents
Komodo API
All requests use:
- Method: POST
- Paths:
/read,/write,/execute - Body:
{"type": "RequestType", "params": {...}} - Auth:
X-Api-Key+X-Api-Secretheaders
Full docs: https://docs.rs/komodo_client/latest/komodo_client/api/index.html
Build & Deploy
- Build:
uv+ multi-stage Docker - Registry: Gitea Container Registry
- Deploy: Docker Compose