chance-mcp
v0.7.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.
Downloads
1,588
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.
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
verify_intent
Verify a proposed action against the stated intent/mandate. Returns a verdict — ALLOW / BLOCK / ESCALATE — with a reason and a provable receipt (attested judge signature, hash-chained transcript, onchain anchor when configured). Costs one credit.
Inputs:
intent(string) — the mandate: operator rules, policy, risk limits, thesis.action(string or object) — the concrete action. For supported venues, pass the EXACT API payload about to be submitted so the verdict binds to those bytes.context(object, optional) — structured context (live prices, balances, oracle mids) that helps the judge.venue(string, optional) — engages venue-specific deterministic classification and that venue's versioned knowledge module:hyperliquid,polymarket,limitless,dimes(Multiply leveraged Polymarket CFDs — offer bodies and vault transactions),myriad,orderly,lifi,uniswap(Trading API quotes/swaps and router transactions),solana,alchemy(raw EVM transaction requests, e.g. composed with Alchemy's MCP tools;evmis its legacy alias),meow,agentcards. Auto-detected for known payload shapes when omitted.
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.
get_verification
Fetch a prior verification and its proof by id (UUID) or requestHash (0x…). Read-only, no credits.
Escrow wallets
Server wallets (Ethereum, Base, Solana mainnet) whose funds only move through the verification gate. autonomous mode executes ALLOW-verdict proposals with a clean simulation immediately; safe mode holds every spend behind a one-time approval link for the user.
create_escrow_wallet— provision a wallet with a plain-English mandate. Free.list_escrow_wallets/get_escrow_balances— names, addresses, mandates, live balances. Free.escrow_transfer— propose a named asset transfer (e.g. 500 USDC to 0x…). One credit.escrow_swap— swap tokens in plain terms (e.g. sell 1 USDC for WETH on Base): quoted on the Uniswap Trading API, assembled as a bounded-approval + swap batch, simulated with state carry-over, judged against the mandate. One credit.escrow_execute— propose a raw EVM transaction, EVM batch, or base64 Solana transaction. One credit.get_escrow_transaction— status, verdict, tx hash, or pending approval link. Free.
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.jsLicense
MIT
