Stratify / Guides / Engineering
Backtesting 372 Million Option Bars Your AI Never Sees: A Compute-to-Data MCP Server
How I built Stratify, an MCP server that backtests options on proprietary market data behind closed doors and returns only the outcome. The architecture in thirteen pictures.

Many MCP servers fetch data and hand it to the model. Stratify does the opposite. The data stays on the server; the model sends a question in a formal language; the server runs it in private and sends back only the result.
The pattern

The AI is good at language and bad at arithmetic over a third of a billion rows. So the AI turns intent into a closed spec, and the server does the computing where the data lives. The spec is a grammar, not SQL or code, so every field can be checked and anything unknown refused.
The whole machine

One box, three layers, one way in. nginx is the only thing listening publicly. The API container listens on loopback only. ClickHouse has no host port at all, so the only route to the data runs through the API and back out as an outcome.
Resources

The API gets a hard cgroup cap of 4 cores and 4 GiB, so a burst of backtests slows down instead of starving the other services on the box. ClickHouse is capped at 45 % of RAM. The 11.3 GiB that backtests actually read is small enough to stay in page cache.
The data

ClickHouse because the workload is columnar scans over time-ordered bars. Precomputed layers because most questions only need near-the-money contracts close to expiry, and one row per contract-day answers every entry price without touching minutes.
Storage layout

That is why paid and free tiers share one database instead of two copies. Separating them would cost a second pipeline and buy 4 milliseconds.
Push the question to the data

The same principle as the whole system, one level down: send the question to the data, not the data to the question.
One request

ClickHouse answers in 23 ms. The other 175 ms is Python simulating fills, charges and statistics. That number decides how the system scales.
Reports

A result is stored once under an unguessable link. Every page is drawn in the browser from that result, so opening a report costs nothing and never re-runs anything.
Concurrency

Limits are per account, not per key, so minting keys buys nothing. The global slot counter lives in SQLite so all six worker processes share one limit. A short wait before refusing turns a brief overlap into latency instead of an error a model reports as a failure.
Capacity

The knee is 12 requests in flight: 21 backtests a second with the slowest 5 % under 0.8 s. Past it, throughput holds and only the wait grows. At one backtest per 20 seconds per person, that is about 400 people backtesting at the same moment.
Scaling

The bottleneck is Python on CPU, not the database and not the data size, so more cores means more workers. Scaling out is mostly a copy: the serving tables are rebuilt, never edited, so a replica is the same files on another machine.
Closed doors

Each ring holds even if the one outside it fails. A request has to pass all four, and raw rows have no route out through any of them.
Where this pattern fits
Any time the data is the moat: licensed market data, a company's internal records, regulated datasets, a proprietary model. Let the AI handle language and intent. Keep the data, the logic and the credentials behind a boundary that only lets outcomes out.
- Write down the constraint that can't move. Here: the data never leaves.
- Give the model a closed language, not a query interface.
- Push questions to the data instead of moving data to the question.
- Find what the work is bound by, measure it, and scale that.
- Make overload slow, not broken.
- Enforce every boundary twice, in layers that share no code.
The server is open source (MIT): github.com/Srinath-exe/stratify-mcp. Try it free at stratify.aeon-labs.site.
Backtest NIFTY and SENSEX options from ChatGPT or Claude. Free for the last year of data.
Start free with GoogleMore guides
Guide · 4 min readHow to Backtest Options Strategies with AI: ChatGPT and Claude on Real NIFTY and SENSEX Data
Backtest NIFTY and SENSEX options strategies by asking ChatGPT or Claude. Real one-minute option prices, every charge included. Free for one year of data.
Story · 5 min readI asked ChatGPT to backtest an options strategy. Here's where the answer actually came from.
What happens when ChatGPT backtests an options strategy: your AI writes the spec, and Stratify runs it on 372 million one-minute NIFTY and SENSEX bars.