DEV Community

AlgoVault.com
AlgoVault.com

Posted on • Originally published at blog.algovault.com

Why we expose MCP tools instead of WebSockets for AI trading agents

Hook

Your AI agent doesn't need 26 indicators. It needs one answer.

Picture a multi-agent trading stack that subscribes to a WebSocket feed streaming 200 ticks per second. Before the agent can reason about whether to open a position, it must parse incoming messages, aggregate them into indicator values, normalize those results, resolve conflicts between signals pointing in opposite directions, and only then form a view. By that point the market has moved, the context budget is spent, and the latency that was supposed to be an edge has become a liability.

The problem is not the indicators. The problem is the protocol. WebSockets were designed to push data continuously. LLMs were designed to answer questions discretely. Forcing one into the other is an architectural mismatch — one that surfaces as latency, cost, and interpretation failure at exactly the moment the agent needs to act.

At AlgoVault, we built MCP-first: one tool call, one composite verdict. That architecture now underpins 88.9% PFE win rate across 46,912+ verified calls, Merkle-anchored on Base L2 — accuracy that is only achievable when the agent is not doing the interpretation work.

The protocol mismatch

WebSockets are a browser-era invention. The protocol was designed for trading desks and dashboards: a server pushes events continuously, and a UI renders them in real time. That is exactly the right design for a human watching a chart who needs sub-second updates on candlestick formation and order-book depth.

LLMs are a fundamentally different kind of system. They process discrete requests, reason over structured input, and return a single completion. Their computation is front-loaded; they are not stateful listeners. An LLM's natural operating surface is the tool call — structured question in, structured answer out.

Three architectural archetypes exist today for connecting market data to AI agents:

Archetype A — Raw event feeds. The agent subscribes to a native exchange WebSocket and receives a continuous stream of price ticks, order-book deltas, and trade events. This pattern is optimal for high-frequency execution engines operated by humans. For an LLM agent making one decision every 15 minutes, it means the agent is maintaining a persistent subscription, buffering ticks, aggregating them into OHLCV slices, and running indicator math — all inside the context window, burning tokens on data transformation instead of decision-making. The agent is doing the work that a quant model should own.

Archetype B — REST scrape plus indicator layer. A REST endpoint returns raw OHLCV data; a wrapper computes RSI, MACD, Bollinger Bands, and peers, then presents the agent with 8–12 numeric outputs. The agent must now vote-count: five of eight indicators say "buy," three say "sell" — what is the verdict? The interpretation problem is deferred to the LLM, which is inconsistent across calls and expensive to prompt reliably. The MCP wrapper, if one exists, is post-hoc; the underlying product was never shaped to produce an answer, only to produce data.

Archetype C — MCP-native answers. The agent issues a single tool call — get_trade_signal — and receives one composite verdict: BUY, SELL, or HOLD, with a confidence score and a regime label. Interpretation is performed upstream, by a quantitative model with a published, on-chain-verifiable track record. The agent's only job is to route on the result.

The difference is not cosmetic. Archetype A gives an agent a firehose. Archetype B gives it a spreadsheet. Archetype C gives it a decision. For the overwhelming majority of AI trading agents — operating on 15-minute to 4-hour decision cadences rather than microsecond execution loops — the answer-shaped protocol is the correct architectural choice.

MCP's tool-call contract ({tool_name, args, result}) is structurally identical to how LLMs already reason: ask a question under a defined schema, receive a typed answer. There is no translation layer, no reconnect handler, no in-context parsing loop. The protocol shape does the work.

AlgoVault's choice

We chose MCP-first, REST as a fallback, no native WebSocket surface. That was an architectural decision from day one, not a retrofit applied to an indicator scraper.

A single call to get_trade_signal returns a composite verdict — the result of a quantitative model that weights trend regime, funding-rate normalisation, volatility-squeeze state, and Hurst-exponent persistence under a fixed, published weighting scheme. The agent receives one field to route on (verdict), one confidence score to threshold on, and a regime label for position-sizing context. No indicator math. No aggregation. No prompt engineering to count votes.

This is what message M2 means in practice: one API call, one verdict, not eight raw indicators left for the agent to reconcile. We provide the thesis; agents decide execution.

The track record that results from this design is public and independently verifiable: 88.9% PFE win rate across 46,912+ verified calls, with 10 Merkle batches anchored on Base L2. Price-Following Efficiency measures whether price moved in the direction of the verdict within the signal's timeframe window — not a backtested simulation, but a forward-measured, call-by-call record.

The platform payoff compounds beyond accuracy. MCP's standardised tool-call schema means AlgoVault works natively with every MCP-compatible AI client — Claude Desktop, Claude Code, Cursor, Cline, and any custom agent stack built against the MCP SDK. We are indexed across 14 registries including npm, GitHub, Smithery, Glama, mcp.so, and the official MCP registry. Smithery alone indexes 7,000+ MCP servers; AlgoVault ships as one of the few with a published, on-chain-verifiable track record attached.

The protocol is not just a technical choice. It is the distribution channel. Every agent developer who installs any MCP client and searches for market-intelligence tooling finds AlgoVault. No WebSocket documentation to read, no adapter to write, no custom parser to maintain per exchange. One install, one tool, one verdict.

Implementation walkthrough

Block 1 — Install via Smithery (free tier, no API key required)

# Install AlgoVault MCP server into Claude Desktop — single command
npx -y @smithery/cli@latest install algovault/crypto-quant-signal-mcp \
  --client claude-desktop

# After install, open Claude Desktop and ask:
# "Get me a BTC 15m signal."
# AlgoVault returns a composite verdict with the _algovault metadata block.
Enter fullscreen mode Exit fullscreen mode

Smithery handles server discovery, version pinning, and client configuration. The --client claude-desktop flag writes the MCP server entry to ~/Library/Application Support/Claude/claude_desktop_config.json automatically — no manual JSON editing required.

Claude Desktop session showing a natural-language BTC 15m signal query and the rendered AlgoVault tool response with the _algovault metadata block visible

Block 2 — Verbatim tool response

The following is a live get_trade_signal response for BTC on the 15-minute timeframe. The _algovault metadata block is present on every response and carries track-record provenance plus a per-call verify URL — so any agent or human reader can independently confirm the signal against the published Merkle batch.

{
  "verdict": "BUY",
  "confidence": 0.72,
  "regime": "TRENDING_UP",
  "factors": {
    "hurst": 0.68,
    "funding_z": -1.2,
    "squeeze": true
  },
  "_algovault": {
    "tool": "get_trade_signal",
    "asset": "BTC",
    "timeframe": "15m",
    "track_record": "https://algovault.com/track-record",
    "verify": "https://algovault.com/verify?signalId=av1-btc-15m-20260427T0847Z",
    "compatible_with": ["claude-desktop", "claude-code", "cursor", "cline"]
  }
}
Enter fullscreen mode Exit fullscreen mode

Each field has a concrete routing role in an agent loop:

  • verdict — the primary routing switch: BUY, SELL, or HOLD. HOLD signals are free under the selectivity model; agents that skip HOLDs save execution budget without taking a directional bet.
  • confidence — threshold gate for position sizing. A score of 0.72 clears the standard 0.65 cutoff; agents typically scale position size proportionally above 0.65 and skip below.
  • regime — context for stop placement and hold duration. TRENDING_UP warrants different trailing-stop logic than RANGING or VOLATILE.
  • factors — the underlying quant inputs, inspectable by the agent for downstream reasoning. Hurst > 0.5 confirms trend persistence; funding_z < −1 signals a funding-rate anomaly; squeeze: true confirms a volatility-compression breakout pattern.
  • _algovault.verify — a cryptographically linkable URL. The signal ID encodes asset, timeframe, and timestamp; AlgoVault's next Merkle batch anchors this call on Base L2.

Block 3 — Multi-asset agent loop in Claude Code

// Multi-asset agent: AlgoVault handles interpretation, exchange handles execution.
// Dependencies: @modelcontextprotocol/sdk@^1.0.0, tsx@^4.x
// Run: DRYRUN_MODE=1 npx tsx posts/wk-1-mcp-vs-websockets/example.ts

import { Client as McpClient } from "@modelcontextprotocol/sdk/client/index.js";
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";

const CONFIDENCE_THRESHOLD = 0.65;
const ASSETS = ["BTC", "ETH", "SOL"];
const DRYRUN = process.env.DRYRUN_MODE === "1";

const algovault = new McpClient({ name: "algovault-agent", version: "1.0.0" });
await algovault.connect(new StdioClientTransport({
  command: "npx",
  args: ["-y", "algovault/crypto-quant-signal-mcp@latest"],
}));

for (const asset of ASSETS) {
  const { content } = await algovault.callTool("get_trade_signal", {
    coin: asset,
    timeframe: "15m",
  });
  const sig = JSON.parse((content[0] as { text: string }).text);

  if (DRYRUN) {
    console.log(`[${asset}] verdict=${sig.verdict} confidence=${sig.confidence}`);
    continue;
  }

  if (sig.verdict !== "HOLD" && sig.confidence > CONFIDENCE_THRESHOLD) {
    // await exchange.callTool("place_order", { asset, side: sig.verdict, size: 0.01 });
    console.log(`[${asset}] → ${sig.verdict} @ confidence ${sig.confidence}`);
  } else {
    console.log(`[${asset}] HOLD — skipping execution`);
  }
}

await algovault.close();
Enter fullscreen mode Exit fullscreen mode

No WebSocket. No reconnect logic. No indicator parsing. The agent iterates three assets, routes on verdict, thresholds on confidence, and delegates every interpretation decision upstream to AlgoVault. The exchange MCP call is a drop-in replacement once you wire it to your venue of choice.

Claude Code terminal session showing the agent loop running for BTC, ETH, and SOL with verdict and confidence output per asset

Pitfalls

MCP is request-response — millisecond execution still needs a co-located feed. AlgoVault is designed for 15-minute, 1-hour, and 4-hour decision cadences. If you are building a market-making engine that needs sub-100ms order-book data, MCP is the wrong surface for the execution loop. The correct architecture is a co-located native feed for execution and a get_trade_signal call once per candle for regime and direction thesis. The two protocols are complementary, not competitive; AlgoVault owns the interpret step, your execution layer owns the act step.

Free-tier rate limits are real. The free tier permits 20 get_trade_signal calls per day. A three-asset agent running hourly consumes 72 calls per day — past the free-tier ceiling. Upgrade to the standard tier before going to production; the full pricing schedule and upgrade path are at algovault.com/docs. Rate-limit errors surface cleanly in the MCP response (isError: true), so your agent can catch and handle them without silent failures.

Asset coverage has a long-tail gap. 290+ assets are covered across 11 timeframes, encompassing the vast majority of high-liquidity crypto pairs. TradFi and HIP-3 assets are rolling out across Q2–Q3 2026. If your target asset returns a not-found error, check the current coverage list at algovault.com/docs before building agent logic that assumes full-universe coverage.

Why MCP over a custom REST schema? We evaluated both. The _algovault metadata block — the per-call provenance carrier — maps cleanly onto MCP's typed tool-result schema. Every MCP client introspects available tools natively via tools/list; agent stacks self-document without us shipping an OpenAPI spec to every integration team. A custom REST shape would require each consumer to learn our JSON structure manually. MCP makes the shape introspectable and the provenance standardised across the entire client ecosystem.

Performance

Latency. Median get_trade_signal response time is 240ms on a cache hit — the common case for liquid assets in active timeframes — and 990ms on a cache miss (cold asset, first call of the candle). Both are well within the 15-minute decision cadence the tool is built for. Latency metrics are sourced from scripts/verify_phase2.sh benchmark runs against api.algovault.com/mcp, reflecting the optimisations landed in the LATENCY-W1 work. Further detail is in the AlgoVault engineering notes.

Accuracy. 88.9% PFE win rate across 46,912+ verified calls. Price-Following Efficiency is the public-facing accuracy metric: it measures whether price moved in the declared direction within the signal's timeframe window. Every call contributes to the next Merkle batch; 10 batches are now anchored on Base L2 and publicly verifiable at algovault.com/track-record. We publish PFE win rate only — not per-call return percentages — because directional accuracy is the auditable, manipulation-resistant metric for a tool that serves agent decision-making rather than portfolio management.

Coverage and distribution. 290+ assets, 11 timeframes, 14 registry listings, and 7+ AI clients compatible out-of-the-box with no additional configuration. The Smithery one-liner above has been tested on Claude Desktop, Claude Code, Cursor, and Cline. New MCP-compatible clients automatically become distribution channels for AlgoVault the moment they ship — the protocol handles discovery, the track record handles trust.

CTA

The track record is public, on-chain verifiable, and available now: algovault.com/track-record. 88.9% PFE win rate across 46,912+ verified calls — not a backtest, not a simulation, not a vendor claim.

Ready to wire it into your agent stack? The 30-second quick-start is at algovault.com/docs.

For skim readers — the Smithery one-liner:

npx -y @smithery/cli@latest install algovault/crypto-quant-signal-mcp --client claude-desktop
Enter fullscreen mode Exit fullscreen mode

Source, open issues, and the full example agent loop from Block 3: github.com/AlgoVaultLabs.

Mr.1 — AlgoVault Labs

Top comments (0)