chance-mcp
v1.0.0
Published
Chance verification harness as an MCP tool — the AI judge between an agent's intent and its action. Verify a proposed action against its mandate before it executes, and get a signed, independently-verifiable verdict.
Maintainers
Readme
chance-mcp
Chance verification as a tool your agent can call.
Chance is the verification harness for AI agents that move money — the independent judge between an agent's intent and its action. This package is the local (stdio) server, so any MCP-compatible desktop/IDE agent (Claude Desktop, Claude Code, Cursor, Windsurf, …) can verify a proposed action against its mandate before it executes, and get a signed, independently-verifiable verdict back.
It uses the same API key and credits as the Chance HTTP API.
How it works. This package is a thin stdio-to-HTTP proxy: it forwards MCP messages to the hosted Chance server and returns its replies. The tools, their schemas and their behaviour all live server-side, so this package never goes stale — you get new tools and fixes without upgrading it.
Web or mobile assistant? Claude.ai, ChatGPT, Claude mobile, and the AI platform APIs can't launch a local process — connect them to the hosted server instead (one-click OAuth, no install): see Connectors.
Two levels of integration.
verify_intentgives your agent the verdict — you still handle execution and decide to honor it (fail-closed: treat anything other thanALLOWas do-not-execute). The escrow tools are the enforced version: funds live in a Chance escrow wallet that only moves through a verified proposal, so a failed check literally can't be ignored.
Setup
- Sign in at harness.chance.cc/login — you get 50 free credits, no card required.
- In the dashboard, click Create API key and copy it.
- Add the server to your MCP client's config:
{
"mcpServers": {
"chance": {
"command": "npx",
"args": ["-y", "chance-mcp"],
"env": { "CHANCE_API_KEY": "chance_sk_live_..." }
}
}
}That's it. Restart your client and the verify_intent tool is available.
- Claude Desktop —
claude_desktop_config.json(Settings → Developer → Edit Config). - Claude Code —
claude mcp add chance -e CHANCE_API_KEY=chance_sk_live_... -- npx -y chance-mcp - Cursor / Windsurf — their MCP settings use the same
mcpServersshape.
Environment
| Variable | Required | Default | Description |
|---|---|---|---|
| CHANCE_API_KEY | yes | — | Your chance_sk_… key from the dashboard. |
| CHANCE_BASE_URL | no | https://harness.chance.cc | Override the API host (self-host / staging). |
Tools
The full, current tool list — with descriptions and schemas — is served by the endpoint itself, so your MCP client's tool inspector is the authoritative reference. In outline:
Verification
verify_intent— check a proposed action against a stated mandate. ReturnsALLOW/BLOCK/ESCALATEwith a reason and a provable receipt (attested judge signature, hash-chained transcript, onchain anchor when configured). Pass the exact venue API payload you are about to submit and setvenueto bind the verdict to those bytes. One credit.get_verification— fetch a prior verification and its proof by id or request hash. Free.
Escrow wallets — wallets (Base, Solana, Starknet mainnet) whose funds only move through the gate. autonomous executes ALLOW-verdict proposals with a clean simulation immediately; safe never executes anything until the user has seen the simulated result and confirmed it, via an approval link. Existing Ethereum-mainnet wallets keep working.
create_escrow_wallet— provision a wallet with a plain-English mandate and optional hard numeric limits. Free.list_escrow_wallets/get_escrow_balances— names, addresses, mandates, live balances. Free.escrow_transfer— propose a same-asset transfer (e.g. 500 USDC to 0x…). One credit.escrow_swap— swap tokens in plain terms, quoted on the Uniswap Trading API and assembled as a bounded-approval + swap batch. One credit.escrow_execute— propose a raw EVM transaction, EVM batch, Solana transaction, or Starknet multicall. One credit.list_escrow_transactions/get_escrow_transaction— status, verdict, tx hash, and the approval link for anything awaiting the user. Free.
Credits
topup_credits— pay for verification credits in USDC on Base over x402. Free to call.
Freeform action descriptions work everywhere; the verifier is platform-agnostic. Venue-aware payloads additionally get deterministic decoding (sides, sizes, notionals, allowances) and live metadata resolution before the judge reasons.
Example
Prompt your agent: "Before you place any Polymarket order, call verify_intent with my mandate as the intent and the order as the action, and don't execute unless the verdict is ALLOW."
intent: Buy favorites priced >= 95c only. Reject longshots. Max $10 per market.
action: BUY YES "Will candidate X win the 2028 nomination?" @ 21c, size $10.
→ Verdict: BLOCK (confidence 96%)
The action buys a 21c longshot, violating the "priced >= 95c only" clause…
Onchain: https://basescan.org/tx/0x…Development
bun install
bun run build # tsc → dist/
CHANCE_API_KEY=chance_sk_live_... node dist/index.jsPoint it at a local server with CHANCE_BASE_URL=http://localhost:3000. Because the tools live server-side, changing one needs no release here.
License
MIT
