Skip to content

MCP server

GitHub →

loko mcp starts an MCP server over stdio, so assistants can model an existing system from its code and infrastructure, or design a new one conversationally.

Setup

Install loko, then add it to your client’s MCP configuration.

For Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json on macOS, %APPDATA%\Claude\claude_desktop_config.json on Windows):

{
  "mcpServers": {
    "loko": {
      "command": "loko",
      "args": ["mcp", "--project", "/path/to/your/architecture"]
    }
  }
}

For Claude Code:

claude mcp add loko -- loko mcp --project /path/to/your/architecture

Tools

The server registers exactly five tools, listed in name order:

ToolDirectionWhat it does
describereadExplains the compiled architecture
queryreadAnswer graph questions (dependents, paths, coupling)
validatereadCompile and report diagnostics
apply_editwriteEdit the HCL source, compiling before anything is written
movewriteMove or rename elements in the source

describe, query and validate read the compiled architecture; apply_edit and move edit the HCL source. Every edit compiles before it is written, and saves all-or-nothing, so a broken reference never reaches disk. Tools write *.loko.hcl files and nothing else — change the architecture through apply_edit and move rather than editing files directly.

Output defaults to TOON, which roughly halves the size of tabular answers such as query results.

Command options

loko mcp --project /path/to/your/architecture
FlagTypeDefaultDescription
--envstring""Set an environment variable (KEY=VALUE) for the server