Back to Browse

Caveat Lang MCP Server

Developer ToolsLow Risk9.7MCP RegistryLocal
Free

Server data from the Official MCP Registry

Caveat authoring bridge: validate, check, test, step saves, explain, search and trace decisions.

About

Caveat authoring bridge: validate, check, test, step saves, explain, search and trace decisions.

Security Report

9.7
Low Risk9.7Low Risk

Valid MCP server (1 strong, 2 medium validity signals). No known CVEs in dependencies. ⚠️ Package registry links to a different repository than scanned source. Imported from the Official MCP Registry. 1 finding(s) downgraded by scanner intelligence.

13 files analyzed · 1 issue found

Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.

How to Install

Add this to your MCP configuration file:

{
  "mcpServers": {
    "caveat-lang": {
      "command": "npx",
      "args": [
        "-y",
        "caveat-lang"
      ]
    }
  }
}

Some servers take additional arguments. See the repository for details.

Documentation

View on GitHub

From the project's GitHub README.

CAVEAT Language

OpenSSF Best Practices

A decision ledger for agents: Caveat keeps an AI's reasons in a record you can check.

Most programs and agents act on evidence, then lose track of why. Later a tool result is corrected, a memory turns out stale, or an assumption fails, and three hard questions follow: what did this decision rest on when it was made, what else rests on that same evidence, and what needs to be reconsidered?

Caveat is an embeddable rules language and WebAssembly runtime (Node.js, browser, MCP, Python, no npm dependencies, no Rust needed to install) built for decisions that may need taking back. Every value carries the evidence and caveats it was computed from; every committed decision freezes its exact grounds; and when evidence is withdrawn or qualified later, rules you write reopen the affected decisions without erasing history.

Limits states up front what Caveat does not do (verify that evidence is true, sign saves, or authenticate who sent an event) and what it costs.

Published release: caveat-lang@1.5.1 (a patch release of 1.5.0, the fifth minor release of 1.x; stable under the 1.x compatibility commitment). npm publication verified 2026-11-29T16:15:59.421Z, tested Linux tarball SHA-256 ee625780717e2986c18c89c96201e46be9f13dd3dd63b320368549246e5e0034, published by publish-npm.yml from tag v1.5.1 with npm provenance. npm latest and next and the MCP Registry (io.github.WSattazahn/caveat-lang) are verified at 1.5.1. 1.5.1 release record · 1.5.0 release record · Publication receipt · What Caveat is for (one page)

When Caveat is useful

Use Caveat when decisions get revisited and someone — a user, a reviewer, or another agent — will later ask "why was this done, and what changes now that this reading was wrong?"

Use caseWhat Caveat gives youExample
Agent undo lists & tool correctionsWithdraw a bad tool output; reopen only the actions whose frozen grounds depended on it, keeping every original reason intact15-minute agent undo-list tutorial
Release, deploy & approval gatesRecord test readings, named thresholds, caveats, and explicit grants (permitted by) separately from grounds; reopen when a check is withdrawn or agesEngineering readiness · PR ledger Action
Multi-agent handoffsPass a compact save to a sub-agent, enforce foreclosures (irreversible forecloses), hold changes mid-task, and keep sub-agent caveats on returnHandoff example
Auditable decision memoryInspect decisions with caveat explain, trace forward impact with caveat dependents, search past ledgers with caveat find, or step a ledger over MCP (caveat_dispatch, caveat_find)Project's own ledger · Retracted studies

When plain code is better: one-off actions nobody will revisit, hot inner loops (events take tens of microseconds in WebAssembly), or programs where no one will ever ask "why?".

Try it in 60 seconds

In an empty directory with Node 20 or later (no Rust installation needed):

npm init -y
npm install caveat-lang@1.5.1

From Python 3.9 or later, pip install caveat-lang installs the same runtime at the same version (Python guide).

Paste this "hello, world": one piece of evidence, one decision resting on it, and one event that withdraws the evidence and reopens the decision:

cat > hello.cav <<'CAV'
claim safe_to_ship;
evidence ci from "the CI run";
evidence rerun from "a rerun of CI";
readings tests from ci limit 2;
decisions ship limit 2;

event ci_passed;
event ci_was_wrong;

on ci_passed sample tests = 1 supports safe_to_ship;
on ci_passed commit ship because enough using latest(tests);
on ci_was_wrong reveal rerun opposes safe_to_ship;
on ci_was_wrong withdraw latest(tests) because rerun;
on ci_was_wrong reopen ship because rerun;
CAV
printf '%s\n' '{"event":"ci_passed"}' '{"event":"ci_was_wrong"}' > events.jsonl
npx --no-install caveat-lang explain hello.cav events.jsonl

Part of what it prints:

    ship@1 = 1  reopened
      based on tests@1
      tests@1: observed at #1 ci_passed
      tests@1 has since been withdrawn at #2 because rerun
      #1 ci_passed: committed because tests@1
      #2 ci_was_wrong: reopened because rerun

The decision was reopened when the CI result it rested on was withdrawn, and it still records what it was originally based on.

To check the installation, watch a multi-revision agent lifecycle (observe → assess → retract → replace), or scaffold the starter project with scenarios:

npx --no-install caveat-lang doctor
npx --no-install caveat-lang demo agent
npx --no-install caveat-lang init
npx --no-install caveat-lang test umbrella.scenarios.json
npx --no-install caveat-lang explain umbrella.cav events.jsonl

caveat-lang is the unambiguous CLI command; caveat is supported shorthand (CLI names).

Start here

If you want to…Start here
Understand the value in 2 minutesWhat Caveat is for · Why Caveat
Give an agent an undo list in 15 minutesAn agent with an undo list (tutorial)
Walk through Caveat step by stepGetting started · Worked example
Connect an agent over MCP (local or hosted)MCP server · MCP setup & limits
Write .cav programs cleanlyAuthoring card · Caveat on one page · Authoring guide
Embed Caveat in Node, browser, or PythonAgent quickstart · Integration starter · Python caveat serve example · Python native package
Use Caveat in a gameCaveat in a game · Intel betrayal example
See three agents share one ledger in your browserThree agents, one record
Test withdrawal guarantees in your browserTry to break this
Check what is proved, tested, and promisedWhat is checked, and how · Compatibility commitment · Limits
Browse every language & kit specificationDocumentation index · spec/
Report a missing capabilityAgent feature requests
See what each release changedRelease history

Try it with a coding agent

Give a coding agent this prompt in an empty directory:

Install the caveat-lang npm package (Node 20 or later) in this empty directory
and run `npx --no-install caveat-lang init`. Read
node_modules/caveat-lang/docs/REFERENCE.md before writing any Caveat source.
In umbrella.cav, raise the rain chance needed to commit the umbrella decision
from 50 to 60. Add a scenario to umbrella.scenarios.json showing that a 55%
forecast leaves the advice at "No decision yet". Run
`npx --no-install caveat-lang check umbrella.cav` and
`npx --no-install caveat-lang test umbrella.scenarios.json`, then run
`npx --no-install caveat-lang explain umbrella.cav events.jsonl` and tell me
what umbrella@1 rests on and why it was reopened. Change no other files.

The three scenarios pass, and explain shows umbrella@1 still resting on rain_chance@1 and its forecast_is_old caveat after sky reopened it.

Principles and capabilities

For the thinking behind Caveat, read The Caveatist way.

Say what you know, and what it rests on.
Carry the caveats honestly.
Give uncertainty the attention its consequences deserve.
Act when there is enough to proceed.
Remember why you chose, and remain willing to choose again.

These are the project's principles, not license conditions: Caveat is MIT-licensed and using it requires adopting none of them.

  • Values carry their evidence. Every number computed from an observation carries that evidence and its caveats through every sum, comparison, function call, and label.
  • Explanations are checked against recorded dependencies. Anything a program shows can say why (because), and the runtime refuses a citation outside the value's recorded dependencies (evaluation/ungrounded_citation). That does not prove the evidence true or the explanation complete.
  • Decisions remember. A decision freezes its grounds (and separately its grant, permitted by, and named thresholds), reopens under authored rules or triggers when evidence changes or is withdrawn, and keeps an ordered decision_journal.
  • Late knowledge qualifies without rewriting the past. qualify and unqualify reach current values built on the evidence; earlier decision records keep what they knew at commit time.
  • Refusals leave no trace. An authored reject, missing permission, out-of-range input, or resource-limit refusal rolls back the entire event atomically; hosts inspect structured dispatch outcomes before acting.
  • Complements platform governance. Caveat records supplied evidence and authored policy; it does not sign saves, authenticate evidence, or authorize external actions (threat model, restore trust boundary).

What Caveat makes part of the language

These mechanisms can also be implemented in a general-purpose language through application code or libraries. Caveat supplies them together as language and runtime facilities; the comparison is about what an author has to build and keep in sync, not what another language can express.

CaveatIn a general-purpose language
Explanationsbind label = "Could be a duskcap" when … because contradiction; The runtime checks cited evidence and caveats against recorded dependencies.Implement dependency tracking and citation checks, or use a library that supplies them.
Caveats through computationqualified(1, taste, tasted_in_dark) carries evidence and caveats through computations that use it.Use provenance-aware values and operations to propagate the same information.
Late caveatsqualify taste with taste_faded; qualifies current values built on the taste while earlier decision records retain their frozen caveats.Track dependencies or resolve qualifications when read, and freeze decision records.
Decisions that remembercommit, reopen, hold/release, resolve, and decision-series revisions retain each revision's grounds and publish changes in decision_journal.Implement decision records, frozen bases, and an ordered change journal.
Grounds and lineageThe runtime distinguishes a value's content grounds from its wider control lineage and enforces grounds ⊆ lineage.Represent both kinds of dependency and enforce their relationship in code or a library.
Atomic eventsreject "already absorbed"; rolls back the event's changes to the Caveat session.Use transactions, immutable state, or explicit rollback to publish changes atomically.

Citation checking establishes that cited dependencies were recorded; it does not establish that supplied evidence or authored explanation prose is true, or that a citation is exhaustive.

The evidence: the glowcap benchmark

The glowcap benchmark implements the same game beat in Caveat and in TypeScript against:

  • a frozen, pre-registered scenario suite;
  • sixteen change requests across eight rounds (including blind rounds by fresh authors);
  • seeded differential fuzz comparing accepted and rejected events, views, and save/resume behavior.

The results file records every round's change cost, size, first-run passes, and verdict — including the rounds TypeScript won — and the weak spots that became Caveat's language work list. Fresh-agent authoring trials are also recorded in experiments/agent-authoring/ (v1, v2, v3, v4).

What Caveat costs is in Limits, and what is formally proved versus tested is in What is checked, and how (Lean model).

A taste

event absorb target kind mushroom, sort in glowcap duskcap;

for mushroom as $m {
    on absorb when $m_here and $m_consumed == 1 reject "already absorbed";
    on absorb when $m_here and sort == sort.glowcap
        set support = support + qualified(1, absorb_$m);
    on absorb when $m_here and sort == sort.duskcap and committed(trust)
        reopen trust because absorb_$m;
    on tick when $m_tasted_at >= 0 and now - $m_tasted_at >= 60
        qualify taste_$m with taste_faded;

    bind $m.label = "Probably a glowcap" when $m_unknown and probably_safe because support;
    bind $m.label = "Could be a duskcap — taste first" when $m_unknown and uncertain because contradiction;
};

Read Why Caveat for side-by-side TypeScript and Caveat code. To write your first program, start with the authoring card and authoring guide.

MCP server

The package includes a local MCP server, caveat-lang mcp, that gives an agent Caveat's seven authoring and ledger operations as tools. It runs over stdio, needs Node 20 or later and no Rust, and is listed in the MCP Registry as io.github.WSattazahn/caveat-lang (server.json). Add it to an MCP client's configuration:

{
  "mcpServers": {
    "caveat-language": {
      "command": "npx",
      "args": ["-y", "caveat-lang@1.5.1", "mcp"]
    }
  }
}

A free, stateless Streamable HTTP copy of the same seven tools (running published caveat-lang@1.5.1) is also hosted at https://caveat-mcp.waltersattazahn.workers.dev/mcp (source and limits).

ToolInputsResult
caveat_validatesourceWhether the program loads and what it declares
caveat_checksource, optional strictAuthoring diagnostics and suppressed warnings
caveat_testsource, scenariosScenario results, invariant checks, and check warnings
caveat_explainsource, optional eventsDecisions, their exact grounds, caveats, and history
caveat_dependentssource, subject, optional eventsWhat depends on the named evidence, stream, or caveat
caveat_dispatch (from 1.5.0)source, optional save, optional moduleBindings, optional eventsOne step of a running ledger: the state after the events, and the compact save to pass back next time
caveat_find (from 1.5.0)source, records, queryPast decisions matching every word, with their grounds and whether they still stand

Every tool works on inline source text and supplied events. The server has no file, network, or persistent-session tools, and runs each call in a fresh subprocess with a 10-second limit. It speaks MCP 2026-07-28 and 2025-11-25. MCP setup and limits covers the protocol, result format, limits, and host configs. A tool's report does not authorize an external action or authenticate its evidence.

Interactive demos and games

Everything below runs in the browser on the WebAssembly runtime (demonstrations, not part of the npm package's compatibility promise):

  • What Caveat is for — one-page overview, runnable example, and limitations.
  • Three agents, one record — three agents (security, perf, comms) contribute to one release ledger; withdraw one stale source and see selective reopening with live caveat explain and caveat dependents (web/agents.cav).
  • Try to break this — one precise claim about withdrawing evidence, checked step by step against five rules in your browser.
  • Glowcap explainer — start with Change what you know: make a trust decision in one click, learn something new in a second, and see what reopened and what stayed frozen (game/glowcap.cav).
  • Trail Rescue — weigh fallible scout reports, choose a tunnel, and reconsider when evidence ages (game/trail_rescue.cav, protocol, results).
  • Light the Way — direct-control ferry rescue powered by the reactive runtime (game/light_the_way.cav, design notes).
  • The Last Beacon — 3D island mystery with nine evidence-dependent outcomes (game/the_last_beacon.cav, design notes).
  • Moon Garden (3D version) & Mr. Caveat — earlier story demos and the mechanical fortune teller.

Build and play

With rustup and Node.js 20 or newer installed, run from the repository root (rust-toolchain.toml pins the compiler and installs the WebAssembly target on first use):

cargo install wasm-bindgen-cli --version 0.2.104 --locked
npm ci
npm run build
npm run serve

The build also writes dist/pkg-reactive/ (the reactive-only runtime built with --no-default-features, about a fifth smaller). Open http://127.0.0.1:4173/about.html, glowcap.html, trail-rescue.html, rescue.html, or last-beacon.html.

To play The Last Beacon in a terminal without a browser:

cargo run --manifest-path runtime/Cargo.toml --bin caveat -- --game game/the_last_beacon.cav

For standalone offline HTML copies (dist/Light-the-Way.html, dist/The-Last-Beacon.html), run npm run package:game after building.

Verify

cargo test --manifest-path runtime/Cargo.toml
cargo clippy --manifest-path runtime/Cargo.toml --all-targets -- -D warnings
npm run test:kit
npm run test:ledger
npm run test:slime-glow
npx playwright install chromium
npm run test:beacon
npm run test:rescue

Run npm run build before the Node and Playwright suites (npm run test:kit, npm run test:kit-package, npm run test:beacon, npm run test:rescue, npm run test:slime-glow, npm run test:trail-rescue, npm run test:launch). See developing the kit and what is checked, and how for the full test matrix.

Release history

All 1.x releases honor the compatibility commitment: 1.x minors only add, and earlier 1.x saves continue restoring. Full verification receipts and checksums live in docs/releases/.

  • 1.5.1 (release record): a reused view keeps a leading U+FEFF, rounds an examine cost of 2^56 or more as JSON.parse does, and gives each empty list its own array (D113–D115). Under work skips other routes;, a true ends a guard's route, as Routed Work 0.1 says, and saves 1.5.0 wrote keep 1.5.0's count (D116).
  • 1.5.0 (release record): adds six language profiles (sum/any/all across members, grounds_of, sample … with reading caveats, named thresholds, work skips other routes;, and state … unset / is_set with refusal code evaluation/unset_state), caveat find and caveat_find, the caveat_dispatch MCP tool, incremental reused views (dispatchView(..., { reuse: true })) with compact binary wire patching, opt-in check (--withdrawals, --names), explain (--later-caveats, --lineage-notes) and review --all --summary flags, and whatIf(..., { agent }). Delivers the module-binding correction (moduleBindings restore option), removes restore's 16 MiB state-save cap, fixes runtime and restore validation findings (D027–D105), and speeds up event dispatch and view patching.
  • 1.4.1 (release record): fixes withdrawn propagation through committed(D), reopened(D), and in_basis(D, E) (D026), and refuses oversized computed text as limit/text_limit instead of ending the session (D025).
  • 1.4.0 (release record): adds agent sender declarations, withdraw every, only_if, carries_any, reversible foreclosure, irreversible strict, caveat review, ledger sets (review --all), session.whatIf, caveat-lang/handoff, and caveat-lang/saves.
  • 1.3.0 (release record): adds recorded outcomes (resolve, resolved, outcome, materialized) so programs can score forecasts against what happened.
  • 1.2.0 (release record): adds nested for blocks, holds (hold … because, release, on_hold), irreversible forecloses, positional replay saves, and selected view fields.
  • 1.1.0 (release record): adds citing, retaining … because, neutral and noted samples, reading(STREAM, N), in_basis, changed triggers, compact replay saves, and late-qualification propagation through decision reads (D015).
  • 1.0.3 (release record), 1.0.2 (release record), 1.0.1 (release record): patch fixes for caveat take-back and windowed departure interaction (D012–D014, D016, D018, D020).
  • 1.0.0 (release record): first stable release establishing the 1.x compatibility promise; earlier 0.1.0 release candidates (rc.1–rc.20) are archived in docs/releases/.

Repository layout

  • runtime/ — Rust reference runtime (native + WebAssembly) and runtime/prelude.cav
  • kit/ — the caveat-lang npm package (CLI, Node/browser library, MCP server, starter, docs, examples, tests)
  • spec/ — versioned language, runtime, save, view, CLI, and kit specifications
  • docs/ — guides (AI_AUTHORING.md, WHY_CAVEAT.md, LIMITS.md, COMPATIBILITY.md, VERIFICATION.md, tutorials, release records)
  • hosted-mcp/ — Cloudflare Worker hosting the published caveat-lang MCP server over Streamable HTTP
  • plugins/ & skills/ — Anthropic (Claude Code/Cowork/apps) and OpenAI (ChatGPT/Codex) Caveatist plugin & skill packaging
  • python/ — native PyO3 Python bindings (caveat_lang) matching the npm kit byte-for-byte
  • actions/pr-ledger/ — GitHub Action tracking what merged PRs rested on in Caveat
  • editors/vscode/ — VS Code TextMate syntax-highlighting extension for .cav files
  • ledger/ — Caveat's own project decision ledger (project.cav, events.jsonl, scenarios)
  • proofs/lean/ — Lean 4 mathematical model and conformance theorems
  • examples/ & tests/ — standalone .cav examples and canonical semantic tests
  • game/ & web/ — playable browser demos, explainers, and about.html / break.html
  • scripts/ — build, packaging, release-gate, distribution-check, and verification tooling
  • caveatism/ — optional Caveatist philosophy, Archive, Atlas, canon program, and Mr. Caveat artwork

Do not save CAVEAT by redefining it. If the computational model collapses into an existing paradigm, record the result.

License

Caveat's code and documentation are available under the MIT License. Third-party components keep their own licenses: the Rust crates compiled into the WebAssembly runtime are listed with their notices in THIRD_PARTY_NOTICES.md, and the site's copy of three.js ships with its license as vendor/THREE-LICENSE.txt.

Report vulnerabilities privately as the security policy describes; the threat model sets out the trust boundaries. CONTRIBUTING.md says how to report bugs and what a pull request needs.

Culture

Caveatism is the philosophy that grew up around Mr. Caveat, a mechanical fortune teller who always has a caveat; it lives in caveatism/ and is culture, not a contract of the language. The Archive and Atlas are its texts, and the canon keeps the Archive as a Caveat program with scenarios.

Mr. Caveat holding a fortune ticket whose fine print runs off the card

Reviews

No reviews yet

Be the first to review this server!