reins-spend-mcp
v0.2.0
Published
Reins — let an LLM pay APIs only inside an on-chain spend policy (budget, payee allowlist, expiry, revoke) on Solana. MCP server + CLI.
Maintainers
Readme
reins-spend — agent spend under on-chain policy
Public product: Reins. Program cso_agent, demo ticker CSO, Solana Devnet.
Lets an LLM (Cursor / Claude) spend only under on-chain policy. Over-budget and wrong payee fail on-chain (INV-I1 + allowlist), not in the prompt.
New here? Start with QUICKSTART.md — reading a policy needs no key at all.
Install
From this repo (works today):
cd colosseum/agent && npm i
npm run policy
npm run pay-merchant
npm run jailbreak -- over-budget # must fail
npm run jailbreak -- wrong-payee # must failnpm run policy works with REINS_ROOT_OWNER + REINS_AGENT_WALLET alone. Spending needs a root key (fees) and a delegated agent key (npm run setup).
One package, two bins. Once published: npm i -g reins-spend-mcp gives you reins-spend, and MCP clients launch the server with npx -y reins-spend-mcp. A one-off CLI run needs the package flag: npx -y -p reins-spend-mcp reins-spend policy. npm pack is verified in CI; the publish itself is pending npm 2FA.
MCP
Official SDK over stdio. Copy mcp.example.json into .cursor/mcp.json or claude_desktop_config.json. This repo already wires it in .cursor/mcp.json alongside solana-mcp (docs, not spend).
Tools: reins_get_policy · reins_spend · reins_pay_merchant · reins_jailbreak
reins_jailbreak returns passed: true only when the program refused. A missing key or dead RPC reports INCONCLUSIVE rather than a fake win.
Keys
| Key | Holds | Signs |
|-----|-------|-------|
| Root | SOL + CSO, owns vault | policy changes, tx fees |
| Agent | nothing | spend only, capped by policy |
The agent key never falls back to the root key. If it is missing, spend refuses; set REINS_ALLOW_ROOT_AS_AGENT=1 to override for a one-wallet demo. REINS_SECRET_KEY / REINS_AGENT_SECRET_KEY let CI run with no files on disk. See .env.example.
State (.env, agent keypair) lives in the package dir inside this repo, otherwise in REINS_HOME (default ~/.reins).
Build and test
npm run typecheck
npm run test # error classification, no network
npm run build # dist/cli.js + dist/mcp.js with shebangsThe SDK (reins-spend-sdk, ../sdk) is bundled into dist, so the published tarball has no monorepo dependency.
Skill
.cursor/skills/reins-spend/SKILL.md — when the user asks the agent to pay an API, run these tools. Never move funds outside spend.
