quant-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@quant-mcp Backtest a 20/50 SMA cross on AAPL and show the equity curve"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
quant-mcp — an MCP server for market analysis
Built by Ismaël LADJOHOUNLOU · Model Context Protocol · TypeScript · read-only by design
A Model Context Protocol server that gives an AI agent typed access to market data, indicators, backtesting and position sizing. It runs over stdio, works with Claude Desktop, Claude Code and the MCP inspector, and it is built around the three things that separate a useful MCP server from a demo:
It fits in a context window. No tool returns five thousand rows. Long series are truncated to the most recent values and the response states the total, so a call never pushes the user's original question out of the conversation.
Its errors are recoverable by the model. An unknown symbol comes back as
isError: truewith the list of valid symbols, not as a protocol exception. The model fixes its own call and continues.Its results carry their caveats. A backtest answer ships the execution model that produced it — next-bar fills, costs both sides, stop-before-target — so the model cannot quote a return figure without the assumptions that make it meaningful.
The data is generated deterministically from a seed, not downloaded. Every number in this
README is reproducible with npm test, and nothing here predicts a real market.
Try it
npm install
npm test # 24 tests, including a real MCP client driving a real handshake
npm run inspect # the official inspector, no model requiredWire it into a client with three lines of JSON: see docs/USAGE.md for Claude Desktop, Claude Code, and how to point it at your own CSV history.
Related MCP server: TastyScanner MCP Server
The tools
Tool | What it does | Guarantee it makes |
| The instruments available and where they come from | Says whether data is generated or operator-supplied |
| Recent candles for a symbol and timeframe | Bounded response, states how much was left out |
| SMA, EMA, RSI, ATR, Bollinger | Values aligned with candles, |
| MA cross, RSI reversion or breakout, with metrics, trades and equity curve | Next-bar execution, costs both sides, stop wins a bar that touches both; assumptions returned with the result |
| Risk and stop distance to contracts | Refuses a zero stop; flags notional above 20x equity |
Plus two resources (quant://symbols, quant://methodology) and two prompts
(analyse_symbol, review_backtest). The review prompt is the interesting one: it makes the
model re-run with doubled costs and check whether the equity curve rests on a few outliers
before it endorses a strategy.
Why the backtest can be trusted
The engine enforces the four rules that decide whether a backtest means anything, instead of leaving them to the caller's discipline:
A signal from bar i fills at the open of bar i + 1. Filling at the close that produced the signal is look-ahead, and it is the single most common reason a strategy looks profitable on a chart and is not in production. A test walks every trade and asserts the fill sits on the next bar's open.
Costs are charged on entry and exit. A test runs the same strategy at zero cost and at 20 bps and asserts the expensive one ends poorer, with the same trade count — which is how you know the costs are applied to the money and not to the signals.
A bar touching both stop and target is a stop. Without tick data the order inside the bar is unknowable, and assuming the favourable one is how a win rate gets inflated.
Size comes from risk. Position size is the risked fraction of equity divided by the stop distance, which is a multiple of ATR.
Read them in src/engine/backtest.ts, or ask the server for
quant://methodology.
Security
An MCP server runs with the user's privileges, and the thing choosing which tool to call is
a model reading text that may have come from anywhere. The mitigation with the best ratio of
effectiveness to effort is to not ship a dangerous tool: this server is read-only. No
filesystem writes, no network calls, no child processes, no trading API, no eval. A
prompt injection that reaches it cannot make it destroy anything, because there is nothing
destructive to call.
The full threat model, and the line to hold if you extend it, is in docs/SECURITY.md.
Tests
npm test24 tests in two layers.
Protocol — a real Client from the SDK, connected over an in-memory transport, doing a
real handshake: capabilities, tool listing with schemas, every tool called, truncation
asserted, schema violations caught before the handler runs, resources read, prompts rendered.
Testing the handler functions directly would pass while the server was unusable by any actual
client. CI goes one step further and pipes raw JSON-RPC into the built binary over stdio.
Engine — SMA and EMA against hand computations, RSI bounded and 100 on an unbroken advance, ATR reflecting a gap rather than just the bar range, determinism of the generated series, no look-ahead in fills, costs strictly reducing equity, and metrics agreeing with the equity curve they are derived from.
Author
Ismaël LADJOHOUNLOU — data engineer, algorithmic trading and automation developer.
Portfolio: https://ismael-portfolio-liard.vercel.app/en
Upwork: https://www.upwork.com/freelancers/~01498331f7c7800fc0
Related: Sluice (streaming pipeline with backpressure and exactly-once) · QuantSwap (DEX with a reorg-safe indexer) · Cascade (Instagram to WhatsApp automation)
Available for MCP server, agent tooling and integration work.
Licence
MIT © 2026 Ismaël LADJOHOUNLOU. See LICENSE.
Available Tools
5 toolsbacktestBacktest a strategyA
Runs a strategy over the history and returns metrics, the trade list and the equity curve. Signals fill at the next bar's open, costs are charged both sides, and a bar touching both stop and target counts as a stop. The assumptions come back with the result.
Inputs: symbol (required), strategy (required), bars, timeframe, +5 more.
get_ohlcGet OHLC candlesA
Returns recent candles for a symbol. Long ranges are truncated to the most recent rows; the response states the total available.
Inputs: symbol (required), bars, timeframe.
indicatorCompute a technical indicatorA
Computes SMA, EMA, RSI, ATR or Bollinger bands. Values are aligned with the candles and null before the indicator has enough history, so a caller cannot silently shift the series.
Inputs: name (required), symbol (required), bars, period, +2 more.
list_symbolsList available symbolsA
Lists the instruments this server can analyse, and where their data comes from.
Inputs: no named parameters.
position_sizeSize a position from riskA
Turns account equity, risk tolerance and a stop distance into a position size. Refuses inputs that would risk more than the account or imply a zero stop.
Inputs: stop (required), entry (required), equity (required), riskPercent (required), +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool covers a distinct aspect of the quant workflow: symbol discovery, OHLC data, indicator calculation, backtesting, and position sizing. There is no meaningful overlap or ambiguity between them.
Naming is readable but not uniform: list_symbols and get_ohlc follow a verb_noun pattern, while backtest, indicator, and position_size are single verbs or noun phrases. The inconsistency is noticeable but not confusing.
Five tools is well-scoped for a quantitative analysis server. Each tool serves a necessary step in the analysis workflow without redundancy or bloat.
The set covers the core workflow: discover symbols, retrieve data, compute indicators, run backtests, and size positions. Minor gaps exist around strategy persistence or more granular risk controls, but they do not create dead ends for the stated purpose.
Related MCP Connectors
Build, backtest, and deploy quantitative trading strategies from your AI agent.
Unified financial infrastructure connecting AI agents directly to trade live/demo brokerage accounts, Web3 non-custodial wallets, real-time market data across equities, ETFs, crypto, forex, options, DeFi swaps, and prediction markets, institutional research feeds, and algorithmic strategy backtesters.
Market intelligence for AI agents. Real-time data, cross-market analysis, and regime detection.
Pay-per-call APIs for trading agents: market data, indicators, insider trades, on-chain tools.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables LLMs and agentic workflows to access real-time and historical stock market data through the Model Context Protocol.227MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to scan markets, build option strategies, track positions, and execute trades on TastyTrade via the Model Context Protocol.3MIT
- AlicenseAqualityCmaintenanceReal-time stock & crypto market data for LLMs, over the Model Context Protocol.4MIT
- AlicenseNot gradedqualityDmaintenanceProvides real-time stock data, news, company fundamentals, and technical indicators for AI assistants via the Model Context Protocol.MIT