Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

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.

  • Score 78
  • 11 stars
  • 367 a week
  • MIT
  • Updated

Install Backtest MCP

Built from the published package, never by AI.

claude mcp add backtest-mcp -- npx -y @pineforge/backtest-mcp

Run in your terminal. Add --scope user to use it in every project.

Step-by-step: install Backtest MCP in Claude Code

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

A

No 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 →
mcp stripe
96

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.

AAA Remote 2.1k
TradingMCPatilaahmettaner
94

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.

AAA Remote 5.4k
CCXTccxt
94

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.

AAA Local 45k
Finance ToolkitJerBouma
94

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.

AAA Local and remote 5.6k
Vapi Network MCP vAPI-Network
94

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.

AAA Local 6.2k
Finance DatabaseJerBouma
94

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.

AAA Local and remote 9.7k

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.

Backtest MCP Install

Add to stack

Loading.