About Tradingview Backtest Assistant”
A remote MCP server for AI agents to run TradingView Pine Script strategy backtests using Binance Futures data. It accepts strategy parameters and returns trade and performance metrics, with progress updates for long runs.
Key features
- 01Backtest Pine Script strategies
- 02Set symbol, timeframe, and date range
- 03Pass strategy inputs programmatically
- 04Return trades and performance metrics
- 05Track long runs with progress updates
Use cases
- 01Evaluate a Pine Script strategy on Binance Futures tickers
- 02Compare strategy performance across date ranges
MCP support
Exposes a remote MCP endpoint for agents to submit backtests and receive structured results and progress notifications.
Configuration
Remote servers need no local install. Pick your client, then copy the config or install in one click.
https://backtest-engine-mcp.click/mcp/backtestclaude mcp add --transport http tv-pinescript-backtest-engine https://backtest-engine-mcp.click/mcp/backtest{"mcpServers":{"tv-pinescript-backtest-engine":{"type":"http","url":"https://backtest-engine-mcp.click/mcp/backtest"}}}Open in Cursor{"servers":{"tv-pinescript-backtest-engine":{"type":"http","url":"https://backtest-engine-mcp.click/mcp/backtest"}}}Open in VS Code{"mcpServers":{"tv-pinescript-backtest-engine":{"type":"http","url":"https://backtest-engine-mcp.click/mcp/backtest"}}}{"mcpServers":{"tv-pinescript-backtest-engine":{"serverUrl":"https://backtest-engine-mcp.click/mcp/backtest"}}}Run commands in a terminal; paste JSON into the client’s MCP config and restart. Servers that need sign-in will prompt on first connect.
https://backtest-engine-mcp.click/mcp/backtestAuth requiredTools
Details
From the project READMEBacktesting engine for your AI Agent with PineScript support for TradingView usage

Production-ready MCP server for running TradingView Pine Script strategy backtests (Binance data) from AI agents.
Overview • Connect • Supported Agents • Troubleshooting • Get API Key • Website
Quick Overview
tv-pinescript-backtest-mcp exposes a remote MCP endpoint so agents can:
- run strategy backtests by symbol/timeframe/date range,
- pass strategy inputs programmatically,
- receive structured backtest results (trades, win rate, profit, drawdown),
- keep long-running runs observable via progress notifications,
- support Binance Futures tickers only,
- enforce a maximum of 1440 candles per backtest,
- apply a rate limit of 3 backtests per minute per user,
- ask your agent to write a strategy and backtest it.
Connect To Your Agent
Get API key: https://backtest-engine-mcp.click/dashboard
You need:
- Your MCP server URL (
https://backtest-engine-mcp.click/mcp/backtest) - Your API key (Bearer token)
Use HTTP transport and pass the API key in Authorization: Bearer <API_KEY>.
Supported Agents
Claude Code
CLI:
claude mcp add --transport http tvmcp https://backtest-engine-mcp.click/mcp/backtest --header "Authorization: Bearer <API_KEY>"
Project file (.mcp.json):
{
"mcpServers": {
"tvmcp": {
"type": "http",
"url": "https://backtest-engine-mcp.click/mcp/backtest",
"headers": {
"Authorization": "Bearer <API_KEY>"
}
}
}
}
OpenCode
opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"tvmcp": {
"type": "remote",
"url": "https://backtest-engine-mcp.click/mcp/backtest",
"oauth": false,
"headers": {
"Authorization": "Bearer <API_KEY>"
}
}
}
}
Cursor
Add to .cursor/mcp.json (or ~/.cursor/mcp.json globally):
{
"mcpServers": {
"tvmcp": {
"url": "https://backtest-engine-mcp.click/mcp/backtest",
"headers": {
"Authorization": "Bearer <API_KEY>"
}
}
}
}
Note: the same MCP configuration is used by cursor-agent CLI.
Codex
Add to ~/.codex/config.toml (or .codex/config.toml in a trusted project):
[mcp_servers.tvmcp]
url = "https://backtest-engine-mcp.click/mcp/backtest"
http_headers = { Authorization = "Bearer <API_KEY>" }
Note: Codex CLI and IDE extension share the same config.toml.
VS Code
Open MCP configuration (.vscode/mcp.json or user mcp.json) and add:
{
"servers": {
"tvmcp": {
"type": "http",
"url": "https://backtest-engine-mcp.click/mcp/backtest",
"headers": {
"Authorization": "Bearer <API_KEY>"
}
}
}
}
If needed, use Command Palette: MCP: Open User Configuration.
Minimal Test Prompt
Try these prompts with your agent:
Optimize my strategy: <pinescript code>
Optimize my strategy from file: sma20.pine
Find a strategy on the internet and backtest it using the tvmcp backtest tool.
Backtest my strategy on BTCUSDT 1h from 2026-03-01 to 2026-03-10, Pine code:
//@version...
Troubleshooting
The backtest-engine server has been tested on 30 strategies and tuned to match TradingView backtests 1:1 as closely as possible. Some operators may still be unsupported.
If you hit this case, please create a minimal strategy that reproduces the issue and submit it in Issues. We will do our best to add support quickly.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.