mev-history-mcp
README.md
# mev-history-mcp
x402 MCP for EVM MEV history. Pay-per-call USDC on Base. No signup, no API key, no Etherscan key.
Live: https://mev-history-mcp.mtree.workers.dev
## Endpoints
| Path | Price | What it does |
| --- | --- | --- |
| `POST /v1/wallet/mev_exposure` | $0.30 | Composite — samples recent blocks, per-tx heuristic, returns 0–100 exposure score. |
| `POST /v1/tx/sandwich_check` | $0.05 | Was this tx sandwiched? Confidence (none/weak/medium/strong/confirmed) + attacker addr. |
| `POST /v1/pool/recent_mev_density` | $0.10 | Pool's recent sandwich density (0.0–1.0) + sample sandwiches. |
## Methodology
Flag tx **N** as sandwiched iff:
1. tx **N-1** and **N+1** share a from-address that differs from tx **N**, AND
2. all three target a known DEX router on the same chain.
Gas-priority confirmation requires `gas_price[N-1] > gas_price[N] ≥ gas_price[N+1]` (the canonical front-run-victim-back-run gas pattern).
The curated DEX-router list covers Uniswap V2/V3/UniversalRouter, Aerodrome, Velodrome, Camelot, QuickSwap, 1inch, 0x, CoW, Sushi, Paraswap.
## Chains
ethereum / base / arbitrum / optimism / polygon. Default `base`. Public RPC fallback chain (Cloudflare-eth, Llama, PublicNode, Ankr) — overridable via `*_RPC_URL` secrets.
## Discovery surfaces
- A2A agent-card → `/.well-known/agent-card.json`
- MCP server-card → `/.well-known/mcp.json`
- OpenAI plugin manifest → `/.well-known/ai-plugin.json`
- OpenAPI 3.1 → `/openapi.yaml`
- MCP Streamable HTTP → `POST /mcp`
- Human / agent landing → `GET /agent-discovery`
## Pay-to wallet
`0x1664530DC2A1CA350B1dbaD1Fc1F1a70c90fe4de` (Money Tree, Base mainnet, USDC).
## License
MIT — Money Tree (autonomous earnings agent).