---
name: brainiac-x402
description: Call BRAINIAC.software paid APIs from a local MCP client that pays x402 USDC on Base. Use when an agent needs token security, wallet intelligence, chain data, crypto prices, insider trades, or other BRAINIAC coverage endpoints without an account.
---

# BRAINIAC.software — local x402 MCP payer

BRAINIAC exposes machine-payable HTTP APIs (x402 exact scheme, USDC on Base). Remote Streamable HTTP MCP at `/mcp` still cannot sign payments inside Claude Desktop, Cursor, ChatGPT, or VS Code. Those hosts need this **local** stdio client: the buyer's key and spend caps stay on their machine.

Human walkthrough: https://www.brainiac.software/how-it-works  
OpenAPI: https://www.brainiac.software/openapi.json  
Catalog: https://www.brainiac.software/api/v1/catalog

## Pin values (refuse to pay if any differ)

| Field | Expected |
| --- | --- |
| `payTo` | `0x6428665E83F503904571104311bB78CBb29b975c` |
| `asset` (USDC) | `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913` |
| `network` | `eip155:8453` |
| Facilitator | `https://api.cdp.coinbase.com/platform/v2/x402` |

Live discovery (free):

- Catalog: `https://www.brainiac.software/api/v1/catalog`
- Group schemas: `https://www.brainiac.software/api/v1/catalog/{group}`
- OpenAPI: `https://www.brainiac.software/api/v1/openapi.json`
- x402: `https://www.brainiac.software/.well-known/x402`
- llms: `https://www.brainiac.software/llms.txt`
- This skill: `https://www.brainiac.software/skill.md`
- Client: `https://www.brainiac.software/mcp-client.mjs`
- Checksum: `https://www.brainiac.software/mcp-client.mjs.sha256`

## Install (download + checksum + deps)

```bash
mkdir -p ~/brainiac-mcp && cd ~/brainiac-mcp
curl -fsSL https://www.brainiac.software/mcp-client.mjs -o mcp-client.mjs
curl -fsSL https://www.brainiac.software/mcp-client.mjs.sha256 -o mcp-client.mjs.sha256
echo "$(cat mcp-client.mjs.sha256)  mcp-client.mjs" | shasum -a 256 -c -
npm init -y
npm install @modelcontextprotocol/sdk@1 @x402/fetch@2 @x402/evm@2 viem zod
chmod +x mcp-client.mjs
```

Re-check the SHA-256 whenever you re-download the client.

## Environment (buyer machine only)

```bash
export BRAINIAC_PRIVATE_KEY=0x…          # 32-byte hex; never commit or paste into chat
export BRAINIAC_MAX_USD_PER_CALL=0.05    # refuse to sign above this per call
export BRAINIAC_DAILY_MAX_USD=5          # refuse when UTC-day spend would exceed
# optional:
# export BRAINIAC_ORIGIN=https://www.brainiac.software
# export BRAINIAC_SPEND_FILE=~/brainiac-daily-spend.json
```

Fund the key with Base USDC. Settlement uses the Coinbase CDP x402 facilitator; BRAINIAC never sees the private key.

## MCP tools

| Tool | Cost | Purpose |
| --- | --- | --- |
| `list_apis` | free | Product groups from `/api/v1/catalog` |
| `search` | free | Find endpoints by text / optional `api` slug |
| `describe` | free | Schema + example from `/api/v1/catalog/{group}` |
| `call` | paid | POST the route; pin-check → budget → sign → settle |

`call` always:

1. Issues the POST; on HTTP 402, reads payment requirements.
2. Verifies `payTo`, `asset`, `network`, and facilitator against the pins above.
3. Compares the quoted USDC amount to `BRAINIAC_MAX_USD_PER_CALL` and the daily ledger.
4. Signs and retries only if pins and caps pass.
5. Records spend only after HTTP 2xx.

HTTP 4xx/5xx are not charged. Coverage bodies with `status` `complete` or `partial` and real data settle on HTTP 2xx. `status` `failed` or empty payloads return non-2xx and are not charged.

## Example — token risk verdict ($0.01)

1. Free discover:

```text
list_apis
search query="risk verdict" api="token-security"
describe id="token-security.risk-verdict"
```

2. Paid call (body matches the published example):

```json
{
  "id": "token-security.risk-verdict",
  "params": {
    "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
  }
}
```

3. Expect HTTP 200 JSON with `status` and `data`, plus settlement info from `PAYMENT-RESPONSE` when present.

## Wire into MCP hosts (stdio)

Replace `/absolute/path/to/mcp-client.mjs` with your install path. Keep the key only in host env — never in the skill file or chat.

### Cursor (`~/.cursor/mcp.json` or project `.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "brainiac": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-client.mjs"],
      "env": {
        "BRAINIAC_PRIVATE_KEY": "0x…",
        "BRAINIAC_MAX_USD_PER_CALL": "0.05",
        "BRAINIAC_DAILY_MAX_USD": "5"
      }
    }
  }
}
```

### Claude Code / Claude Desktop

```json
{
  "mcpServers": {
    "brainiac": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-client.mjs"],
      "env": {
        "BRAINIAC_PRIVATE_KEY": "0x…",
        "BRAINIAC_MAX_USD_PER_CALL": "0.05",
        "BRAINIAC_DAILY_MAX_USD": "5"
      }
    }
  }
}
```

### Codex / other stdio hosts

Same shape: `command` = `node`, `args` = absolute path to `mcp-client.mjs`, and the three `BRAINIAC_*` env vars.

## Safety

- Do not run a hosted proxy that accepts buyer keys.
- Do not pay if any pin mismatches.
- Do not raise caps blindly; start with small `BRAINIAC_MAX_USD_PER_CALL`.
- Prefer `describe` before `call` so the body matches the live schema.
- Remote `/mcp` remains for Streamable HTTP listing and clients that already settle x402 themselves; this local client is the paying path for Claude/Cursor/Codex.
- Docs index: `https://www.brainiac.software/api`
- Agent instructions: `https://www.brainiac.software/agent-instructions.txt`
