decision-cascade

Local engine for typed, calibrated decisions for AI agents.

View the Project on GitHub slavabars/decision-cascade

MCP: decisions for 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.

Running

# 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.

Tools

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?"}}}

Security

Variables

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

Beta limits

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.