tradingview-mcp
Comprehensive MCP server for TradingView Desktop: complete Pine Script lifecycle (create/save/version), full Strategy Tester extraction (every metric, every trade), chart and layout control, replay, alert/watchlist tools and DOM-driven UI automation over Chrome DevTools Protocol. No computer vision.
Install / Use
claude mcp add JostQQ -- npx -y github:JostQQ/tradingview-mcpIf the server publishes to npm under a different name, use that package instead — check the repo README.
MCP Server
Model Context Protocol server
Quality Score
Category
AutomationSupported Platforms
Our assessment of tradingview-mcp
tradingview-mcp scores 84/100 on our quality scale, 2012th of 2,790 Automation skills we index.
Its MCP Server is 22 KB long, well organised into 20 sections with 14 code examples: a thorough specification that gives an agent plenty to work with.
It has 10 GitHub stars, so there is little community track record yet; judge it on its content.
Maintenance, license and trust
- The repository was last updated 37 days ago, so tradingview-mcp is actively maintained.
- No license is declared. By default that means all rights are reserved: you can read it, but reusing or redistributing it is not clearly permitted. Ask the author before building on it commercially.
- Its trust signals score 85/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.
AI review by kimi-k2.7-code on 2026-11-13. Automated pattern scan on 2026-11-13. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
tradingview-mcp compared with similar skills
All 4 of these similar skills score higher than tradingview-mcp; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| tradingview-mcp (this skill)by JostQQ | 84 | 10 | 37d ago | MCP Server |
| Agent-Reachby Panniantong | 100 | 112.3k | 8d ago | CLAUDE.md |
| rufloby ruvnet | 100 | 81.9k | today | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 79.8k | today | CLAUDE.md |
| CowAgentby zhayujie | 100 | 48.0k | today | CLAUDE.md |
Frequently asked questions
- How do I install tradingview-mcp?
- Run
claude mcp add JostQQ -- npx -y github:JostQQ/tradingview-mcp. The install tabs above show the steps for each supported agent. - Which AI agents does tradingview-mcp work with?
- It is written for Claude Code and Claude Desktop, as a MCP Server file. Other agents that read the same format can often use it too.
- Is tradingview-mcp safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It declares no license and scores 85/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is tradingview-mcp still maintained?
- The repository was last updated 37 days ago, so tradingview-mcp is actively maintained.
Skill content
View source on GitHubTradingView MCP
A comprehensive MCP server for TradingView Desktop. Create, save, backtest and fine-tune Pine Script strategies entirely from an agent — full chart control, the complete Pine Script lifecycle, complete Strategy Tester extraction, layouts, replay and DOM-driven UI automation, all over Chrome DevTools Protocol.
No computer vision. No screenshots. Everything is data.
Contents: What it is · Quick start · How it works with TradingView · Agent interoperability · What you can call & analyze · Showcases · Safety model · Configuration · Verified state · Limitations · Troubleshooting · Development · Documentation · Upstream credit
What it is
TradingView's desktop app is normally driven by hand: click the editor, paste code in, press buttons, screenshot the tester. TradingView MCP exposes the app's own internal APIs (chart widget model, strategy report engine, Pine editor facades, pine-facade REST) through 104 MCP tools, so an agent can run the entire strategy research loop at machine speed:
- 📝 Write Pine safely — load code into the editor, compile it onto the chart, save new scripts and new cloud versions through the app's own save path — with a protected-script registry, automatic local backups and post-save verification.
- 📊 Read backtests in their entirety — 40+ metrics, every trade (entry/exit time + price, run-up, drawdown, commission, account value), the full equity curve and buy&hold — read from the strategy's internal report model, not scraped from the screen.
- 🔬 Fine-tune at speed — read and override strategy inputs, wait for recomputes, and sweep parameter matrices in one call; every run is appended to a JSONL ledger for reproducible analysis.
- 📈 Control everything — symbols, timeframes, chart types, trading sessions (RTH ⇄ ETH), studies, layouts, alerts, watchlists, drawings, replay, panes and tabs.
- 🤖 Built for agents — flat JSON results, precise tool contracts, large payloads dumped to files, and an
AGENTS.mdthat teaches any agent to operate it without wrecking your account. - 🚫 Zero computer vision — interactions use internal APIs and the DOM (normalized text matching, React-fiber fallbacks); outputs are structured data. Deterministic, testable, scriptable.
Built for quant researchers, strategy tinkerers and automation folks who'd rather call a tool than click a button.
Quick start
Requirements: Windows with TradingView Desktop installed (Microsoft Store/MSIX or classic installer), Node.js ≥ 20, and any MCP client (Hermes Agent, Claude Desktop, Cursor, …).
git clone https://github.com/JostQQ/tradingview-mcp.git
cd tradingview-mcp
npm install
(Or grab tradingview-mcp-v1.0.0.zip from Releases — it's the same tree, no install needed beyond Node.)
Register it with your client:
# Hermes Agent
hermes mcp add tvmcp --command node --args "<absolute path to tradingview-mcp>\src\server.js"
// Claude Desktop (claude_desktop_config.json) — any MCP client works the same way
{
"mcpServers": {
"tvmcp": { "command": "node", "args": ["<absolute path to tradingview-mcp>\\src\\server.js"] }
}
}
Connect to the app: start TradingView with the debug port — TradingView.exe --remote-debugging-port=9222 — or just call tv_launch from the agent. Then verify with tv_health_check (you'll see your chart's symbol/timeframe back).
The 60-second loop (what this MCP exists for):
strategy_list → strategies on the chart (entity id + linked script id)
pine_set_source {source} → load new code into the editor (nothing saved yet)
pine_compile → apply to the chart (never saves to the cloud)
strategy_get_report → all metrics + the exact tested window
strategy_get_trades {write_file: true} → every trade, dumped as JSON to the workspace
strategy_scan {entity_id, variants:[…]}→ sweep parameters; one JSONL ledger entry per run
pine_save_next {script_id} → publish the buffer as a new version (backed up + verified)
How it works with TradingView
TradingView MCP connects to the running app over Chrome DevTools Protocol (127.0.0.1:9222) and works in three layers, in order of preference:
- The app's internal JavaScript APIs — chart widget model, the strategy engine's
reportData(), the Pine editor's dialog/bottom facades. - In-page REST — cloud script operations (save / new version / rename / delete / versions) run through the app's own pine-facade fetch, so cookies, auth and error semantics are exactly what the app itself would do.
- The DOM — only where no API exists (dialogs, menus, toggles), driven by normalized text matching with React-fiber
onClickfallbacks. TradingView renders doubled labels ("Add to chartAdd to chart"); the UI layer normalizes that.
┌────────────────────┐ CDP (127.0.0.1:9222) ┌──────────────────────────────────┐
│ MCP client │ ◄───────────────────────► │ TradingView Desktop │
│ (Hermes, Claude, │ stdio │ ├─ chart page (TradingViewApi) │
│ Cursor, any) │ │ │ ├─ chart widget model │
└────────────────────┘ │ │ ├─ strategy reports │
│ │ │ ├─ Pine editor facade │
▼ │ │ └─ DOM (dialogs / menus) │
src/server.js ─► core/* ─► connection.js │ └─ pine-facade REST (in-page) │
104 tools modules multi-target └──────────────────────────────────┘
workspace/ (backups, ledgers, dumps)
Because nothing depends on pixels, behavior is deterministic and rerunnable — and it works while the window is occluded, minimized or on another desktop.
Deep dive into every internal path used: docs/ARCHITECTURE.md.
Agent interoperability
- Standard stdio MCP server — works with Hermes Agent, Claude Desktop, Cursor, or anything speaking the Model Context Protocol. Tool discovery, calls and results follow the standard protocol; a raw handshake + live tool calls are exercised in
tests/mcp_stdio_test.mjs. - Tool contracts, not guesswork — 104 tools with flat
group_actionnames. Every description states what it does, what it touches (chart vs editor vs cloud) and its safety behavior. Full auto-generated reference: docs/TOOLS.md. - Result convention — every call returns flat JSON with
success; failures come back asisErrorwith a human-readableerror. Anything large (all bars, all trades, equity curves, scans) is written to workspace files viawrite_file: trueand referenced by path, so agent context stays small. - Safe by default —
pine_compilecan never click a Save button; cloud writes go through guarded REST paths; a protected-script registry (workspace/protected_scripts.json) makespine_save_next/pine_deleterefuse to touch scripts you list there unless explicitly overridden.AGENTS.mdships golden rules, a tool-routing cheat-sheet, standard workflows and a failure playbook so any agent behaves well. - Escape hatch —
tv_evalexecutes raw JS in the app when you need something exotic.
Example asks that work out of the box:
“Backtest the strategy on my chart and give me the full report plus every trade.” “Sweep Fast EMA from 5 to 21 on the EMA crossover and rank by profit factor.” “Check this script for compile errors before we touch the chart.” (side-effect-free
pine_check) “Save the current editor buffer as a new version of my strategy and confirm the version bumped.”
What you can call & analyze
104 tools in 13 groups. Complete parameter-level reference: docs/TOOLS.md.
| Group | Tools | Highlights |
|---|---|---|
| Health & launch | 5 | tv_health_check, tv_launch, tv_discover, tv_ui_state, tv_eval |
| Chart & studies | 17 | symbols, timeframes, chart types, sessions (RTH⇄ETH), zoom, visible range, scroll-to-date, study add/remove, study inputs, symbol search |
| Pine Script | 17 | full lifecycle: pine_list_scripts, pine_open, pine_save_new, pine_save_next, pine_rename, pine_delete, pine_versions, pine_get_version, plus buffer ops and offline validation |
| Strategy Tester | 8 | strategy_get_report/trades/equity/inputs, strategy_set_inputs, strategy_wait, strategy_scan, strategy_list |
| Market & study data | 12 | OHLCV (incl. the full loaded history), quotes, study values, Pine lines/labels/tables/boxes, DOM depth |
| Layouts | 7 | list / current / switch / save / rename / delete / create — verified against TradingView's id-lag traps |
| Replay | 6 | start, step, autoplay, trade, stop, status |
| Drawings | 5 | draw, list, remove, clear, properties |
| Alerts | 3 | create, list, delete |
| Watchlist | 4 | get, add, bulk-add, remove |
| Panes & tabs | 9 | pane layout/focus/symbol, tab new/switch/close |
| UI automation | 10 | ui_find/click/type/key/menu/hover/scroll, ui_dialog_scan/click/dismiss — no vision |
| Batch | 1 | batch_run: symbol × timeframe matrices with workspace dumps |
What the backtest tools actually give you:
- Report —
netProfit,percentProfitable,profitFactor,sharpeRatio,sortinoRatio,maxStrategyDrawDown,maxStrategyRunUp,buyHoldReturn,commissionPaid,marginCalls,maxContractsHeld,avgWinTrade/avgLosTrade/ratioAvgWinAvgLoss,grossProfit/grossLoss, trade counts by side, and the exact tested window (dateRange.backtest). - Every trade —
side,entry_time+ price + bar + comment,exit_time+ price + bar + comment,qty,profit(+%), cumulative profit, run-up (MAE), drawdown (MFE),commission,account_value. No panel caps — the full array, streamed to a file if you want. - Equity — per-trade account values, cumulative PnL, drawdown, the buy&hold baseline, initial capital and final equity.
Showcases
Real captures from the verification suite against TradingView Desktop 3.4.x (throwaway EMA-crossover strategy on MES 1m).
1. Idea → applied → full extraction
pine_set_source {source: "<EMA crossover strategy>"} → buffer loaded (not saved)
pine_compile {expect_doc_name: "…"} → applied to chart ("Add to chart")
strategy_get_report → full metrics for the new study
strategy_get_trades {write_file: true} → 657 trades → workspace/dumps/trades-….json
strategy_get_equity {write_file: true} → equity + buy&hold → workspace/dumps/equity-….json
strategy_get_report excerpt (real numbers from the run):
{
"success": true,
"strategy": "TVMCP Smoke 2026-10-10-17-03",
"entity_id": "pd2PyI",
"metrics": {
"netProfit": -1937.5,
"percentProfitable": 0.2546,
"profitFactor": 0.8359,
"sharpeRatio": -0.4354,
"sortinoRatio": -0.4262,
"maxStrategyDrawDown": 2215,
"maxStrategyRunUp": 1030,
"buyH
Truncated for display — read the full file on GitHub.
Related Skills
Agent-Reach
112.3kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
ruflo
81.9k🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
headroom
79.8kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
CowAgent
48.0kOpen-source personal AI assistant & Agent Harness. Plans tasks, runs tools and skills, self-evolves with memory and knowledge. Multi-agent, multi-model, multi-channel. Lightweight, extensible, one-line install.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
