# Roach Agent API: MCP setup

The endpoint is `https://api.stillroach.com/mcp`. It uses Streamable HTTP in stateless JSON-RPC mode: POST only, no SSE stream, no session.
Auth is a header, `Authorization: Bearer rk_live_...`. Get the key at `https://app.stillroach.com/watch#keys` (API keys, signed in with your Solana wallet). The key is shown once, so store it in your client's secret store, never in a prompt or a repo.
Without a key, only `check_solana_token_basic` works (cached data, rate-limited by IP).

## Tools
| tool | cost | what it does |
|---|---|---|
| check_solana_token_basic | free | cached holder snapshot for a mint |
| check_solana_token_lite | 0 for 3 fresh reads/day, then 1 credit; cached 0 | lite read: top-10 holders, dev stake, launch / dev sold, KOL wallets |
| analyze_solana_token | 1 credit when fresh, 0 when cached | full holder analysis; set max_data_age_seconds to allow cache |
| watch_report | 0 (Watch plan) | Bag Watch report for a coin you watch |
| alerts_since | 0 (Watch plan) | alerts after a cursor; also lists webhook dead letters |
| get_quota | 0 | credits left |
| get_credit_packs | 0 | pack prices and the x402 pay-per-call option |

## Claude Code
```bash
claude mcp add --transport http roach https://api.stillroach.com/mcp --header "Authorization: Bearer $ROACH_API_KEY"
```

## Cursor (`~/.cursor/mcp.json`)
```json
{ "mcpServers": { "roach": { "url": "https://api.stillroach.com/mcp", "headers": { "Authorization": "Bearer ${env:ROACH_API_KEY}" } } } }
```

## Claude Desktop / clients without remote-header support
```json
{ "mcpServers": { "roach": { "command": "npx", "args": ["-y", "mcp-remote", "https://api.stillroach.com/mcp", "--header", "Authorization:Bearer ${ROACH_API_KEY}"],
  "env": { "ROACH_API_KEY": "rk_live_..." } } } }
```

## Grok Bot
Add a custom MCP connector with URL `https://api.stillroach.com/mcp` and header `Authorization: Bearer <key>`. The ready-made "Roach Bag Watch" template sets this up, along with a daily alert routine.

## Check it works
```bash
curl -s https://api.stillroach.com/mcp -H "Authorization: Bearer $ROACH_API_KEY" -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_quota","arguments":{}}}'
```

## Limits
- 60 calls/min and 600/hour per wallet, shared between REST and MCP. 429 replies include Retry-After.
- Out of credits: tool results carry `isError` with pack_url and x402_url. Buy a pack (SOL, USDC or $STILL) or pay per call over x402.
- Browser origins other than stillroach.com are refused (DNS-rebinding guard). Server-side clients send no Origin and are not affected.
