Architecture
MCTL uses GitOps for declared service configuration. Workflows also perform provisioning, while identity, incidents and domain registration use dedicated stores.
System Diagram
Request Flow
Workflow-backed MCP Request
- AI client sends a tool call via Streamable HTTP to
api.mctl.ai/mcp mctl-apiauthenticates the request (OAuth JWT from MCTL sign-in)- The handler validates input and checks RBAC for the tenant
mctl-apisubmits an Argo Workflow for the requested operation- A workflow name is returned after submission
- The workflow commits the desired state to
mctl-gitops - ArgoCD detects the change and syncs the cluster
- The client polls
mctl-apifor workflow execution status and deployment sync/health
Self-Healing Flow
- AlertManager fires an alert (e.g., pod crash loop)
mctl-agentreceives the alert webhook and creates a ticket- Evidence is collected and a skill is selected for diagnosis
- The agent either prepares a direct fix PR or dispatches the incident to an external agent
- A fix lands in
mctl-gitopsas a PR rather than mutating the cluster directly - On merge, ArgoCD syncs the change
Data Flow
| Path | Protocol | Auth |
|---|---|---|
| Client -> MCP Server | Streamable HTTP (POST/GET) | Bearer token per request |
| Client -> REST API | HTTPS | OAuth JWT |
| Argo Workflows -> GitOps | Git (SSH) | Deploy key |
| ArgoCD -> Cluster | Kubernetes API | ServiceAccount |
| AlertManager -> Agent | Webhook (HTTP) | Internal network |
| Agent -> External agents | Signed webhook callbacks | Shared secret / callback auth |