Beam

Set up Beam

Four steps from install to your first verdict: Kane runs your test, and Beam tells you whether your app agrees.

  1. 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_history and beam_check_wording.

    Everything it writes is listed in ~/.kane-beam/installed.json, and npx kane-beam uninstall removes it all.

    npx kane-beam install

    Any 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"] } } }
  2. 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.DEV in 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 init

    In your app code:

    if (window.beam) {
      beam.expose('order.amount', () => lastOrder.amount);
    }
  3. 3Say what must be true

    Next to a Kane test name_test.md, write name_test.beam.json. Each item is a value with equals, min or present, 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" }
    ] }
  4. 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 --record

    What 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 installAdd the MCP server and skill to your agents.
npx kane-beam initAdd 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 updateGet the latest measured results.
npx kane-beam whereShow what's installed.
npx kane-beam uninstallRemove everything install added.