← Back to directory
T

TradingView MCP Bridge

Community
AI-assisted TradingView chart analysis and Pine Script development via Chrome DevTools Protocol
GitHub source repository ↗
★ 5.9k Stars Category · Other Very popular Source revision c05b8f5755ed
53FMRS · D
Reliability
8/20
Security and permissions
11/20
Maintenance
9/20
Documentation
14/20
Setup experience
11/20

An open-source, personal-use bridge that lets Claude and other AI assistants read and control a locally running TradingView Desktop chart via the standard Chrome DevTools Protocol — covering chart reading, Pine Script development, drawings/alerts, multi-pane layouts, and replay mode. It performs no real trade execution and never contacts TradingView's servers, but it depends on undocumented internal interfaces and places Terms-of-Use compliance risk on the user.

Read the FMRS scoring method →

TradingView MCP Bridge is a personal-use bridge that connects to a user's locally running TradingView Desktop application over the Chrome DevTools Protocol (CDP, port 9222), letting Claude Code and other AI assistants read chart state, indicator values, and Pine-drawn overlays, and control the chart (change symbol/timeframe, draw annotations, manage alerts, arrange multi-pane layouts, step through replay mode, etc.). All processing happens locally; the server never talks to TradingView's servers and does not bypass any paywall. It requires a valid TradingView subscription, an installed Desktop app, and the app to be manually launched in debug mode. It relies on undocumented internal TradingView interfaces that can break with app updates.

Tools

chart_get_state
Get the current symbol, timeframe, and names/IDs of all loaded indicators (recommended first call)
data_get_study_values
Read current RSI, MACD, Bollinger Bands, EMA, etc. indicator values
quote_get
Get the latest price, OHLC, and volume
data_get_ohlcv
Get price bar data; use summary mode for compact stats
data_get_pine_lines
Read horizontal price levels drawn by Pine indicators (support/resistance, session levels)
data_get_pine_labels
Read text annotations and their prices from Pine indicators
data_get_pine_tables
Read data tables produced by Pine indicators (session stats, analytics dashboards)
data_get_pine_boxes
Read price zones/ranges drawn by Pine indicators
chart_set_symbol
Change the chart ticker (e.g. BTCUSD, AAPL, ES1!)
chart_set_timeframe
Change the chart resolution (1, 5, 15, 60, D, W, M)
chart_set_type
Change chart style (Candles, HeikinAshi, Line, Area, Renko)
chart_manage_indicator
Add or remove indicators (use the full indicator name)
chart_scroll_to_date
Jump the chart to a given ISO date
chart_set_visible_range
Zoom to an exact visible range by unix timestamps
symbol_info
Get symbol metadata
symbol_search
Search for symbols
indicator_set_inputs
Change an indicator's input settings
indicator_toggle_visibility
Show or hide an indicator
pane_list
List all panes with their symbols and active state
pane_set_layout
Change the pane grid layout (e.g. 2x2, 4, 6, 8)
pane_focus
Focus a specific pane by index
pane_set_symbol
Set the symbol on a given pane
tab_list
List open chart tabs
tab_new
Open a new chart tab
tab_close
Close a chart tab
tab_switch
Switch to a tab by index
pine_set_source
Inject Pine Script code into the editor
pine_smart_compile
Compile Pine Script with auto-detection and error checking
pine_get_errors
Read Pine Script compilation errors
pine_get_console
Read log.info() console output
pine_save
Save the current script to TradingView's cloud
pine_get_source
Read the current script source (can exceed 200KB for complex scripts)
pine_new
Create a blank indicator/strategy/library script
pine_open
Open a saved script
pine_list_scripts
List saved scripts
pine_analyze
Run offline static analysis on Pine Script (no chart required)
pine_check
Run a server-side compile check (no chart required)
replay_start
Enter replay mode at a given date
replay_step
Advance replay by one bar
replay_autoplay
Auto-advance replay at a configured speed
replay_trade
Buy/sell/close positions in replay mode
replay_status
Check replay position, P&L, and date
replay_stop
Exit replay and return to realtime
draw_shape
Draw a horizontal line, trend line, rectangle, or text annotation
draw_list
List existing drawings
draw_remove_one
Remove a single drawing
draw_clear
Clear all drawings
alert_create
Create a price alert
alert_list
List existing alerts
alert_delete
Delete an alert
capture_screenshot
Capture the chart state (regions: full, chart, strategy_tester)
batch_run
Run an action across multiple symbols/timeframes
watchlist_get
Read the watchlist
watchlist_add
Add a symbol to the watchlist
layout_list
List saved layouts
layout_switch
Switch to a saved layout
ui_open_panel
Open a UI panel (UI automation)
ui_click
Simulate a click on a UI element
ui_evaluate
Evaluate a custom script in the page context
tv_launch
Auto-detect and launch TradingView Desktop in debug mode
tv_health_check
Verify the connection to TradingView Desktop is working
tv_discover
Discover available local TradingView instances/interfaces

Setup

  1. Make sure Node.js 18+ is installed and you have a valid TradingView subscription plus the Desktop app. 2. Clone the repo and install dependencies: git clone https://github.com/tradesdontlie/tradingview-mcp.git && cd tradingview-mcp && npm install. 3. Launch TradingView Desktop in debug mode using the platform launch script (Mac/Windows/Linux) or manually with --remote-debugging-port=9222, or ask the tv_launch tool to auto-detect and start it. 4. Add the server to your Claude Code MCP config (~/.claude/.mcp.json or a project .mcp.json) with command: node and args pointing at the local path to src/server.js. 5. Ask Claude to call tv_health_check to confirm the connection.
claude_desktop_config.json
{"mcpServers":{"tradingview":{"command":"node","args":["/path/to/tradingview-mcp/src/server.js"]}}}

Fit and risk

Best for

  • Individual traders/researchers with a paid TradingView subscription who run TradingView Desktop
  • Developers who want AI assistance writing and debugging Pine Script
  • Researchers studying human-AI collaboration on professional financial interfaces
  • Claude Code users who want chart automation on their own machine

Not for

  • Use cases requiring TradingView's official APIs or cloud services
  • Automated trading bots or algorithmic order execution
  • Commercial redistribution or resale of TradingView market data
  • Users without a paid TradingView subscription or the Desktop app installed
  • Production environments needing a stable, officially supported API rather than an undocumented interface that can break on updates

Required permissions

  • Requires TradingView Desktop to be explicitly launched with `--remote-debugging-port=9222`, opening a local debug port
  • Requires Node.js 18+ and local filesystem access to clone and run the MCP server
  • Requires an active, logged-in TradingView subscription
  • The MCP server itself communicates with Claude Code over stdio and is not exposed to the network

Risks and side effects

  • Relies on undocumented internal TradingView Electron/CDP interfaces that can change or break without notice on updates
  • Opening the local debug port means other processes on the same machine could theoretically access it
  • Automated reading/processing of TradingView data may conflict with TradingView's Terms of Use restrictions on automated data collection — usage compliance is the user's responsibility
  • Not affiliated with or supported by TradingView Inc., so long-term compatibility is not guaranteed
  • The README explicitly warns against redistributing data or circumventing paywalls; misuse could risk account suspension

Troubleshooting

  1. If the connection fails, confirm TradingView Desktop was launched via the platform script or with `--remote-debugging-port=9222`
  2. Call `tv_health_check` or run `tv status` from the CLI to check connection status
  3. Verify the `args` path in your Claude Code MCP config correctly points to the cloned `src/server.js`
  4. Confirm Node.js is version 18 or newer
  5. Check that port 9222 isn't blocked by a firewall or already in use by another process
  6. If things break after a TradingView update, check whether its internal Electron structure changed and consider pinning an older TradingView version

Use cases

Have an AI assistant read and interpret current chart indicator values, price levels, and annotations
Write, inject, compile, and debug Pine Script indicators or strategies with Claude's help
Change symbols, timeframes, chart type, and indicators via natural language
Draw trend lines, horizontal lines, and rectangles on the chart, and manage price alerts
Set up multi-pane grid layouts to monitor several symbols at once
Practice entries/exits by stepping through historical bars in replay mode
Stream chart data as JSONL to local monitoring scripts

Supported clients

Claude CodeFull support