Calls Fortytwo Prime — a collective inference system where multiple independent AI agents collaborate on every question. Paid per-token via x402 escrow using USDC on Base or Monad.
The script signs on-chain payments using evm_private_key environment variable. Never ask the user to paste the key into chat — it must be set via shell:
export evm_private_key="0x..."
For full wallet setup and network details, see setup.md.
Before the first query, or if the script fails with a setup error:
python scripts/preflight.py--network to the query scriptRun the full MCP flow via script:
Run from the skill directory:
cd /path/to/skills/fortytwo-mcp
python scripts/fortytwo_query.py "your question here" --network base
/tmp/.fortytwo_sessionpython scripts/fortytwo_query.py "follow-up question"
Session is auto-detected from the saved file — no need to pass --session-id. Sessions live up to 90 minutes (15 min idle timeout). If the session expired, the script automatically falls through to a new payment.
Use --no-session to force a new payment. Use --session-id to override manually.
The bundled script does not support streaming. For incremental output on long queries, use curl with SSE directly — see streaming.md for the request format and parsing algorithm.
| Error | Cause | Fix |
|---|---|---|
| ------- | ------- | ----- |
evm_private_key not set | Env var missing | export evm_private_key="0x..." |
missing dependency | Python packages | pip install eth-account web3 |
low USDC balance | Wallet empty | Transfer USDC on Base or Monad |
| Transient 400/502 | On-chain timing | Script auto-retries; if persistent, surface to user |
| 402 on session call | Budget exhausted | New payment needed (script handles this) |
| 409/410 | Session closed | Script falls through to new payment |
| Invalid signature | Wrong EIP-712 domain | See payment.md — query name()/version() on-chain |
共 1 个版本