{
  "markdown": "# bsc-dex-spread\n\n**One MCP tool — `get_dex_spread` — returning live cross-DEX price and spread for\nPancakeSwap v2 + v3 on BSC, paid $0.01 USDC per call from your own wallet.**\n\n## Try it in 30 seconds\n\nInspecting the server costs nothing and needs no wallet:\n\n```bash\nnpx -y bsc-dex-spread-mcp\n```\n\nIt starts on stdio and lists its one tool. Add it to Claude Code:\n\n```bash\nclaude mcp add bsc-dex-spread --env EVM_PRIVATE_KEY=0xyour_disposable_base_key -- npx -y bsc-dex-spread-mcp\n```\n\nWithout a key the tool is still listed, and a call tells you exactly what is\nmissing rather than failing obscurely:\n\n```\nget_dex_spread failed: EVM_PRIVATE_KEY is not set. Add your funded Base-mainnet\nbuyer wallet key (0x-prefixed, USDC-only, low balance) to the MCP server env config.\n```\n\n**Before you fund anything, know the free alternative.** If you do not\nspecifically need the paid, uncapped path, [`arb-dex-mcp`](https://github.com/donnywin85/arb-dex-mcp)\nand [`dex-data-mcp`](https://github.com/donnywin85/dex-data-mcp) return cross-DEX\nspread **keyless and free** on six chains. This server exists for callers who\nwant per-call billing with no free-tier ceiling — it is not the cheapest way in.\n\nAn [MCP](https://modelcontextprotocol.io) server that gives your agent one tool —\n**`get_dex_spread`** — returning **real-time cross-DEX price & spread data for\nPancakeSwap v2 + v3 on BSC**. Each call is a paid API call: **$0.01 USDC on Base\nmainnet**, settled automatically over [x402](https://x402.org) from *your own*\nwallet. No subscription, no account, no API key to request — the agent pays\nper call.\n\nBacked by a live x402 gateway: <https://x402.donnyautomation.com>\nPublic usage/proof page: <https://x402.donnyautomation.com/stats>\n\n## The tool\n\n### `get_dex_spread(pair, fee?)`\n\nReal-time cross-DEX price & spread for PancakeSwap v2+v3 on BSC.\n\n- `pair` (required) — token pair as `SYM/SYM`; the first symbol is the\n  USD-priceable side. Examples: `WBNB/USDC`, `WBNB/USDT`, `CAKE/WBNB`.\n- `fee` (optional) — a PancakeSwap v3 fee tier (`100`, `500`, `2500`, `10000`)\n  to restrict the v3 probe. Omit to probe all v3 tiers **and** v2.\n\nReturns per-venue prices, best buy / best sell venue, the gross cross-DEX spread\nin bps, liquidity (per-venue TVL + totals), and the source block number. Example:\n\n```jsonc\n{\n  \"pair\": \"WBNB/USDC\", \"network\": \"bsc\", \"chainId\": 56,\n  \"blockNumber\": 107562007, \"nativeUsd\": 546.6,\n  \"pricesByVenue\": [ { \"venue\": \"pancake\", \"surface\": \"v2\", \"price\": 546.6, \"tvlUsd\": 1234567 }, ... ],\n  \"bestBuy\":  { \"venue\": \"pancakeV3:500\", \"price\": ... },\n  \"bestSell\": { \"venue\": \"biswap\",        \"price\": ... },\n  \"midSpreadBps\": 27.4,\n  \"crossDex\": { \"grossSpreadBps\": 14.05, \"buyVenue\": \"...\", \"sellVenue\": \"...\", \"surface\": \"v2v3\" },\n  \"liquidity\": { \"venues\": 7, \"totalTvlUsd\": ... },\n  \"ts\": \"2026-07-01T...\", \"source\": \"rpc\"\n}\n```\n\n## Why an agent wants this\n\nCross-DEX spread is the raw signal behind arbitrage, best-execution routing, and\nslippage estimation. Instead of running BSC RPC infrastructure and multi-DEX pool\nmath itself, an agent calls one tool and pays a cent for a fresh, block-stamped\nanswer across PancakeSwap v2 + v3 venues.\n\n## Cost & wallet model — read this\n\n**You bring the wallet. This package ships no keys.** The server signs each\npayment with a private key it reads from its own environment\n(`EVM_PRIVATE_KEY`), which you set in your MCP client's server config. That is\nthe design: the buyer (you) pays for the data with the buyer's wallet.\n\n- **Per call:** $0.01 USDC on **Base mainnet** (`eip155:8453`).\n- **Fund USDC only — zero ETH needed.** x402's `exact` scheme is EIP-3009\n  `transferWithAuthorization`: you sign an off-chain USDC authorization and the\n  facilitator broadcasts it and pays the gas. A 0-ETH wallet settles fine.\n- **Use a low-balance, dedicated wallet.** Fund it with just a few dollars of\n  USDC on Base and top it up as needed. Do not point this at your main wallet —\n  the key sits in your MCP client config in plaintext, so treat it as a hot,\n  disposable spending wallet.\n\n## Install & configure\n\n```bash\nnpm install -g bsc-dex-spread-mcp\n```\n\nAdd it to your MCP client. Claude Desktop / Claude Code\n(`claude_desktop_config.json` or `.mcp.json`):\n\n```jsonc\n{\n  \"mcpServers\": {\n    \"bsc-dex-spread\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"bsc-dex-spread-mcp\"],\n      \"env\": {\n        \"EVM_PRIVATE_KEY\": \"0xYOUR_BASE_MAINNET_BUYER_KEY\"\n      }\n    }\n  }\n}\n```\n\n`EVM_PRIVATE_KEY` — your Base-mainnet buyer wallet key (0x-prefixed), funded with\na few dollars of USDC on Base. Optional `GATEWAY_URL` overrides the endpoint\n(defaults to `https://x402.donnyautomation.com`).\n\nRestart your client; the agent will have `get_dex_spread` available and will pay\n$0.01 USDC each time it calls it.\n\n## How it works\n\n```\nagent → get_dex_spread(pair)\n      → GET https://x402.donnyautomation.com/call?pair=...  (HTTP 402 PAYMENT-REQUIRED)\n      → sign EIP-3009 USDC auth with EVM_PRIVATE_KEY → x402 facilitator settles on Base\n      → gateway proxies to its BSC DEX reader → 200 with the cross-DEX payload\n```\n\n## What has been verified, and what has not\n\nChecked against the published artifacts on 2026-08-21:\n\n- `npm install -g bsc-dex-spread-mcp` and `npx -y bsc-dex-spread-mcp` both\n  install and start; npm `0.1.0` matches this repo.\n- The gateway is live and answers `GET /call?pair=WBNB/USDC` with a valid x402\n  **V2** challenge — `402`, a `payment-required` header, $0.01 USDC\n  (`10000` at 6 decimals) on Base `eip155:8453`.\n- A keyless call reports the missing key clearly, as shown above.\n- **Not verified: end-to-end paid settlement.** Confirming it would mean spending\n  real USDC, which this documentation pass was not authorised to do. The payment\n  path is unexercised here, so treat it as untested rather than proven, and make\n  your first call a small one.\n\n## Where to go next\n\n- **Free, keyless cross-DEX data** — [`arb-dex-mcp`](https://github.com/donnywin85/arb-dex-mcp)\n  (6 chains) or [`dex-data-mcp`](https://github.com/donnywin85/dex-data-mcp) (22 tools).\n- **Paid general-purpose agent utilities** — [`agent-utils-mcp`](https://github.com/donnywin85/agent-utils-mcp).\n- **The human-approval job queue behind these services** —\n  [`approval-queue-starter`](https://github.com/donnywin85/approval-queue-starter).\n- **Live proof of usage** — <https://x402.donnyautomation.com/stats>.\n\n## License\n\nMIT\n",
  "bytes": 6405,
  "sha": "bafbe570807f09322621d4a930ef0396e057594f65444bbfe0c4841a599d3496",
  "repo_slug": "donnywin85/bsc-dex-spread-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_donnywin85_bsc_dex_spread_effd45b8/readme"
}