Loki Mode

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

Connect your client

Local (npm)

Add in one click

Opens the app, which asks before it adds the server.

Or add it by command or config

Claude CodeTerminal
claude mcp add loki-mode -- npx -y loki-mode mcp
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "loki-mode": {
      "command": "npx",
      "args": [
        "-y",
        "loki-mode",
        "mcp"
      ]
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "loki-mode": {
      "command": "npx",
      "args": [
        "-y",
        "loki-mode",
        "mcp"
      ]
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "loki-mode": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "loki-mode",
        "mcp"
      ]
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.loki-mode]
command = "npx"
args = ["-y", "loki-mode", "mcp"]
Gemini CLITerminal
gemini mcp add --scope user loki-mode npx -- -y loki-mode mcp

Settings 9

LOKI_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. For HTTP transport.
LOKI_MCP_MAX_RESULT_BYTES Optional: Byte cap on a tool result before it is truncated. Values under 1000 are ignored. Default 24000.
Set together: control plane
LOKI_CP_URL Optional: Control Plane address for the cp_ tools. LOKI_CONTROL_URL is read if this is unset. For cp_ tools.
LOKI_CONTROL_TOKEN secret Optional: Token sent to the Control Plane, when it needs one. For cp_ tools.
Set together: code search
LOKI_CHROMA_HOST Optional: Chroma host for semantic code search. Default localhost. For loki_code_search.
LOKI_CHROMA_PORT Optional: Chroma port for semantic code search. Default 8100. For loki_code_search.
Set together: managed memory
LOKI_MANAGED_AGENTS Optional: Must be true, with LOKI_MANAGED_MEMORY, before redaction runs. For loki_memory_redact.
LOKI_MANAGED_MEMORY Optional: Must be true, with LOKI_MANAGED_AGENTS, before redaction runs. For loki_memory_redact.

What it does

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.

What it needs

RuntimeNode.js 20+Python 3.8+
Runs onmacOS, Linux
AnthropicPaid planRun tools need a logged-in Claude Code CLI or an ANTHROPIC_API_KEY. Other coding CLIs can be picked instead.
Also
  • git 2.x and curl on PATH
  • A Chroma server for semantic code search
  • The Python MCP SDK, which loki mcp checks for in a virtualenv before launch

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.

Limits

  • Platform Runs on macOS and Linux only, per the README and the package manifest.
  • Cost Runs spend model tokens. With ANTHROPIC_API_KEY or OPENAI_API_KEY set the cap is $100 by default (--max-cost changes it); a subscription login has no dollar cap.
  • Size cap Tool results over 24,000 bytes are cut and marked truncated unless LOKI_MCP_MAX_RESULT_BYTES sets another cap of at least 1,000.
  • Limit The Control Plane tools return an error unless LOKI_CP_URL or LOKI_CONTROL_URL is set in the server's environment.
  • Limit loki_memory_redact refuses to run unless LOKI_MANAGED_AGENTS and LOKI_MANAGED_MEMORY are both true.
  • Limit Semantic code search needs a running Chroma server, localhost:8100 by default. In read-only mode it refuses a Chroma host that is not loopback.
  • Not covered A signed receipt shows who produced a change and which checks ran. It does not show the code is free of bugs, and it lists the checks that did not run.
  • Limit Claude Code is the only provider with every feature. Codex, Cline, Aider and opencode are optional alternatives.
  • Limit Licensed BUSL-1.1: free for personal, internal, academic and non-commercial use. Other use needs an arrangement with Autonomi.

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.

Who it suits

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.

Tools 48

34 only read, 12 change things, 2 can delete or overwrite. A ? marks an optional parameter.

loki_v10_run changes
Starts a Loki 10 run in the background for a task, PRD or issue reference in a repo.ref: stringrepo_path: string
loki_v10_status
Reads a Loki 10 run's state from its event log, the newest run when no id is given.repo_path: stringrun_id?: string
loki_v10_verify
Runs loki verify on a receipt, or on the newest run in a repo.receipt_path?: stringrepo_path?: string
loki_seal_diff changes
Seals uncommitted changes you made yourself into a signed receipt, with checks written from the stated intent.repo_path: stringintent: string
loki_verify_fast
Runs quick deterministic checks on code with no model call.path?: stringdiff_base?: string
loki_start_project changes
Starts a project-mode build from PRD text or a PRD file.prd_content?: stringprd_path?: string
loki_project_status
Shows project progress, cycle state and agent activity.
loki_complete_task changes
Declares the current PRD or task done, with evidence and a confidence level.completion_statement: stringevidence: stringconfidence?: string
loki_state_get
Returns the current phase, metrics and status.
loki_task_queue_list
Lists the tasks in the queue.
loki_task_queue_add changes
Adds a task to the queue.title: stringdescription: stringpriority?: stringphase?: string
loki_task_queue_update changes
Changes a queued task's status or priority.task_id: stringstatus?: stringpriority?: string
loki_checkpoint_restore deletes
Lists checkpoints, or with an id rolls project state back to one.checkpoint_id?: string
loki_quality_report
Returns quality-gate results such as review scores, council verdicts and coverage.
loki_agent_metrics
Returns token use, completion rates and timings per agent.
loki_metrics_efficiency
Returns efficiency figures for the current session.
loki_findings
Reads the code-review findings for one iteration, the latest by default.iteration?: integer
loki_learnings
Reads stored learnings, newest first, 50 by default.limit?: integer
loki_counter_evidence_template changes
Writes a counter-evidence template file for an iteration.iteration: integer
loki_memory_retrieve
Pulls memories relevant to a task, 5 by default.query: stringtask_type?: stringtop_k?: integer
loki_memory_store_pattern changes
Saves a pattern learned in this session, with the right and wrong approach.pattern: stringcategory: stringcorrect_approach: stringincorrect_approach?: stringconfidence?: number
loki_memory_capture_session_summary changes
Records an episode summarising the current session.goal: stringoutcome?: stringfiles_modified?: arrayfiles_read?: arraytool_calls_summary?: stringduration_seconds?: integer
loki_consolidate_memory changes
Turns episodes from the last 24 hours by default into stored patterns.since_hours?: integer
loki_memory_redact deletes
Redacts managed-agents memory versions whose content matches a regex.pattern: stringscope?: string
mem_search
Full-text search over memory, 10 results by default.query: stringcollection?: stringlimit?: integer
mem_timeline
Shows memory entries in time order around an entry or a time window.around_id?: stringlimit?: integersince_hours?: integer
mem_get
Fetches full memory entries by ID.ids: string
loki_code_search
Searches code semantically through the Chroma index, 10 results by default.query: stringn_results?: integerlanguage?: stringfile_filter?: stringtype_filter?: string
loki_code_search_stats
Shows statistics for the code search index.
loki_graph_query
Answers a question about the codebase from a knowledge graph.question: stringbudget?: integerpath?: string
loki_get_hotspots
Lists the files that change most often, 10 by default.limit?: integer
loki_get_co_changes
Finds files that usually change together with a given file.file_path: string
loki_get_doc_coverage
Reports documentation coverage for the project.
cp_runs_search
Searches runs across every repo in the Control Plane, 50 per page by default.verdict?: stringrepo?: stringsince?: stringuntil?: stringgroup_id?: stringlimit?: integercursor?: string
cp_run_get
Shows one run's verdict, cost, stages and receipt summary.source_id: stringrun_id: string
cp_run_events
Pages through a run's events in order, 200 at a time by default.source_id: stringrun_id: stringafter?: integerlimit?: integer
cp_run_artifact
Reads one allowlisted artifact from a run.source_id: stringrun_id: stringname: string
cp_runs_compare
Compares two runs' verdicts, tokens and cost.source_a: stringrun_a: stringsource_b: stringrun_b: string
cp_stats
Returns run statistics across all repos.since?: string
cp_cost
Groups cost by day, repo or another field.group?: stringsince?: string
cp_repos_list
Lists the repo names the Control Plane knows, without paths.
loki_magic_generate changes
Generates a UI component from a description, React by default.name: stringdescription?: stringtarget?: stringplacement?: stringtags?: array
loki_magic_list
Lists or searches registered components.query?: stringtags?: arraytarget?: string
loki_magic_get
Shows the details of one component.name: string
loki_magic_update changes
Rebuilds a component after its spec changes.name: stringspec_update?: stringforce?: boolean
loki_magic_debate
Has reviewer personas debate a component, 3 rounds by default.name: stringrounds?: integerpersonas?: array
loki_magic_tokens_extract
Pulls design tokens out of the codebase.
loki_magic_stats
Returns component registry statistics.

Resources 3

loki://state/continuity
The project's continuity notes.
loki://memory/index
The memory index.
loki://queue/pending
Tasks still pending in the queue.

Prompts 2

loki_start
Opens a Loki Mode session, optionally from a PRD path.
loki_phase_report
Drafts a status report for the current phase.

Similar servers