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/mcpOr 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
ToolScopeDescription
get_marketspublicList tradable perp markets (optional search).
get_tickerpublicLatest price + 24h stats for a symbol.
get_orderbookpublicAggregated bids/asks across venues.
get_candlespublicHistorical OHLCV candles.
get_tradespublicRecent trade prints.
get_routingpublicBest venue + alternatives for an order.
get_market_statspublic24h volume, funding, open interest.
watch_tradespublicCollect a bounded (≤10s) burst of live trades.
watch_orderbookpublicCollect a bounded (≤10s) burst of book updates.
get_positionsaccount:readOpen positions for the subject wallet.
get_balancesaccount:readBalances across venues.
get_ordersaccount:readOpen orders.
execute_orderorders:executePlace a smart-routed perp order. Real trade.
cancel_orderorders:executeCancel an open order.
open_positionorders:executeOpen a position by direction + size. Real trade.
close_positionorders:executeClose / reduce a position. Real trade.
open_pair_positionpairs:executeOpen a long/short pair trade. Real trades.
close_pair_positionpairs:executeClose a pair position.
swap_quoteswap:quoteCompare cross-chain swap routes.
swap_prepareswap:quoteBuild an unsigned swap tx (non-custodial).
swap_executeswap:executeExecute a swap headlessly. Moves funds.
get_swap_statusswap:quotePoll a swap by id.
Resources & prompts
- —Resources:
venym://llms.txt,venym://markets,venym://ticker/{symbol}. - —Prompts:
analyze_market(pull data + summarize a symbol),plan_swap(quote + explain, confirm before executing).