Backtest MCP
MCP server by pineforge-4pass Verified · npm:@pineforge
Backtests PineScript v6 strategies locally by transpiling them to C++ and running them in a Docker engine image. It works on your own OHLCV CSV files or on Binance data, and supports parameter sweeps.
Install Backtest MCP
Built from the published package, never by AI.
claude mcp add backtest-mcp -- npx -y @pineforge/backtest-mcpRun in your terminal. Add --scope user to use it in every project.
{
"mcpServers": {
"backtest-mcp": {
"args": [
"-y",
"@pineforge/backtest-mcp"
],
"command": "npx"
}
}
}Settings, Developer, Edit config. Paste into claude_desktop_config.json and restart.
{
"mcpServers": {
"backtest-mcp": {
"args": [
"-y",
"@pineforge/backtest-mcp"
],
"command": "npx"
}
}
}Add to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (this project).
{
"servers": {
"backtest-mcp": {
"args": [
"-y",
"@pineforge/backtest-mcp"
],
"command": "npx"
}
}
}Add to .vscode/mcp.json. VS Code uses "servers", not "mcpServers".
codex mcp add backtest-mcp -- npx -y @pineforge/backtest-mcp{
"mcpServers": {
"backtest-mcp": {
"args": [
"-y",
"@pineforge/backtest-mcp"
],
"command": "npx"
}
}
}Add to ~/.gemini/config/mcp_config.json (all projects) or .agents/mcp_config.json (this project).
gemini mcp add backtest-mcp npx -y @pineforge/backtest-mcpGemini CLI was replaced by Antigravity CLI in June 2026 and remains only for enterprise licences and paid API keys.
MCP servers run with your permissions and can read what you give them access to. Some need an API key: check the README and add it under env in the backtest-mcp block.
About
Backtest MCP is a self-contained stdio MCP server. An AI agent writes a PineScript v6 strategy, and the bundled pineforge-release image transpiles it to C++ and backtests it against an OHLCV CSV. The CSV can be the user's own file or one fetched from Binance's public API. The image bundles the pineforge-codegen transpiler, so the Pine to C++ to backtest steps run without a host Docker daemon. No API key is needed. Strategy source and CSVs stay on the machine, except for the Binance tools and check_tradingview_parity when no bars are passed.
The server suits people who want to test PineScript v6 strategies offline. It supports single backtests, grid sweeps over inputs and overrides, and trade-by-trade checks against a TradingView Strategy Tester export. It is meant for users who bring their own CSVs or want to run parameter sweeps locally.
Written from the project's README and checked against it.
Tools it gives your assistant
backtest_pineRuns a single backtest of a Pine source against an OHLCV CSV.backtest_pine_gridRuns a Cartesian sweep of inputs and overrides, with one transpile and a backtest per combination.transpile_pineTranslates a Pine v6 script into a C++ translation unit without running it.check_tradingview_parityGrades a TradingView Strategy Tester export against PineForge's run, trade by trade.fetch_binance_ohlcvWrites a backtest-ready CSV from Binance spot or USDT-perp klines.binance_symbolsLists and filters Binance symbols, with a 5-minute in-process cache.list_engine_paramsLists every overrides and runtime knob accepted by the backtests.list_coverage_topicsLists every Pine v6 coverage topic with a one-line status and summary.check_pine_featureChecks whether a Pine identifier or namespace is supported in PineForge.get_coverage_topicReturns full detail and supported, partial, and unsupported lists for one topic.
What you need
- Docker
- Outbound network access for the Binance fetch tools
- Node.js 20 or later for the npm package route
Try asking
- Backtest this Pine v6 strategy on my BTC CSV in /work.
- Run a parameter sweep of my strategy over these input ranges.
- Fetch 1-hour BTCUSDT klines from Binance and backtest my script.
Good to know
- Needs Docker to run the engine image.
- Supports PineScript v6 only and a subset of Pine v6 features.
- Only the Binance tools and parity checks without bars make outbound requests.
- A backtest measures past behavior and is not investment advice.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: README.md, package.json. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to Backtest MCP
All alternatives →Connects AI assistants to Stripe through the hosted Stripe MCP server at mcp.stripe.com. It is for developers building AI-powered products and businesses on Stripe.
Gives AI assistants market data, technical analysis, backtests, options activity and news sentiment for stocks, crypto, FX and metals. Built for traders and developers using Claude, ChatGPT, Cursor or other MCP clients. Its outputs are informational, not financial advice.
CCXT is an official MCP server for market data and trading across more than 100 exchanges and prediction markets. It is aimed at developers, traders and AI agents.
Calculates over 1400 transparent financial methods from raw statements and exposes them to AI assistants through an MCP server. Suited to analysts and developers who want to see how each metric is computed.
Lets an AI assistant search x402 APIs and pay for them in USDC from a local, non-custodial wallet. Built for people and agents that need to pay APIs per call under spend caps.
Lets AI assistants explore a free database of over 300,000 symbols, including equities, ETFs, funds, indices, currencies and cryptocurrencies, categorised by sector, industry and country. It suits private investors who want to discover products rather than look up fundamentals or stock data.
Compare with mcp, TradingMCP or CCXT
Backtest MCP: common questions
Does Backtest MCP need an API key?
No. The source says the server needs no API key and that the engine is fully local.
Can I backtest with my own CSV data?
Yes. Mount the folder with your CSVs at /work and pass absolute /work paths to the backtest tools.
Which Pine Script version does it support?
The source says it accepts PineScript v6 only, and implements a subset of Pine v6.
How do I install Backtest MCP?
In Claude Code run claude mcp add backtest-mcp -- npx -y @pineforge/backtest-mcp. For Claude Desktop, Cursor and VS Code, paste the config shown above and restart. See the install guides.
Is Backtest MCP the official server?
Backtest MCP is published by npm:@pineforge from its verified domain in the official MCP Registry.
Is Backtest MCP free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is Backtest MCP safe to use?
It scores 78 of 100. Grades: maintenance A, licence A, quality C. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to Backtest MCP?
Similar MCP servers: mcp, TradingMCP, CCXT, Finance Toolkit.
Does Backtest MCP work with ChatGPT?
Not directly. It runs locally, and ChatGPT only connects to remote servers with a URL. Use it in Claude Code, Claude Desktop, Cursor, VS Code or Codex.
