tradingview-mcp
- Type
- MCP server
- Scanned
- Nov 17, 2026
- Version
- c05b8f5755ed
- Files read
- 84
This MCP server and CLI connect an AI coding agent to a locally running TradingView Desktop app over Chrome DevTools Protocol so it can read charts, manage alerts and watchlists, develop Pine Scripts, and automate the interface. Because it attaches to your logged-in TradingView session with unrestricted page-level JavaScript execution (ui_evaluate), UI automation, and an unpinned self-update tool (tv_update), a prompt injection hidden in chart or community-indicator text could control your TradingView account, exfiltrate private scripts, or trigger unreviewed code updates.
What it can reach
- Browser
- Connects via Chrome DevTools Protocol (127.0.0.1:9222 by default) to the logged-in TradingView Desktop Electron app, where it can read chart data, alerts, watchlists, and saved Pine Scripts, click/type across panels including the Trading Panel, and run arbitrary JavaScript in the page context via ui_evaluate.
- Files
- Writes PNG screenshots to the screenshots/ folder, copies the Windows Store TradingView app (~330 MB) into %LOCALAPPDATA%/tradingview-mcp/ when needed by tv_launch, and overwrites its own repository files during tv_update (CLI commands and helper scripts also read and write Pine Script files).
- Shell commands
- Runs local system commands (git, npm ci, pkill, taskkill, which, where, mdfind, and PowerShell Get-AppxPackage) to check or apply updates and to locate, terminate, and relaunch the TradingView Desktop binary with remote debugging enabled.
- Network
- Connects locally to Chrome DevTools Protocol on port 9222 and makes direct outbound HTTPS requests to api.github.com (update check), symbol-search.tradingview.com (symbol_search), and pine-facade.tradingview.com (pine_check), in addition to authenticated TradingView API calls inside the Desktop app.
Findings
-
MediumSelf-update tool pulls unpinned code and runs npm install scripts at runtime
The MCP server enables a tv_update tool by default (and tv_health_check actively hints to the AI agent to call it whenever a newer commit exists). When called, tv_update fetches and merges the latest unpinned origin/main branch from GitHub without release tags or signature checks, overwriting the server code on disk. If package-lock.json changed, it immediately runs npm ci without --ignore-scripts, executing any lifecycle shell scripts in updated or added packages right away despite the tool description claiming it is safe by design and that new code only loads after a restart.
Fix: Remove tv_update from the MCP tool surface so updates require explicit manual action in a terminal, or pin updates to verified release tags and pass --ignore-scripts to npm ci.
-
LowHealth check inspects the current workspace Git repo and sends its name to GitHub
Whenever tv_health_check (or tv status) runs, checkForUpdate() executes git rev-parse HEAD and git config --get remote.origin.url without setting cwd to the tradingview-mcp directory. When the MCP server is started from another project folder (the standard global setup), it reads the Git remote of whatever workspace you are currently working in and sends its owner/repository path in an unprompted HTTPS request to api.github.com, leaking private repository names and potentially returning false update prompts to the agent.
Fix: Resolve the tradingview-mcp repository root via import.meta.url and pass { cwd: REPO_ROOT } to both execSync calls, and make the outbound GitHub update check opt-in.
-
LowPerformance analyst agent requests wildcard access to all tools
agents/performance-analyst.md:6
The performance-analyst subagent is meant only to read strategy backtest metrics and take chart screenshots using five read-only TradingView tools, but its frontmatter sets tools to "*". Granting every available tool (including shell execution, file edits, ui_evaluate, and tv_update) unnecessarily expands what an attacker can do if strategy titles or trade labels read from TradingView contain prompt injection text.
Fix: Replace the "*" wildcard in agents/performance-analyst.md with an explicit allowlist of the five read-only MCP tools it actually uses.
