Local engine for typed, calibrated decisions for AI agents.
decision-cascade exposes typed decisions as MCP tools. An agent asks “should I refund?” or “which tool should I call?” and gets a probability instead of prose; the expensive LLM call is reserved for cases that really need it.
# stdio: the client starts the process
decision mcp --stdio
# HTTP: opt-in, loopback only
decision mcp --http --port 8765
Client configuration (Claude Desktop, OpenCode and other MCP clients):
{"command": "decision", "args": ["mcp", "--stdio"]}
HTTP mode is enabled by --http or DECISION_MCP_HTTP=1. The default address is 127.0.0.1:8765; non-loopback binds are rejected so the service cannot leak onto the network by accident.
| Tool | What it does |
|---|---|
capabilities |
Version, backend, modalities, feedback support, question names. |
decide |
state + questions → typed decisions, trained and usage; optional images/videos and media_kwargs (video needs ffmpeg on the server). |
feedback |
Labelled decisions for the few-shot risk model; validated and grouped by question. |
calibrate |
ECE, example counts and drift per question; no state. |
The questions shape matches POST /decisions: noul, choice or score. The state, question count and option limits are the same (DECISION_MAX_*) because MCP uses the same backend and validator.
Example decide call:
{"state": "the customer asks for a refund", "questions": {"refund": {"type": "noul", "instructions": "Refund?"}}}
Host and Origin are allowlisted so a browser page cannot hit the server through DNS rebinding.DECISION_MCP_TOKEN enables Authorization: Bearer <token>; without it HTTP accepts non-browser clients without Origin and rejects a browser Origin. Set a token for browser pages.DECISION_MCP_MAX_BYTES (default 1 MiB) rejects oversized requests before parsing, including chunked bodies: the body is streamed and cut off at the limit.calibrate under the stats token. When DECISION_STATS_TOKEN is set, calibrate requires the same bearer as GET /v1/stats./etc/passwd in state is just a string to decide on.state in errors. Only the exception class is returned, never the request text.DECISION_BACKEND=http|cascade, decide may call an external service; stdio opens no network ports, HTTP listens on loopback only.| Variable | Meaning | Default |
|---|---|---|
DECISION_MCP_HTTP |
enable HTTP when started without a flag | 0 |
DECISION_MCP_HOST |
HTTP address (loopback only) | 127.0.0.1 |
DECISION_MCP_PORT |
HTTP port | 8765 |
DECISION_MCP_TOKEN |
HTTP bearer token; empty — no token | — |
DECISION_MCP_MAX_BYTES |
maximum body size | 1048576 |
The HTTP transport implements JSON-RPC over POST /mcp and targets local integrations. Streamable HTTP/SSE, OAuth and multi-tenant isolation are outside the beta: put a reverse proxy with TLS, authentication and rate limiting in front of any public deployment.