Skip to main content
Glama
PerpSpread MCP Server

PerpSpread MCP Server

by 123mason123

PerpSpread MCP Server & Reproducible Funding Audit Toolkit

MCP Protocol Hosted Endpoint Venues License: MIT

Official hosted Model Context Protocol (MCP) server manifest (server.json), client configurations, and zero-dependency funding reconciliation scripts for PerpSpread — an independent 7-venue crypto perpetual futures funding-rate arbitrage, cash-and-carry, and Top-20 L2 orderbook slippage terminal.

Connect Claude, Cursor, Codex CLI, Windsurf, or any MCP-compatible AI agent directly to live cross-exchange funding spreads and orderbook depth with zero local installation and no API key required on the free tier (15 req/min).


Live Terminal & Endpoints


Related MCP server: CoinCryptoRank MCP

Covered Venues (7)

Type

Venues

Settlement Cadence

Standard VIP 0 Taker Fee

CEX (5)

OKX, Binance Futures, Bybit, Bitget, Gate.io

4h / 8h (normalized to 365d APR)

0.050% / 0.050% / 0.055% / 0.060% / 0.050%

Perp DEX (2)

Hyperliquid, Aster

1h / 8h (normalized to 365d APR)

0.045% / 0.035%

Neutrality Convention: All default rankings, breakeven days, simulators, and MCP tools use Standard VIP 0 taker fees and 1× delta-neutral sizing ($10,000 total capital = $5,000 Long + $5,000 Short). Optional OKX 20% new-user fee rebate (0.040% taker) is strictly opt-in (okx_rebate: true).


Tools

All 5 tools are read-only, idempotent, and return structured JSON payloads from live exchange feeds (protocolVersion: 2025-03-26).

  • get_top_funding_spreads — Scan live cross-exchange perpetual funding rate arbitrage spreads across all 7 venues with liquidity filters, entry basis, and breakeven days.

  • get_symbol_funding_breakdown — Inspect all 7 venues' live funding rates, settlement intervals (1h/4h/8h), mark prices, 24h volume, and 7D/30D realized funding APR for any coin.

  • audit_orderbook_slippage — Fetch live Top-20 L2 orderbooks across the optimal Long and Short venues for a symbol to measure real bid/ask depth and execution slippage in basis points.

  • calculate_rotation_breakeven — Model whether rotating from an active delta-neutral funding-arb pair (A) into a new target symbol (B) pays back 4-leg fees, slippage, and exit/entry price basis.

  • get_cash_and_carry_spreads — Discover live single-venue Spot-Long / Perp-Short positive funding cash-and-carry spreads across CEX venues.

Tool Parameters Reference

Tool

Required Params

Optional Params

get_top_funding_spreads

(none)

min_volume_usd (number, default 1000000), exchange (okx | binance | bybit | bitget | gate | hyperliquid | aster), limit (1–50, default 10)

get_symbol_funding_breakdown

symbol (e.g. "BTC", "ETH", "SOL", "HYPE")

(none)

audit_orderbook_slippage

symbol (e.g. "BTC", "SOL")

(none)

calculate_rotation_breakeven

current_symbol, current_long, current_short, target_symbol

capital_usd (default 20000), execution ("taker" | "maker", default "taker"), okx_rebate (boolean, default false)

get_cash_and_carry_spreads

(none)

min_volume_usd (number, default 1000000), limit (1–30, default 10)

Example Prompts for Your AI Agent

  • "Find the top 5 cross-exchange funding spreads involving Hyperliquid with at least $5M daily volume, then audit L2 orderbook slippage on the #1 result."

  • "Compare live funding APR vs 7-day realized settled APR for BTC and SOL across all 7 venues so I don't chase a one-hour funding spike."

  • "I am holding a $20,000 delta-neutral position long OKX / short Binance on ETH. Calculate whether rotating into SOL pays back 4-leg taker fees and slippage."

  • "Show me the best Spot-Long / Perp-Short cash-and-carry yields right now with at least $10M 24h perp volume."


Quick Start (Client Setup)

No local build, Docker container, or npm install is needed — point your MCP client to the hosted Streamable HTTP endpoint https://perpspread.com/api/mcp.

Claude Code CLI

claude mcp add --transport http perpspread https://perpspread.com/api/mcp

Claude Desktop

Add to claude_desktop_config.json (template in configs/claude_desktop_config.json):

{
  "mcpServers": {
    "perpspread": {
      "url": "https://perpspread.com/api/mcp"
    }
  }
}

Cursor / Windsurf / Cline

Add to .cursor/mcp.json (or your editor's MCP settings; template in configs/cursor_mcp.json):

{
  "mcpServers": {
    "perpspread": {
      "url": "https://perpspread.com/api/mcp"
    }
  }
}

OpenAI Codex CLI

Add to ~/.codex/config.toml (template in configs/codex_config.toml):

[mcp_servers.perpspread]
url = "https://perpspread.com/api/mcp"
# Optional: unlock 60 req/min + 30D history via https://perpspread.com/pricing
# http_headers = { "X-API-Key" = "ps_live_your_key_here" }

Optional API Key (Higher Rate Limits)

Tier

Rate Limit

History Window

Auth Header

Free (No Auth)

15 req/min

7 days settled & 15m snapshots

(none required)

Developer (ps_live_)

60 req/min

30 days settled & snapshots

X-API-Key: ps_live_...

Get a free API key at perpspread.com/pricing.


Verify the Live MCP Endpoint

Run the zero-dependency Python 3 smoke test (performs GET discovery, JSON-RPC initialize, notifications/initialized, tools/list, and live tools/call):

python3 scripts/mcp_smoke_test.py

Or test directly with curl:

# 1. Server discovery manifest
curl -s https://perpspread.com/api/mcp | jq .

# 2. List all 5 MCP tools via JSON-RPC 2.0
curl -s -X POST https://perpspread.com/api/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | jq .

Reproducible 7-Day Settled Funding Audit (Python & Node.js)

Independently verify PerpSpread's /audit/btc-7d numbers against raw settled exchange prints. Both scripts use only standard library modules (zero external packages):

# Python 3 (defaults to BTC; pass any symbol such as ETH, SOL, HYPE)
python3 scripts/reconcile_btc_7d.py BTC

# Node.js 18+
node scripts/reconcile_btc_7d.mjs BTC

What the audit verifies end-to-end:

  1. Fetches all 7 venues' settled funding timestamps over the last 7 days from /api/v1/history?symbol=BTC&days=7&source=settled&format=json (typically 168 hourly prints on Hyperliquid vs 21 8-hour prints on CEXs/Aster).

  2. Recomputes per-venue cumulative 7-day funding cum7dRate = Σ(rawRate) and annualized avg7dApr = cum7dRate × (365 / 7) directly from the raw print array.

  3. Reconciles realized7dSpreadApr = shortAvg7dApr − longAvg7dApr against the API's reported figure and asserts numerical consistency.

  4. Prints a side-by-side $10,000 (1× · $5,000/leg) Standard VIP 0 P&L breakdown comparing Live Snapshot Projection vs 7D Realized Settled Baseline so transient funding spikes are never confused with sustained carry.


Direct REST, CSV & DuneSQL LiveFetch

All public data endpoints are permitted in robots.txt and work natively inside DuneSQL http_get() dashboards:

# Live 7-venue spreads (filter by minVol or single symbol)
curl -s "https://perpspread.com/api/v1/spreads?minVol=1000000&limit=25"

# Raw 7-day settled exchange funding prints (JSON)
curl -s "https://perpspread.com/api/v1/history?symbol=BTC&days=7&source=settled&format=json"

# Persisted 15-minute spread & Open Interest snapshots (JSON or CSV)
curl -s "https://perpspread.com/api/v1/history?symbol=BTC&days=7&format=json"
curl -s "https://perpspread.com/api/v1/history?symbol=BTC&days=7&format=csv"
-- DuneSQL LiveFetch example (paste directly into Dune)
SELECT http_get('https://perpspread.com/api/v1/spreads?minVol=1000000&limit=10') AS raw_json;

Official MCP Registry Metadata

This repository includes a schema-compliant server.json (2025-12-11 schema) for publishing to the Official MCP Registry:

mcp-publisher login github
mcp-publisher publish

License

MIT — see LICENSE.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Real-time crypto spread, funding rates, and cash & carry yields across Binance and OKX for AI assistants.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables real-time crypto market data, funding rates, cross-exchange arbitrage, portfolio analytics, exchange skills, and trading via your own connected exchange keys through natural language agent workflows.
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents and trading bots to query live crypto derivatives data across 13 venues, including open interest, funding rates and arbitrage, liquidation cascades, whale positioning with exchange-reported liquidation prices, and tokenized stocks, plus computed regime and risk briefs. It is a read-only remote endpoint requiring no install or API key, and also exposes raw datasets, CSV/Parquet history exports, and webhook alerts for bot workflows.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI assistants to query live perpetual futures data across 40 venues, prop firm rules and pricing, and dated investment theses on over 6,100 US equities, along with SEC filings, insider and congressional trades, and capital returns. Every response is read-only, timestamped, source-attributed, and requires no API key.
      1
      MIT