loading…
Search for a command to run...
loading…
Token-efficient TradingView MCP for traders who backtest Pine strategies; aggregates strategy results and trade data server-side to reduce token usage.
Token-efficient TradingView MCP for traders who backtest Pine strategies; aggregates strategy results and trade data server-side to reduce token usage.
Token-efficient TradingView MCP for traders who actually backtest.
This is a fork built specifically for strategy testing. The existing TradingView MCPs work well for chart reading and morning workflows, but they burn tokens hard when you're iterating on Pine strategies — every backtest read dumps the full trade list, equity curve, and console output into your context. This fork rewrites those reads to aggregate inside TradingView's runtime before the data crosses the wire, returning summaries by default and detail on demand.
[!WARNING] Not affiliated with TradingView Inc. or Anthropic. This tool connects to your locally running TradingView Desktop app via Chrome DevTools Protocol. Review the Disclaimer before use.
[!IMPORTANT] Requires a valid TradingView subscription. This tool does not bypass any TradingView paywall. It reads from and controls the TradingView Desktop app already running on your machine.
[!NOTE] All processing is local. Nothing is sent anywhere. No TradingView data leaves your machine.
This project stands on two pieces of prior work:
If those repos help you, go star them.
| Area | Upstream behavior | This fork | Status |
|---|---|---|---|
data_get_strategy_results |
Returns full strategy tester payload (~67K tokens) | In-browser aggregation: returns ~40 curated metrics + computed expectancy + first/last trade timestamps. verbose: true for the full raw payload |
shipped (v0.1) |
data_get_trades |
max_trades cap only |
Cursor-paginated. Default limit: 20. all: true for full list |
planned |
data_get_equity |
Full curve point-by-point | Downsampled to N buckets (default 50). verbose: true for raw |
planned |
pine_get_console |
All console output | New pine_console_errors filters server-side |
planned |
| Strategy detector | Stops at first is_price_study === false source — latches onto Volume / EMA |
Score-based: scans all sources and picks the one with strongest strategy signals (ordersData, _strategyOrdersPaneView, _reportData, is_strategy meta) |
shipped (v0.1) |
data_get_strategy_resultsReal numbers from a 121-week (255-trade) backtest of a Pine strategy on COMEX:GC1! 1H:
| Mode | Output size | Approx tokens |
|---|---|---|
| Default (summary) | ~1.7 KB | ~425 |
verbose: true |
268,792 chars | ~67,000 |
~99% reduction per call in default mode. On a heavy iteration session (20+ runs), this is the difference between burning ~$20 of tokens on result reads alone vs ~$0.10.
The aggregation runs inside TradingView's Electron runtime — same CDP round-trip, ~150× less data crossing the wire.
v0.1 — first aggregation tool (data_get_strategy_results) shipped, with hardened strategy detector and trade-aggregate computation in-browser. Other tools still match upstream behavior.
Roadmap:
data_get_strategy_results summary mode + verbose escape hatchis_price_study gate)data_get_equity downsamplingdata_get_trades cursor paginationpine_console_errors filtered toolSame setup as upstream for now. When the new tools land in v0.2, the install path stays identical — only the
mcpServersconfig name might change.
git clone https://github.com/Chefy3x/tradingview-mcp-chefy.git ~/tradingview-mcp-chefy
cd ~/tradingview-mcp-chefy
npm install
Mac:
./scripts/launch_tv_debug_mac.sh
Windows:
scripts\launch_tv_debug.bat
Linux:
./scripts/launch_tv_debug_linux.sh
Add to ~/.claude/.mcp.json (merge with existing servers):
{
"mcpServers": {
"tradingview": {
"command": "node",
"args": ["/Users/YOUR_USERNAME/tradingview-mcp-chefy/src/server.js"]
}
}
}
Replace YOUR_USERNAME with your actual username (echo $USER on Mac/Linux).
Restart Claude Code and ask: "Use tv_health_check to verify TradingView is connected."
Claude Code ←→ MCP stdio ←→ src/server.js ←→ CDP :9222 ←→ TradingView Desktop (Electron)
localhost:9222Two-way street with upstream:
backtest_* family of tools → stays in this fork (changes the mental model of how the MCP is used)If you spot a bug in shared code paths, open an issue here and I'll route it.
This project is provided for personal, educational, and research purposes only.
This tool uses the Chrome DevTools Protocol (CDP), a standard debugging interface built into all Chromium-based applications. It does not reverse engineer any proprietary TradingView protocol, connect to TradingView's servers, or bypass any access controls. The debug port must be explicitly enabled by the user via a standard Chromium command-line flag.
By using this software you agree that:
Use at your own risk.
MIT — see LICENSE. Inherited from upstream. Applies to source code only, not to TradingView's software, data, or trademarks.
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"tradingview-mcp-chefy": {
"command": "npx",
"args": []
}
}
}