A language model cannot backtest PineScript by reasoning about it — series semantics, intrabar fill order and the strategy order logic do not survive approximation, and the numbers come out invented. This server runs the deterministic C++ engine instead and returns the trades and P&L it produced; the project reports strict TradingView parity on 245 of 246 reference strategies, with the single non-match attributed to broker behaviour at the margin boundary.
A self-contained backtesting server for PineScript v6. The image bundles the PineForge transpiler and engine, so Pine becomes C++ and the backtest runs in-process — no host Docker daemon behind it, nothing sent off the box. Published as `@pineforge/backtest-mcp`, version 0.9.27.
- A single run of a strategy against an OHLCV CSV — `backtest_pine`, answering with the trade list, the summary and the applied inputs
- A parameter sweep that compiles once and runs the cartesian product of inputs and overrides, ranked with the winner under `best` — `backtest_pine_grid`
- Pine to C++ translation on its own, when you want the translation unit and not the run: `transpile_pine`
- Market data fetched into a backtest-ready CSV from Binance spot or USDT-perp klines, paginated past the per-request cap — `fetch_binance_ohlcv`, with `binance_symbols` to validate a symbol first
- The catalog of every knob the engine accepts, so a request can be composed without guessing: `list_engine_params` returns strategy-header overrides and runtime arguments with types and enums
- Coverage answers about the language itself — `check_pine_feature` for one identifier or namespace, `list_coverage_topics` and `get_coverage_topic` for the topic-by-topic picture
- `engine_info` reports which engine the container is actually running
Docker, and outbound network only if you use the Binance fetch tools. No account and no API key. The published artefact is an OCI image, ghcr.io/pineforge-4pass/pineforge-backtest-mcp, spoken over stdio: run it with --rm and -i and mount your working directory at /work so the server can read and write your CSVs. Never add -t — a TTY corrupts the JSON-RPC stream. CSV paths must sit inside the server process's working directory unless you set `PINEFORGE_ALLOW_ANYWHERE`. There is also a hosted endpoint at https://mcp.pineforge.dev/mcp, which is metered per IP and runs against a sealed Binance data lake rather than your own files.
One command — docker run --rm -i -v "$PWD:/work" ghcr.io/pineforge-4pass/pineforge-backtest-mcp:latest
