# WebSocket streams and MCP ## WebSocket Connect to `wss://ultra-api.deserialize.xyz/v1/ws` and send JSON frames: ```json {"op":"subscribe","stream":"prices","params":{"chain":"solana","address":"So1111…"}} {"op":"unsubscribe","id":""} {"op":"ping"} ``` Streams: `prices`, `memecoins.launches`, `perps.markets`, `predictions.odds`. `params` are optional filters (`chain`, `address`, `venue`, `marketId`) — omit to receive the whole stream. Server frames: `{"op":"subscribed","id","stream"}`, `{"op":"event","id","stream","key","ts","data"}`, `{"op":"unsubscribed"}`, `{"op":"pong"}`, `{"op":"error","message"}`. ## MCP (AI agents) Streamable-HTTP MCP server at `POST https://ultra-api.deserialize.xyz/mcp` (stateless; POST only). Every data endpoint is exposed as a native tool — enumerate with `tools/list`. ```json {"jsonrpc":"2.0","id":1,"method":"tools/list"} {"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"get_swap_quote","arguments":{"chain":"solana","inputToken":"…","outputToken":"…","amountIn":"1000000000"}}} ``` Send `accept: application/json, text/event-stream`. An agent proposing an action still gets `steps[]` — a human or the agent's wallet layer signs. The agent never gains custody.