Architecture#

The parts of kevin and how they connect. The other pages in this section explain each part.

graph TD
    CLI["kevin CLI"]
    ENG[engine]
    CFG["Config"]
    DAG["DAG engine"]
    HOST[launcher]
    CON[console]
    CA["CA"]
    MCPN[MCP server]
    PLUG[["plugin process"]]
    CRI["container engine<br/>(docker or podman)"]
    PROXY[proxy]
    LOOP(["host loopback"])

    subgraph DOCKERNET["container network"]
        RELAY["relay<br/>(container)"]
        STEPC["step containers<br/>(container/kubernetes)"]
    end

    CLI -->|invokes| ENG
    ENG -->|loads| CFG
    ENG -->|uses| DAG
    ENG -->|starts| HOST
    ENG -->|drives| CON
    ENG -->|creates| CA
    CON -->|mounts /_mcp| MCPN
    MCPN -->|tool calls, step ops| ENG
    HOST -.gRPC.-> PLUG
    PLUG -->|shells out| CRI
    ENG -->|network, GC| CRI
    STEPC -.->|publishes| LOOP
    STEPC -.->|resolves, forwards| RELAY
    RELAY -.->|dnat capture| STEPC
    RELAY -.->|socks5| LOOP
    PROXY -.->|dials| LOOP
    RELAY -->|forwards| PROXY
    ENG -->|starts| PROXY
    ENG -.->|RegisterCapture, mTLS| RELAY
    CA -->|signs leaf| PROXY
    CA -.->|signs control leaves| RELAY
    CRI -.->|creates, attaches| RELAY
    CRI -.->|creates, attaches| STEPC
    RELAY -.->|socks5 dial| STEPC
    PROXY -->|traffic records| ENG

    classDef dashedNode stroke-dasharray: 5 5
    class STEPC dashedNode
PartResponsibility
CLIParses the command line.
EngineLoads the environment, starts the plugins, walks the DAG.
ConfigurationReads kevin.cue. Validates every step before anything runs.
DAG engineOrders the steps. Runs independent steps concurrently, capped by engine.max_parallel.
Container engineRuns the docker or podman command.
Plugin hostStarts the plugin processes and keeps them running.
Plugin SDKThe public API that a plugin author implements.
Wire contractThe gRPC service between the engine and a plugin.
ProxyTerminates TLS, routes to a workload, controls egress.
ConsoleShows the DAG state, the logs, and the proxy traffic.
MCP serverGives an MCP client, such as a coding agent, access to the running environment, at /_mcp on the console address.
CACreates the CA and signs certificates for the proxy and relay.
RelayA container on the project network. Answers DNS for the environment domain, sends container traffic to the proxy, and lets the host reach ports inside the network.