AgentStack MCP
One deterministic reasoning stack for AI agents — behind a single
Model Context Protocol (MCP) endpoint and one
API key:
simulate (ScenarioSim) → decide (DecisionMatrix) → compute (PrecisionCalc)
plus cross-domain composite tools that chain the three. Every number runs
through decimal.js at 40-digit precision
(never floats), so identical inputs always produce byte-identical output.
The server is stateless — no database, no sessions.
AgentStack bundles three standalone MCP servers so an agent installs one
server, uses one key, and can run reasoning that spans all three domains. It
imports the same engines directly (no HTTP proxying) — zero added latency, no
cascading failure.
🌐 Live hosted server (free, no install)
Free tier: no key, 20 calls/day per IP. Paid plans (Starter $19/mo · 8,000/day,
Pro $59/mo · 80,000/day) return an API key sent as X-API-Key. One key covers
all three products and the composites — about half the cost of subscribing to them
separately. Landing page: https://agentstack-mcp.pages.dev.
The three namespaces (24 tools)
Note on two deliberately-namespaced collisions: sim_sensitivity varies
scenario inputs; decide_sensitivity varies criteria weights. They are
different operations — the prefix disambiguates them for the agent.
Composite tools — the reason to use the stack
Deterministic end-to-end; each chains engines that no single server bundles:
Composite responses report the pipeline they ran and carry each stage's
structured output, so an agent can drill into any step.
Profiles — fight tool-selection noise
Append ?profile= to the endpoint to load only a subset:
Response envelope
Namespaced tools return the exact envelope of their underlying product. Composite
tools add composite, pipeline, per-stage blocks, methodology, notes, and a
plain-language explanation. Errors are always structured data:
Example — plan_to_valuation (trimmed):
Project structure
Why vendor the engines? So this repo is self-contained and reproducible. The
engines are the same deterministic modules that power the three standalone
servers; npm run sync-engines re-copies them from the sibling repos when an
upstream change lands.
Run it locally
Quick manual call:
Install via npm (stdio, no hosting)
Run the server locally over stdio with a single command — nothing to deploy:
Claude Desktop / any stdio MCP client (claude_desktop_config.json):
This is the same deterministic engine as the hosted server, running on your machine.
Client configuration
Cursor — ~/.cursor/mcp.json
Claude Desktop — claude_desktop_config.json (via mcp-remote)
VS Code — .vscode/mcp.json
Windsurf — ~/.codeium/windsurf/mcp_config.json
Add "headers": { "X-API-Key": "ssak_live_..." } once you have a key.
Example composite payloads
Rank growth strategies on their projected outcomes:
Value a plan's MRR stream:
Stress-test the decision:
Deploy on Cloudflare Pages
Runs fully free / private with no bindings or secrets (fails open on the free
tier). For billing: bind a KV namespace AGENTSTACK_KV, set PRICE_STARTER /
PRICE_PRO in [vars], and add Stripe secrets:
Routes: /mcp (Streamable HTTP), /checkout, /success, /portal, /webhook, /metrics.
Auth & rate limiting
Enforced in worker-src/billing.mjs: identify() reads X-API-Key /
Authorization: Bearer and falls back to per-IP free tier; consumeQuota() is a
KV daily counter (the single gating point). One key / one quota spans the whole
stack. Marked NOTE (auth) / NOTE (rate limiting) seams show where to swap in
JWT/mTLS or a token-bucket. None of it touches the deterministic math.
Relationship to the standalone servers
AgentStack is additive, not a replacement. The three products keep running on
their own for single-domain use:
License
MIT — see LICENSE.