MartinLoop
Puts budgets, verifier gates and run receipts around coding-agent jobs started from an MCP host
MCP interface to the Loki Mode coding agent: start runs, read their state and check signed receipts
By Lokesh Mure (individual) Python Local · stdio Developer toolsAI and MLGit and code hosting
79 popularity score ★ 1.1k ↓ 21k/wk
Opens the app, which asks before it adds the server.
claude mcp add loki-mode -- npx -y loki-mode mcp{
"mcpServers": {
"loki-mode": {
"command": "npx",
"args": [
"-y",
"loki-mode",
"mcp"
]
}
}
}{
"mcpServers": {
"loki-mode": {
"command": "npx",
"args": [
"-y",
"loki-mode",
"mcp"
]
}
}
}{
"servers": {
"loki-mode": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"loki-mode",
"mcp"
]
}
}
}[mcp_servers.loki-mode]
command = "npx"
args = ["-y", "loki-mode", "mcp"]gemini mcp add --scope user loki-mode npx -- -y loki-mode mcpLOKI_MCP_READ_ONLY |
Optional: Set to 1, true or yes to keep only the 24 reading tools (same as --read-only). |
|---|---|
LOKI_MCP_AUTH_TOKEN secret |
Optional: Bearer token the HTTP transport demands when set. |
LOKI_MCP_MAX_RESULT_BYTES |
Optional: Byte cap on a tool result before it is truncated. Values under 1000 are ignored. |
| Set together: control plane | |
LOKI_CP_URL |
Optional: Control Plane address for the cp_ tools. LOKI_CONTROL_URL is read if this is unset. |
LOKI_CONTROL_TOKEN secret |
Optional: Token sent to the Control Plane, when it needs one. |
| Set together: code search | |
LOKI_CHROMA_HOST |
Optional: Chroma host for semantic code search. |
LOKI_CHROMA_PORT |
Optional: Chroma port for semantic code search. |
| Set together: managed memory | |
LOKI_MANAGED_AGENTS |
Optional: Must be true, with LOKI_MANAGED_MEMORY, before redaction runs. |
LOKI_MANAGED_MEMORY |
Optional: Must be true, with LOKI_MANAGED_AGENTS, before redaction runs. |
Loki Mode is first of all a command-line coding agent from Autonomi. Give it a task or an issue from GitHub, GitLab or Jira. It writes the checks before the code, then makes the change and opens a pull request once the checks pass. Each run ends with a receipt signed by an Ed25519 key kept on your machine, and `loki verify` checks that receipt later. The MCP server ships in the same npm package. You start it with `loki mcp`, and it speaks stdio unless told otherwise.
Counting what the source registers at the current release gives 48 tools, which matches the README. They fall into a few groups. The run tools start Loki 10 runs and verify their receipts, and `loki_seal_diff` puts a signed receipt on changes you made yourself. Another group drives the older project mode with its task queue and checkpoints. Memory gets its own set, mostly search and pattern storage. For the repository itself there is semantic code search over a Chroma index, plus git history views such as hotspots and files that tend to change together. Eight tools only read from the Control Plane, Loki's local record of runs and costs. The rest build UI components (Magic Modules) or redact entries in a managed-agents memory store. It also serves three resources and two prompts.
With `--read-only` or LOKI_MCP_READ_ONLY=1, everything outside a fixed list of 24 reading tools is removed, so a tool added later stays hidden until someone adds it to that list. With `--transport http` it serves Streamable HTTP on 127.0.0.1, port 8421 unless `--port` says otherwise, and LOKI_MCP_AUTH_TOKEN turns on a bearer-token check. One detail the README leaves out: any tool result over 24,000 bytes is cut down and marked as truncated. LOKI_MCP_MAX_RESULT_BYTES raises or lowers that cap, and values under 1,000 are ignored.
| Runtime | Node.js 20+Python 3.8+ |
|---|---|
| Runs on | macOS, Linux |
| Anthropic | Paid planRun tools need a logged-in Claude Code CLI or an ANTHROPIC_API_KEY. Other coding CLIs can be picked instead. |
| Also |
|
Install the npm package (npm install -g loki-mode) to get the `loki` command, or let npx fetch it. The server itself is Python, so python3 must be present even though the README lists it as optional for the CLI. The plugin config sets LOKI_MCP_AUTO_BOOTSTRAP=1 so the Python dependencies get set up on first launch. For runs, install Claude Code and log in, or set ANTHROPIC_API_KEY.
Only macOS and Linux are supported. Runs use model tokens that cost money: with an API key a run stops at $100 unless you change --max-cost, and on a subscription there is no dollar cap. Cline, Codex, Aider and opencode work only as experimental providers. The README says a signed receipt proves who made a change, not that the code is free of bugs, and it lists the checks that did not run. Semantic code search needs a Chroma server, localhost:8100 by default. The licence is BUSL-1.1, free for personal, internal, academic and non-commercial use; other use needs an arrangement with Autonomi.
It suits developers who already use Loki Mode, or plan to, and want their assistant to start runs, watch them, read results and verify receipts from the chat. It is a front end to Loki's own engine, memory and Control Plane, so it adds little without Loki itself. It runs on your machine, can change code and open pull requests, and starts paid model runs. Read-only mode fits someone who only wants an assistant to browse run history and memory. For general git or GitHub work, a server built for that will do more.
34 only read, 12 change things, 2 can delete or overwrite. A ? marks an optional parameter.
loki_v10_run changesref: stringrepo_path: stringloki_v10_statusrepo_path: stringrun_id?: stringloki_v10_verifyreceipt_path?: stringrepo_path?: stringloki_seal_diff changesrepo_path: stringintent: stringloki_verify_fastpath?: stringdiff_base?: stringloki_start_project changesprd_content?: stringprd_path?: stringloki_project_statusloki_complete_task changescompletion_statement: stringevidence: stringconfidence?: stringloki_state_getloki_task_queue_listloki_task_queue_add changestitle: stringdescription: stringpriority?: stringphase?: stringloki_task_queue_update changestask_id: stringstatus?: stringpriority?: stringloki_checkpoint_restore deletescheckpoint_id?: stringloki_quality_reportloki_agent_metricsloki_metrics_efficiencyloki_findingsiteration?: integerloki_learningslimit?: integerloki_counter_evidence_template changesiteration: integerloki_memory_retrievequery: stringtask_type?: stringtop_k?: integerloki_memory_store_pattern changespattern: stringcategory: stringcorrect_approach: stringincorrect_approach?: stringconfidence?: numberloki_memory_capture_session_summary changesgoal: stringoutcome?: stringfiles_modified?: arrayfiles_read?: arraytool_calls_summary?: stringduration_seconds?: integerloki_consolidate_memory changessince_hours?: integerloki_memory_redact deletespattern: stringscope?: stringmem_searchquery: stringcollection?: stringlimit?: integermem_timelinearound_id?: stringlimit?: integersince_hours?: integermem_getids: stringloki_code_searchquery: stringn_results?: integerlanguage?: stringfile_filter?: stringtype_filter?: stringloki_code_search_statsloki_graph_queryquestion: stringbudget?: integerpath?: stringloki_get_hotspotslimit?: integerloki_get_co_changesfile_path: stringloki_get_doc_coveragecp_runs_searchverdict?: stringrepo?: stringsince?: stringuntil?: stringgroup_id?: stringlimit?: integercursor?: stringcp_run_getsource_id: stringrun_id: stringcp_run_eventssource_id: stringrun_id: stringafter?: integerlimit?: integercp_run_artifactsource_id: stringrun_id: stringname: stringcp_runs_comparesource_a: stringrun_a: stringsource_b: stringrun_b: stringcp_statssince?: stringcp_costgroup?: stringsince?: stringcp_repos_listloki_magic_generate changesname: stringdescription?: stringtarget?: stringplacement?: stringtags?: arrayloki_magic_listquery?: stringtags?: arraytarget?: stringloki_magic_getname: stringloki_magic_update changesname: stringspec_update?: stringforce?: booleanloki_magic_debatename: stringrounds?: integerpersonas?: arrayloki_magic_tokens_extractloki_magic_statsloki://state/continuityloki://memory/indexloki://queue/pendingloki_startloki_phase_report