MCP Server

Beta

Model Context Protocol (MCP) lets AI agents like Claude, ChatGPT, Cursor, and custom bots query Laevitas derivatives, options, spot, and macro data natively - in plain English, with no custom integration code. 80+ tools across futures, perpetuals, options, spot, volatility surfaces, live portfolio risk, prediction markets, macro, and Hyperliquid L1 HyperCore wallet/onchain data.

Connect Your AI Platform

Step-by-step guides for connecting Laevitas derivatives data to your favorite AI platform. Requires an Enterprise API key from your Laevitas dashboard.

Claude.ai Connectors

OAuth 2.1

Connect directly from Claude.ai using the built-in MCP Connectors feature. OAuth handles authentication automatically.

  1. 1

    Go to Settings → Connectors in Claude.ai

  2. 2

    Click Add custom connector

  3. 3

    Fill in the fields:

    NameLaevitas
    Remote MCP server URLhttps://apiv2.laevitas.ch/api/v1/mcp
    AuthenticationSign in now
    OAuth clientRegister automatically
    Request headersnone needed
  4. 4

    Click Add — a popup will open asking for your Laevitas API key

  5. 5

    Enter your API key and click Authorize. The connector is now active.

Do not enter a client ID or secret: Claude registers and manages its own credentials automatically. Enter your own API key only on the Laevitas authorization page, not in the connector URL or request headers. Select Register automatically, not Use Claude's published identity; CIMD is not supported. Existing working manual registrations can remain in use. If an old saved ID produces Unknown client_id, reconnect using automatic registration.

Authentication

The MCP server supports three authentication methods. Use whichever your platform requires.

API Key

CLI, Desktop, Custom

Pass your key directly via HTTP header. Best for programmatic access.

Header (preferred) apikey: your-key-here
Header (alternative) x-api-key: your-key-here
Query parameter ?apiKey=your-key-here

OAuth 2.1

Claude.ai, Web Platforms

Automatic OAuth flow for platforms that require it. You enter your API key once during authorization.

PKCE S256 (required)
Grant type authorization_code
Token lifetime 24 hours access; 30 days refresh. Clients follow the returned expires_in.

x402 Payment

No API Key Needed

Pay per tool call with USDC. No signup required. Connect and list tools for free, pay only when calling tools.

initialize Free
tools/list Free
tools/call 1 credit per call
Learn more about x402 →

x402 Payment Flow for MCP

No API key? No problem. AI agents can pay per tool call using USDC on Base or Solana.

1

Connect for free — initialize and tools/list work without any auth

2

Call a tool — first tools/call without payment returns 402 with payment instructions

3

Pay with USDC — sign a payment and retry. Get data + a credit token + 99 prepaid credits

4

Use credits — send X-Credit-Token header for instant tool calls (~1ms, no gas)

Credits work across both REST endpoints and MCP tool calls. A credit token earned via REST can be used for MCP and vice versa.

Available Tools

80+ tools the AI agent can call, grouped by category. Start with a discovery tool (catalog or metadata) to see what instruments and date ranges are available before fetching data.

Catalog & Discovery

Tool Description
get_futures_catalogList available dated-futures instruments on an exchange
get_perpetuals_catalogList available perpetual instruments on an exchange
get_options_catalogList available options instruments on an exchange
get_spot_catalogList available spot pairs on an exchange
get_predictions_catalogList available prediction-market instruments
get_predictions_categoriesList prediction-market categories
get_futures_metadataData availability for a futures instrument (date range, data points)
get_perpetuals_metadataData availability for a perpetual instrument
get_options_metadataData availability for an options instrument
get_spot_metadataData availability for a spot pair
get_predictions_metadataData availability for a prediction-market instrument
get_instruments_metadataCross-market instrument metadata lookup
get_derivatives_liquidationsAggregated liquidations across derivatives markets

Options Backtests

Asynchronous Deribit BTC/ETH portfolio simulations. Shared capital, independent UTC rolls, minute valuation and displayed-size fills. Use the same account as REST; submit once with a stable idempotency key, poll status and download the completed result promptly. Request and response schemas.

ToolArguments / purpose
get_options_backtest_strategies{} — templates, limits and execution assumptions
submit_options_backtest{request, idempotency_key} — queue the user-approved strategy; returns job_id
get_options_backtest_status{job_id} — poll state and progress with backoff
get_options_backtest_result{job_id} — combined report, every execution and data-quality evidence
cancel_options_backtest{job_id} — cooperative cancellation, after user confirmation

Dated Futures

Tool Description
get_futures_ohlcvtOHLCVT candle data (price, volume, trades, liquidations)
get_futures_ticker_historyTicker snapshots (mark price, OI, bid/ask)
get_futures_tradesIndividual trade records with full details
get_futures_trades_summaryAggregated buy/sell trade flow summary
get_futures_open_interestAggregated open interest OHLC over time
get_futures_volume24-hour rolling volume (contracts + USD)
get_futures_level1Best bid/ask, spread, and liquidity over time
get_futures_l2_orderbookAggregated L2 orderbook depth
get_futures_l2_orderbook_rawRaw L2 orderbook snapshots
get_futures_reference_priceMark price and index price OHLC
get_futures_basisFutures basis and annualized term structure
get_futures_liquidationsLiquidation events over time
get_futures_flowOrder flow (buy/sell pressure) over time
get_futures_snapshotFull market snapshot of ALL instruments at one point in time

Perpetuals

Tool Description
get_perpetuals_fundingFunding rate history — the headline perp metric
get_perpetuals_ohlcvtOHLCVT candle data (price, volume, trades)
get_perpetuals_ticker_historyTicker snapshots (mark price, funding, OI, bid/ask)
get_perpetuals_tradesIndividual trade records
get_perpetuals_trades_summaryAggregated buy/sell trade flow summary
get_perpetuals_open_interestAggregated open interest OHLC over time
get_perpetuals_volume24-hour rolling volume (contracts + USD)
get_perpetuals_level1Best bid/ask, spread, and liquidity over time
get_perpetuals_l2_orderbookAggregated L2 orderbook depth
get_perpetuals_l2_orderbook_rawRaw L2 orderbook snapshots
get_perpetuals_reference_priceMark price and index price OHLC
get_perpetuals_liquidationsLiquidation events over time
get_perpetuals_flowOrder flow (buy/sell pressure) over time
get_perpetuals_snapshotFull market snapshot of ALL perpetuals at one point in time

Options

Tool Description
get_options_ohlcvtOHLCVT candle data for options (trade-based)
get_options_ticker_historyTicker snapshots (IV, Greeks, OI, bid/ask)
get_options_tradesIndividual option trade records with Greeks
get_options_trades_summaryAggregated trade flow summary
get_options_open_interestAggregated open interest over time
get_options_volatilityIV (mark/bid/ask), Greeks, and vol spread over time
get_options_volume24-hour rolling volume (contracts + USD)
get_options_level1Best bid/ask, spread, and liquidity over time
get_options_reference_priceUnderlying / reference price OHLC
get_options_flowOptions order flow (buy/sell pressure)
get_options_snapshotFull options chain snapshot (all strikes, maturities) at one time

Volatility Surface

Tool Description
get_vol_surface_by_expiryIV surface sliced by expiry date
get_vol_surface_by_tenorIV surface by constant-maturity tenor (term structure)
get_vol_surface_by_timeIV surface evolution over time
get_vol_surface_catalogProprietary surface catalog by exchange, currency, margin, and model
get_vol_surface_snapshotsEngine calibration snapshots, forward curve, and calendar-arb diagnostics
get_vol_surface_slicesPer-expiry proprietary fits with model params, diagnostics, quality tier, and fallback metadata
get_vol_surface_term_structureConstant-maturity proprietary term structure and forward vol
get_vol_surface_strikesPer-strike proprietary diagnostics and greeks
get_vol_surface_risk_decomposeLive portfolio risk decomposition
get_vol_surface_risk_scenarioLive scenario repricing
get_vol_surface_risk_ladderLive spot x vol ladder repricing

Spot

Tool Description
get_spot_ohlcvtOHLCVT candle data for a spot pair
get_spot_tickerTicker snapshots (price, bid/ask)
get_spot_tradesIndividual spot trade records
get_spot_volume24-hour rolling volume
get_spot_level1Best bid/ask, spread, and liquidity over time
get_spot_l2_orderbookAggregated L2 orderbook depth
get_spot_l2_orderbook_rawRaw L2 orderbook snapshots
get_spot_snapshotFull market snapshot of ALL spot pairs at one time

Prediction Markets

Tool Description
get_predictions_ohlcvtOHLCVT candle data for a prediction-market instrument
get_predictions_ticker_historyTicker / implied-probability snapshots
get_predictions_tradesIndividual trade records
get_predictions_orderbook_rawRaw orderbook snapshots
get_predictions_snapshotFull market snapshot at one point in time

Hyperliquid - HyperCore

Tool Description
get_hyperliquid_node_fillsWallet-attributed node fills with fees, closed PnL, builder/deployer fees, hashes, and block numbers
get_hyperliquid_prediction_fillsHIP-4 prediction fills with condition/token ids and wallet attribution
get_hyperliquid_node_liquidationsLiquidation fills with role, dedupe mode, backstop labels, and aggregate bucket mode
get_hyperliquid_wallet_flowWallet flow rollups with sorted notional/PnL/count ranking, net fields, and labels
get_hyperliquid_wallet_positionsLatest wallet positions with marks, position notional, nullable entry price, and labels
get_hyperliquid_funding_paymentsWallet-level funding payments from node misc events
get_hyperliquid_twap_eventsTWAP lifecycle events with target-notional discovery for recent large orders
get_hyperliquid_resting_ordersLatest L4 resting orders with mark distance, staleness metadata, and labels
get_hyperliquid_instrumentsResolve raw Hyperliquid coins and aliases to normalized instruments
get_hyperliquid_node_l2_orderbookDeep HyperCore-derived L2 orderbook snapshot with 100-level liquidity and imbalance

Macro & Analytics

Tool Description
get_macro_catalogList available macro datasets
get_macro_asset_classesList macro asset classes
get_macro_venuesList macro venues / sources
get_macro_summaryCross-market macro summary
get_realized_volatilityRealized volatility for an asset over a window

Protocol Examples

1. Initialize

curl -X POST https://apiv2.laevitas.ch/api/v1/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "apikey: YOUR_API_KEY" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "initialize",
    "params": {
      "protocolVersion": "2025-03-26",
      "capabilities": {},
      "clientInfo": {
        "name": "my-app",
        "version": "1.0.0"
      }
    }
  }'

2. List Tools

curl -X POST https://apiv2.laevitas.ch/api/v1/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "apikey: YOUR_API_KEY" \
  -d '{
    "jsonrpc": "2.0",
    "id": 2,
    "method": "tools/list"
  }'

3. Call a Tool

curl -X POST https://apiv2.laevitas.ch/api/v1/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "apikey: YOUR_API_KEY" \
  -d '{
    "jsonrpc": "2.0",
    "id": 3,
    "method": "tools/call",
    "params": {
      "name": "get_futures_ohlcvt",
      "arguments": {
        "instrument_name": "BTC-PERPETUAL",
        "exchange": "deribit",
        "resolution": "1h",
        "limit": 10
      }
    }
  }'

Example Prompts

What you can ask an AI agent connected to this MCP server:

"What BTC futures instruments are available on Deribit?"

"What's the current BTC perpetual funding rate?"

"Compare BTC vs ETH perpetual open interest over the last 4 hours"

"Show me the BTC futures term structure and annualized basis"

"Which BTC options expiring this week have the highest OI?"

"Pull the Deribit BTC volatility surface by tenor and analyze the IV skew"

"What's the 30-day realized volatility of ETH?"

"Show Hyperliquid wallet fills and current positions for this wallet."

"Compare BTC spot volume across Binance, OKX, and Coinbase"

Troubleshooting

Common issues when connecting an MCP client. Restart your client after changing any configuration.

406 Not Acceptable

Your client (or curl) didn't send Accept: application/json, text/event-stream. Both content types are required on every request.

401 Unauthorized

Missing or invalid credentials. For API-key clients, check the apikey header. The MCP handshake returns 401 with a WWW-Authenticate header before login — that starts OAuth discovery. For Claude.ai, choose Sign in now and Register automatically, with no custom headers. Enter your valid Laevitas API key on the authorization page. A stale or invalid registration header is rejected, not ignored.

Couldn't register / Unknown client_id

Do not reuse a client ID copied from an old guide. Use Register automatically with no custom headers. Registration supports public and client_secret_post clients with approved callbacks; it does not grant access without user sign-in. If registration is rate-limited, wait for Retry-After rather than repeatedly retrying. If it still fails, send support the UTC time and Claude's reference code, never your API key, client secret or tokens.

429 Too Many Requests

You hit the per-minute tool-call limit. Back off using the X-RateLimit-Reset response header (seconds until reset). Batched JSON-RPC calls count one slot per tools/call frame.

402 Payment Required

A tools/call was sent without an API key or OAuth token, so x402 pay-per-call kicked in. Either authenticate, or let a wallet-enabled agent settle the payment. See the x402 guide.

Duplicate tools / won't connect

Configure the Laevitas server once per client. If you added it more than once (e.g. an API-key entry and an OAuth entry), remove the duplicate, then restart.

npx not found

Clients that bridge via mcp-remote need Node.js. Run npx --version to confirm it's installed, and make sure your network allows outbound HTTPS to apiv2.laevitas.ch.

Still stuck? Debug interactively with the MCP Inspector (npx @modelcontextprotocol/inspector) or email [email protected].