MCP

The Venym MCP server

One Model Context Protocol server gives any MCP-capable harness live market data and — with a scoped key — perp trades, pair trades, and cross-chain swaps.

Run it

Local (stdio) for any harness that spawns a command:

bash
VENYM_API_KEY=venym_sk_live_... npx -y @venym/mcp

Or point at the hosted endpoint https://defi.venym.io/mcp and send your key via Authorization: Bearer. See per-harness setup.

VENYM_API_KEYvenym_sk_… key. Unlocks account reads + execution tools.
VENYM_BASE_URLREST base (default https://defi.venym.io/api).
VENYM_READONLY1 → hard read-only (no execution tools registered).
Without a key, only public market-data tools are exposed. Execution tools appear only when a key is present and VENYM_READONLY is unset — and the backend enforces scopes + risk policy regardless.

Real-time in MCP

MCP tool calls are request/response, so there are no long-lived stream_* tools. Use the snapshot tools (get_orderbook, get_ticker) and the bounded watch_* collectors, which gather a short burst of live events and return them. For continuous streaming, use the SDK directly.

Tool reference

ToolDescription
get_marketsList tradable perp markets (optional search).
get_tickerLatest price + 24h stats for a symbol.
get_orderbookAggregated bids/asks across venues.
get_candlesHistorical OHLCV candles.
get_tradesRecent trade prints.
get_routingBest venue + alternatives for an order.
get_market_stats24h volume, funding, open interest.
watch_tradesCollect a bounded (≤10s) burst of live trades.
watch_orderbookCollect a bounded (≤10s) burst of book updates.
get_positionsOpen positions for the subject wallet.
get_balancesBalances across venues.
get_ordersOpen orders.
execute_orderPlace a smart-routed perp order. Real trade.
cancel_orderCancel an open order.
open_positionOpen a position by direction + size. Real trade.
close_positionClose / reduce a position. Real trade.
open_pair_positionOpen a long/short pair trade. Real trades.
close_pair_positionClose a pair position.
swap_quoteCompare cross-chain swap routes.
swap_prepareBuild an unsigned swap tx (non-custodial).
swap_executeExecute a swap headlessly. Moves funds.
get_swap_statusPoll a swap by id.

Resources & prompts