Set up Beam
Four steps from install to your first verdict: Kane runs your test, and Beam tells you whether your app agrees.
- Node 20+
- Kane CLI, signed in with
kane-cli login - A coding agent: Claude Code, Cursor, Codex, or any MCP client
1Give your agent Beam
Adds Beam's MCP server and skill to the agents it finds on this machine: Claude Code, Cursor and Codex. Your agent gets four tools:
beam_verify,beam_app_state,beam_app_historyandbeam_check_wording.Everything it writes is listed in
~/.kane-beam/installed.json, andnpx kane-beam uninstallremoves it all.npx kane-beam installAny other MCP client: add this server. It's in the MCP registry as
app.vercel.kane-beam/beam.{ "mcpServers": { "beam": { "command": "npx", "args": ["-y", "kane-beam", "mcp"] } } }2Let your app report its truth
Adds a small probe to your dev build: a script tag in plain HTML, or a loader behind
import.meta.env.DEVin Vite. For Next.js it prints the line to add.Then, next to the feature, expose what the code knows, not what the screen shows. The probe also records your app's requests with their status codes and its JS errors, with no extra code.
It does nothing on a page that isn't on your machine, talks only to Beam on 127.0.0.1 with a per-session token, and hides storage values whose keys look like secrets.
npx kane-beam initIn your app code:
if (window.beam) { beam.expose('order.amount', () => lastOrder.amount); }3Say what must be true
Next to a Kane test
name_test.md, writename_test.beam.json. Each item is a value withequals,minorpresent, or one of the two built-in checks.Always keep
"network": "no-failures": it catches failed requests the page hides, with no extra code.checkout_test.beam.json
{ "truth": [ { "key": "order.amount", "equals": 45 }, { "network": "no-failures" }, { "errors": "none" } ] }4Verify
Kane runs the test in a real browser, and Beam weighs its verdict against what the app reported. The first run records the test, which costs Kane credits. Later runs replay it for free.
Exit code 0 means Balanced, 1 means not, so it works in CI. Beam refuses to run if the test, its recording or its truth file changed, so a fix has to land in the app.
Or ask your agent: “Verify the checkout with Beam and fix what it finds.”
npx kane-beam verify tests/checkout_test.md --recordWhat a catch looks like:
False green: Kane passed, the app says it's broken. ok cart.total: expected 45, app reported 45 NO order.amount: expected 45, app reported 50 NO no failed requests: POST /api/orders → 500
All commands
npx kane-beam install | Add the MCP server and skill to your agents. |
|---|---|
npx kane-beam init | Add the probe to your app's dev build. |
npx kane-beam verify <test> | Run a Kane test and weigh it. --record the first time, --accept-changes after an intended test change. |
npx kane-beam check "<wording>" | Look up a Kane check wording. Exits 1 on a measured false green and prints the wording that works. |
npx kane-beam update | Get the latest measured results. |
npx kane-beam where | Show what's installed. |
npx kane-beam uninstall | Remove everything install added. |