A Python MCP (Model Context Protocol) server for the Komodo DevOps platform. Manage your servers, containers, stacks, builds, and more — directly from AI assistants like Claude.
Built with FastMCP, uvicorn, and httpx.
services:
komodo-mcp:
image: ghcr.io/myrikld/komodo-mcp:latest
ports:
- "8000:8000"
environment:
- KOMODO_MCP_KOMODO_URL=https://your-komodo-instance.example.com
- KOMODO_MCP_KOMODO_API_KEY=your_api_key
- KOMODO_MCP_KOMODO_API_SECRET=your_api_secret
restart: unless-stoppeddocker compose up -dThe server exposes a Streamable HTTP endpoint at /.
Claude Code (CLI):
claude mcp add -s user --transport http komodo http://localhost:8000/Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"komodo": {
"type": "http",
"url": "http://localhost:8000/"
}
}
}The server supports OAuth 2.1 with a browser-based login page. When OAuth is enabled, MCP clients are redirected to a login form before receiving an access token.
Set all three variables:
KOMODO_MCP_OAUTH_JWT_SECRET=<random string, 32+ chars>
KOMODO_MCP_OAUTH_PASSWORD=<password shown in browser login form>
KOMODO_MCP_BASE_URL=https://mcp.example.com # public URL of this serverWhen OAuth is active, the server exposes standard OAuth 2.1 endpoints:
| Endpoint | Description |
|---|---|
/.well-known/oauth-authorization-server |
OAuth metadata discovery |
/register |
Dynamic Client Registration (RFC 7591) |
/authorize |
Authorization endpoint — redirects to /login |
/login |
Password login page (browser) |
/token |
Token endpoint |
/revoke |
Token revocation |
Flow: MCP client → /authorize → browser opens /login → user enters password → client receives JWT access token (1h) + refresh token (30d).
Without OAuth configured, the server accepts all connections without authentication.
The server keeps no session state, so restarting it does not log clients out — no volume required:
- Access and refresh tokens are self-contained JWTs, validated from their own signed claims.
- A registered client's metadata is carried inside its
client_id, which is itself a signed JWT. - Everything is signed with a key derived from
KOMODO_MCP_OAUTH_JWT_SECRET. Keep that secret stable: changing it invalidates all tokens and client registrations, forcing every client to authorize again.
The one thing that cannot be reconstructed from a token is the fact that it was revoked. Revocations are written to $KOMODO_MCP_STATE_DIR/revoked_tokens.json (the Docker image sets KOMODO_MCP_STATE_DIR=/data), which survives a container restart. To keep them across container recreation — image upgrades, docker compose down — mount a volume:
volumes:
- komodo-mcp-state:/dataWithout a volume, a revoked token that has not yet expired becomes usable again after the container is recreated. Without KOMODO_MCP_STATE_DIR at all (e.g. local development), revocations are memory-only and are forgotten on every restart.
| Variable | Description | Default |
|---|---|---|
KOMODO_MCP_KOMODO_URL |
Komodo instance URL | required |
KOMODO_MCP_KOMODO_API_KEY |
API key | required |
KOMODO_MCP_KOMODO_API_SECRET |
API secret | required |
KOMODO_MCP_HOST |
Server bind host | 0.0.0.0 |
KOMODO_MCP_PORT |
Server bind port | 8000 |
KOMODO_MCP_OAUTH_JWT_SECRET |
Secret for signing JWT tokens | OAuth disabled |
KOMODO_MCP_OAUTH_PASSWORD |
Password for the browser login page | OAuth disabled |
KOMODO_MCP_BASE_URL |
Public URL of this server (used in OAuth metadata) | OAuth disabled |
KOMODO_MCP_STATE_DIR |
Directory for the revoked-token list | /data in the Docker image, unset otherwise |
uv sync
export KOMODO_MCP_KOMODO_URL=https://your-instance.example.com
export KOMODO_MCP_KOMODO_API_KEY=your_key
export KOMODO_MCP_KOMODO_API_SECRET=your_secret
komodo-mcp
# tests
python -m pytest tests/- FastMCP — MCP framework with OAuth 2.1 support
- uvicorn — ASGI server
- httpx — Async HTTP client for Komodo API
- pydantic-settings — Configuration