transpile_pineLABSCO SUMMARY
A real engine run instead of a model's impression of one.
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.
What it is
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.
What you get
- 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, withbinance_symbolsto validate a symbol first - The catalog of every knob the engine accepts, so a request can be composed without guessing:
list_engine_paramsreturns strategy-header overrides and runtime arguments with types and enums - Coverage answers about the language itself —
check_pine_featurefor one identifier or namespace,list_coverage_topicsandget_coverage_topicfor the topic-by-topic picture engine_inforeports which engine the container is actually running
Requirements
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.
Setup effort
One command — docker run --rm -i -v "$PWD:/work" ghcr.io/pineforge-4pass/pineforge-backtest-mcp:latest
USE CASES
Checking whether a strategy someone posted actually works
Pull the candles for the symbol and timeframe, then run the strategy against them and read the trade count and net P&L.
Finding the parameter set that holds up
Give each input a list of values and sweep the combinations off one compile; the reply ranks them and names the best.
Answering whether PineForge supports the feature your script needs
Look up the identifier or namespace before you spend time porting, then read the full topic if it is only partly covered.
Getting the C++ translation without running anything
Translate the Pine source to its C++ translation unit and stop there.
10 tools
Listed in project docs. Your client may show a different list.
list_engine_paramsbacktest_pinebacktest_pine_gridfetch_binance_ohlcvbinance_symbolslist_coverage_topicscheck_pine_featureget_coverage_topicengine_infoBEFORE YOU INSTALL
What to know first
Tools you get
10 tools named in the project's documentation.
Requires
docker on PATH
Where it runs
Of the 4 documented clients, 3 run the server on your machine and 1 connects to a hosted endpoint.
INSTALLATION
Connect your client
Server setup
docker run --rm -i -v "$PWD:/work" ghcr.io/pineforge-4pass/pineforge-backtest-mcp:latestMCP Clients
Claude Code
claude mcp add pineforge-backtest -- docker run --rm -i -v "$PWD:/work" ghcr.io/pineforge-4pass/pineforge-backtest-mcp:latestAny MCP client — hosted
{
"mcpServers": {
"pineforge-codegen-mcp": {
"url": "https://mcp.pineforge.dev/mcp"
}
}
}Claude Desktop
{
"mcpServers": {
"pineforge-backtest": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-v",
"<YOUR_PATH_TO_WORKDIR>:/work",
"ghcr.io/pineforge-4pass/pineforge-backtest-mcp:latest"
]
}
}
}Cursor
{
"mcpServers": {
"pineforge-backtest": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-v",
"${workspaceFolder}:/work",
"ghcr.io/pineforge-4pass/pineforge-backtest-mcp:latest"
]
}
}
}