TradingView MCP lets Claude read and drive your charts

A TradingView MCP server lets Claude Code see and operate TradingView, the charting platform where traders and investors follow stock, crypto and forex prices. In TradingView you open a price chart, add indicators such as moving averages or MACD, draw your own lines on it, and write custom indicators in TradingView’s own scripting language, Pine Script. The open-source tradingview-mcp project hands those controls to Claude: it reads what is on your chart, switches symbols and timeframes, and writes and debugs Pine Script while you watch.

Key Takeaways
- TradingView is a charting app with its own indicator language, Pine Script.
- tradingview-mcp lets Claude Code operate the TradingView Desktop app.
- Best use: Claude writes, compiles and fixes Pine Script.
- It uses your own account and never places trades.
- A TradingView update can break it.
What TradingView is and why you would hand it to Claude
TradingView started as a website and now also ships a desktop app for Windows, macOS and Linux. Most people use it to look at charts: pick a symbol, pick a timeframe, add a few indicators, mark support and resistance levels by hand. Many brokers plug into it, but plenty of users never trade from it at all. They use it to study the market.
The part developers care about is Pine Script. Every indicator in TradingView is a Pine script, and you can write your own in the Pine Editor at the bottom of the screen. The script below computes MACD from two moving averages and plots it in its own pane under the price chart.

Pine has unusual rules (every line runs once per bar, and values from earlier bars need special syntax), so even experienced programmers spend a lot of time on compile errors. Reading a busy chart means squinting at a dozen numbers in indicator labels and tables. An AI agent that can see the chart as data and drive the Pine Editor covers both.
What the TradingView MCP server does
MCP, the Model Context Protocol, is the standard way to give an AI agent tools. tradingview-mcp exposes 84 of them, plus a tv command-line equivalent for each.
| Job | What Claude can do |
|---|---|
| Read | Symbol, timeframe, indicator values, price levels, and the labels, tables and zones that Pine indicators draw |
| Drive | Change symbol, timeframe and chart style, add or remove indicators, build 2x2 or 3x1 chart grids |
| Write | Put Pine Script into the editor, compile it, read the errors and log output, save it |
| Draw | Trend lines, horizontal lines, rectangles and text notes |
| Practice | Step through past bars in replay mode with simulated entries and exits |
| Never | Send a real order to a broker |
The Pine Script loop is where it pays off most. The project’s research notes call compile, read error, fix the strongest use case. You describe the indicator you want, Claude writes it, compiles it in your app, reads what the compiler complains about, and tries again until it runs.

Reading indicator output is the second trick. Say a custom indicator paints session levels, bias labels and a stats table. The server pulls the values behind those line.new(), label.new() and table.new() calls out as plain numbers, so Claude reads exact figures instead of guessing from pixels.
Results come back trimmed by default. A long Pine script can pass 200KB and 500 bars of price data is about 40KB, so a full “analyze my chart” request would eat around 80KB of Claude’s context. Compact output cuts that to 5-10KB.
How it connects to TradingView
TradingView Desktop is an Electron app, which means it is a web page running inside a bundled copy of Chrome, the same way VS Code, Slack and Discord are built. Every such app has a debugging interface, the Chrome DevTools Protocol, and it is switched off unless you start the app with the --remote-debugging-port=9222 flag.
With that port open, the MCP server can look inside the running app and click its controls, much like a browser automation tool drives a web page. Claude asks the server for something, the server reads or changes the chart through port 9222, and the answer goes back to Claude.
The server never contacts TradingView itself, so it can only see what your app already shows: your login, your subscription, your data. The README asks for a TradingView subscription and notes that real-time prices need a paid plan. It doesn’t store or resell market data, and it can’t place trades.
TradingView’s Terms of Use restrict automated data collection, and the project’s own disclaimer admits that scripting the desktop app may clash with them. The server reads your own screen instead of scraping a service, and the risk is yours. The project has no affiliation with TradingView Inc.
How to connect Claude Code to TradingView Desktop
Setup takes a few minutes. Almost every problem comes back to the debug flag.
Check the prerequisites
You need TradingView Desktop installed and signed in, a TradingView subscription, Node.js 18 or newer, and Claude Code or another agent that speaks MCP.
Turn off TradingView auto-updates
The server reads internals TradingView never documented. Pin the version you set it up on, or an overnight update can break it without warning.
Start TradingView with the debug port
Launch the app with --remote-debugging-port=9222. The repository ships launch scripts for macOS, Windows and Linux that find the app for you.
Register the MCP server
Clone the repository and run npm install. It has only two dependencies, the MCP SDK and chrome-remote-interface. Then add it to ~/.claude/.mcp.json, or a .mcp.json in your project:
{
"mcpServers": {
"tradingview": {
"command": "node",
"args": ["/path/to/tradingview-mcp/src/server.js"]
}
}
}Verify the connection
Ask Claude to run the tv_health_check tool. If it can’t reach the app, TradingView was started without the debug flag. Restart it with the flag.
Start with read-only requests
Ask “What’s on my chart?” and compare the answer with your screen before you let Claude change anything. Then try something that moves the chart, such as “Switch to AAPL daily”.
Move on to Pine Script
Ask Claude to write an indicator (“Write a Pine Script that marks the previous day’s high and low”) or to read an existing one’s output and suggest a change. This is the workflow with the clearest payoff.
Close the debug port when you finish
While port 9222 is open, any program on your machine can control the app. Restart TradingView normally when you are done.
Where it breaks
TradingView can change its internals in any release, and any tool in the server can stop working with no notice.
Live prices move faster than an agent can think, so its reasoning about a streaming chart is stale by the time it arrives. The research notes recommend sending streams to a dashboard for a human instead.
Financial screens are dense and labelled inconsistently. When Claude misreads an indicator table, the answer looks exactly as confident as when it reads it correctly. Fusion Markets warns about the same thing in its guide to connecting Claude and TradingView.
Claude can be confident and wrong. If an analysis confirms your existing view, it does not mean you should act without further scrutiny.
The open port is also a security hole while it lasts. The project’s security policy says to keep it on localhost, never expose it to your network, and check stream output before you send it to any outside service.
Who should use it
It fits you if you already pay for TradingView, already use a coding agent, and write Pine Script often enough that the compile-error loop wastes your evenings. It is also a good case study in how agents handle desktop apps, and the same approach works on any other Electron app.
Skip it if you want automated trading. It places no orders and says so in five separate places. Skip it too if you won’t pin an app version and fix a broken setup after the update that eventually breaks it.
The repository has about 5,400 stars and 2,400 forks, a lot of attention for a niche tool. A few of its numbers don’t match its own files:
| What you might read | What the files actually say |
|---|---|
| GitHub lists the licence as “Other” | The LICENSE file is plain MIT, plus a trademark notice covering TradingView and Anthropic |
| The API reports 169 open issues | Only 37 are issues; the other 132 are open pull requests |
| The tool reference heading counts 78 tools | The architecture section and the research notes both say 84 |
| “29 tests” sounds like broad coverage | They cover Pine analysis, compile checks and CLI routing, not chart control |
The licence is open, and the docs lag the code in a project its author calls a research experiment.
Use it as a Pine Script assistant that can also see your chart, and it earns its keep. Build anything you depend on around it, and the next TradingView release can take it down.
Botmonster Tech