Connect Claude Code to TradingView for Chart Analysis and Pine Script Debugging
When you type "read the current RSI value" in the terminal, the AI connects to the TradingView Desktop instance running on your computer, checks the chart, and reports the value. This tool is a connection layer built to study how AI can interact with professional trading interfaces. It does not execute trades; instead, it translates charts you are already viewing into a format the AI can understand.
Secure Connection to Local Apps
The tool does not connect directly to TradingView servers or intercept network traffic. Instead, it uses the Chrome DevTools Protocol (CDP), the standard debugging interface for the TradingView Desktop app running on your computer. This debugging port is disabled by default and only activates if you explicitly add the --remote-debugging-port=9222 flag. All data processing happens locally, and no market data is sent or stored externally. This means the AI is "seeing" your charts, not "fetching" data from a server.
What the AI Can Do with Charts
The AI assistant can interpret and manipulate visual elements within charts. It assists in the development process of writing, compiling, and fixing errors in Pine Script, and performs chart navigation such as changing symbols or timeframes. It also reads indicator values, price levels, and annotations, and draws shapes like trend lines or rectangles on the chart. You can practice entries and exits by replaying historical data, or capture chart states as screenshots for visual analysis. These features are provided as MCP (Model Context Protocol) tools and are also accessible via CLI commands.
Research Purpose and Limitations
This project has a strong research focus, exploring how LLM-based agents can interact with professional trading interfaces. It focuses on investigating issues such as latency, context, and reliability constraints arising from real-time chart data. Therefore, it is not a trading bot and does not execute actual trades. It is merely an interface layer that controls the TradingView Desktop app you have already subscribed to. Features may break if TradingView's internal structure changes, so you should pin the app version if stability is important.
Prerequisites and Considerations
You must meet several conditions before using this tool. You need a valid TradingView subscription, the Desktop app, Node.js 18 or higher, and a Claude Code or terminal that supports MCP. It supports macOS, Windows, and Linux. TradingView's terms of service restrict automated data collection, so you must verify that using this tool complies with the terms. In particular, data monitoring via streaming features may conflict with the terms, so caution is required. Because it uses private internal APIs, it can break at any time with TradingView updates. It is recommended to pin the version of TradingView Desktop when performing critical tasks.