Skip to content
laminarity

Guides

Laminarity MCP

A local MCP server that saves the tokens of an expensive coding agent. The agent hands self-contained subtasks that have a check to spu_delegate; a cheap model writes the patch, the check runs in a sandbox, and the patch is applied only when it is very likely right.

How a subtask is handled

  1. The agent calls spu_delegate with the task, the files and the name of a check (tests, linter, type checker).
  2. A router decides whether delegating is worth it; tiny edits stay with the agent.
  3. DeepSeek V4 Flash writes a patch in a clean copy of the repository, through your Laminarity key.
  4. The whitelisted check runs on the patch in a sandbox, and a one-token yes/no gate judges the result.
  5. The patch is applied only if the calibrated belief that it is ready reaches 0.8; otherwise the agent does the work itself.

1. Install the binary

Version v0.2.0. Pick the file for your platform and check it against SHA256SUMS:

PlatformFile
macOS · Apple siliconspu-mcp-darwin-arm64
macOS · Intelspu-mcp-darwin-amd64
Linux · x86-64spu-mcp-linux-amd64
Linux · ARM64spu-mcp-linux-arm64
Windows · x86-64spu-mcp-windows-amd64.exe
Windows · ARM64spu-mcp-windows-arm64.exe
curl -LO https://laminarity.uk/downloads/mcp/v0.2.0/spu-mcp-darwin-arm64
curl -LO https://laminarity.uk/downloads/mcp/v0.2.0/SHA256SUMS
shasum -a 256 -c SHA256SUMS --ignore-missing
sudo install -m 755 spu-mcp-darwin-arm64 /usr/local/bin/spu-mcp
xattr -d com.apple.quarantine /usr/local/bin/spu-mcp 2>/dev/null || true
spu-mcp --version

2. Add your key and wire up the client

Create a key in the dashboard, export it in the profile of the shell that starts your client, then run init in the repository root with claude-code, codex, opencode or openclaw:

echo 'export LAMINARITY_API_KEY=sk-or-...' >> ~/.zshrc
source ~/.zshrc
cd your-repo
spu-mcp init claude-code
spu-mcp doctor

init shows every file it is about to write and asks before each one:

  • .spu/agent.yaml with checks guessed from the project, a price file, and .spu/ in .gitignore;
  • a separate consent question: may code of this repository be sent to the model;
  • the client config, merged rather than overwritten — .mcp.json, ~/.codex/config.toml, opencode.json or .openclaw/mcp.json;
  • a short instruction block for the agent in CLAUDE.md or AGENTS.md.

Review the checks whitelist in .spu/agent.yaml: only those commands ever run, as argv without a shell. Then run spu-mcp doctor — every line is ok or FAIL with the fix. spu-mcp doctor --live adds one tiny paid call. Restart the client afterwards.

Tools the agent sees

ToolWhat it does
spu_delegateGive a subtask with a check. Answers self, escalate, applied or pending.
spu_checkRun a whitelisted check; get failures with file:line and the belief that the task diff is ready.
spu_undoRevert an applied change by change_id; refuses if the files were edited afterwards.
spu_taskMark task boundaries — start with a title, type and size, then stop.

What leaves your machine

  • Only with consent for this repository: the task text, the listed files, the check name, and on a retry the previous diff and compressed check output.
  • Never: files that match secret masks (.env*, *.pem, *.key, secrets/**, …) or text that looks like a key — such a subtask is escalated before anything is sent.

Sandbox

Checks run without network except loopback, with writes only inside the work copy, a memory limit and a timeout: user and network namespaces plus Landlock on Linux, Seatbelt on macOS. Windows has no sandbox, so checks run there only if you allow it explicitly.

Cost and the savings report

Model calls are billed from your Laminarity balance at $0.15 per million tokens. spu-mcp report compares what the agent would have spent with what delegation actually cost, so you can see whether it pays off for your codebase.