MCP server
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/architectureTools
The server registers exactly five tools, listed in name order:
| Tool | Direction | What it does |
|---|---|---|
describe | read | Explains the compiled architecture |
query | read | Answer graph questions (dependents, paths, coupling) |
validate | read | Compile and report diagnostics |
apply_edit | write | Edit the HCL source, compiling before anything is written |
move | write | Move 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| Flag | Type | Default | Description |
|---|---|---|---|
--env | string | "" | Set an environment variable (KEY=VALUE) for the server |