TradingView MCP
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| TV_CDP_HOST | No | Host of the Chrome DevTools Protocol debug endpoint for TradingView Desktop. Keep the endpoint local (default 127.0.0.1). | 127.0.0.1 |
| TV_CDP_PORT | No | Port of the Chrome DevTools Protocol debug endpoint. Must match the port used by the TradingView Debug launcher (default 9222). | 9222 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
TradingView MCP — read and control a live TradingView Desktop chart.
TOOL SELECTION GUIDE — use this to pick the right tool:
Reading your chart:
chart_get_state → get symbol, timeframe, all indicator names + entity IDs (call first)
data_get_study_values → get current numeric values from ALL visible indicators (RSI, MACD, BB, EMA, etc.)
quote_get → get real-time price snapshot (last, OHLC, volume)
data_get_ohlcv → get price bars. ALWAYS pass summary=true unless you need individual bars
Reading custom Pine indicator output (line.new/label.new/table.new/box.new drawings):
data_get_pine_lines → horizontal price levels from custom indicators (deduplicated, sorted)
data_get_pine_labels → text annotations with prices ("PDH 24550", "Bias Long", etc.)
data_get_pine_tables → table data as formatted rows (session stats, analytics dashboards)
data_get_pine_boxes → price zones as {high, low} pairs
ALWAYS pass study_filter to target a specific indicator by name (e.g., study_filter="Profiler")
Indicators must be VISIBLE on chart for these to work
Changing the chart:
chart_set_symbol, chart_set_timeframe, chart_set_type → change ticker/resolution/style
chart_manage_indicator → add/remove studies. USE FULL NAMES: "Relative Strength Index" not "RSI"
chart_scroll_to_date → jump to a date (ISO format)
indicator_set_inputs → change indicator settings (length, source, etc.)
Pine Script development:
pine_set_source → inject code, pine_smart_compile → compile + check errors
pine_get_errors → read errors, pine_get_console → read log output
WARNING: pine_get_source can return 200KB+ for complex scripts — avoid unless editing
Screenshots: capture_screenshot → regions: "full", "chart", "strategy_tester" Replay: replay_start → replay_step → replay_trade → replay_status → replay_stop Batch: batch_run → run action across multiple symbols/timeframes Drawing: draw_shape → horizontal_line, trend_line, rectangle, text Alerts: alert_create, alert_list, alert_delete Launch: tv_launch → auto-detect and start TradingView with CDP on any platform Panes: pane_list, pane_set_layout (s, 2h, 2v, 4, 6, 8), pane_focus, pane_set_symbol Tabs: tab_list, tab_new, tab_close, tab_switch
CONTEXT MANAGEMENT:
ALWAYS use summary=true on data_get_ohlcv
ALWAYS use study_filter on pine tools when you know which indicator you want
NEVER use verbose=true unless user specifically asks for raw data
Prefer capture_screenshot for visual context over pulling large datasets
Call chart_get_state ONCE at start, reuse entity IDs
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| tv_health_checkB | Check CDP connection to TradingView and return current chart state |
| tv_discoverA | Report which known TradingView API paths are available and their methods |
| tv_ui_stateA | Get current UI state: which panels are open, what buttons are visible/enabled/disabled |
| tv_launchA | Launch TradingView Desktop with Chrome DevTools Protocol (remote debugging) enabled. Auto-detects install location on Mac, Windows, and Linux. |
| chart_get_stateA | Get current chart state (symbol, timeframe, chart type, indicators) |
| chart_set_symbolC | Change the chart symbol |
| chart_set_timeframeB | Change the chart timeframe/resolution |
| chart_set_typeC | Change chart type |
| chart_manage_indicatorC | Add or remove an indicator/study on the chart |
| chart_get_visible_rangeA | Get the visible date range (unix timestamps) and bars range on the chart |
| chart_set_visible_rangeB | Zoom the chart to a specific date range (unix timestamps) |
| chart_scroll_to_dateA | Jump the chart view to center on a specific date |
| symbol_infoA | Get detailed metadata about the current symbol (name, exchange, type, description) |
| symbol_searchB | Search for symbols by name or keyword |
| pine_get_sourceA | Get current Pine Script source code from the editor |
| pine_set_sourceC | Set Pine Script source code in the editor |
| pine_compileB | Compile / add the current Pine Script to the chart |
| pine_get_errorsB | Get Pine Script compilation errors from Monaco markers |
| pine_saveA | Save the current Pine Script (Ctrl+S) |
| pine_get_consoleB | Read Pine Script console/log output (compile messages, log.info(), errors) |
| pine_smart_compileB | Intelligent compile: detects button, compiles, checks errors, reports study changes |
| pine_newB | Create a new blank Pine Script |
| pine_openB | Open a saved Pine Script by name |
| pine_list_scriptsA | List saved Pine Scripts |
| pine_analyzeA | Run static analysis on Pine Script code WITHOUT compiling — catches array out-of-bounds, unguarded array.first()/last(), bad loop bounds, and implicit bool casts. Works offline, no TradingView connection needed. |
| pine_checkA | Compile Pine Script via TradingView's server API without needing the chart open. Returns compilation errors/warnings. Useful for validating code before injecting into the chart. |
| data_get_ohlcvA | Get OHLCV bar data from the chart. Use summary=true for compact stats instead of all bars (saves context). |
| data_get_indicatorC | Get indicator/study info and input values |
| data_get_strategy_resultsA | Get strategy performance metrics from Strategy Tester. Auto-opens the panel and auto-unhides a hidden strategy (TradingView never computes reports for hidden strategies); result includes unhidden_strategies when that happened. |
| data_get_tradesA | Get trade list from Strategy Tester. Auto-opens the panel and auto-unhides a hidden strategy. |
| data_get_equityA | Get equity curve data from Strategy Tester |
| quote_getA | Get real-time quote data for a symbol (price, OHLC, volume). If symbol is provided and differs from the current chart, the chart is briefly switched to fetch the quote and then restored — adds ~1-2s and serializes parallel calls. |
| depth_getA | Get order book / DOM (Depth of Market) data from the chart |
| data_get_pine_linesA | Read horizontal price levels drawn by Pine Script indicators (line.new). Returns deduplicated price levels per study. Use study_filter to target a specific indicator. |
| data_get_pine_labelsA | Read text labels drawn by Pine Script indicators (label.new). Returns text and price pairs. Use study_filter to target a specific indicator. |
| data_get_pine_tablesA | Read table data drawn by Pine Script indicators (table.new). Returns formatted text rows per table. Use study_filter to target a specific indicator. |
| data_get_pine_boxesA | Read box/zone boundaries drawn by Pine Script indicators (box.new). Returns deduplicated {high, low} price zones. Use study_filter to target a specific indicator. |
| data_get_study_valuesA | Get current indicator values from the data window for all visible studies (RSI, MACD, Bollinger Bands, EMAs, custom indicators with plot()). |
| capture_screenshotB | Take a screenshot of the TradingView chart |
| draw_shapeC | Draw a shape/line on the chart |
| draw_listA | List all shapes/drawings on the chart |
| draw_clearA | Remove all drawings from the chart |
| draw_remove_oneA | Remove a specific drawing by entity ID |
| draw_get_propertiesA | Get properties and points of a specific drawing |
| alert_createA | Create a price alert on the current chart symbol via TradingView's alert API |
| alert_listA | List active alerts |
| alert_deleteA | Delete a specific alert by id, or all active alerts |
| batch_runB | Run an action across multiple symbols and/or timeframes |
| replay_startB | Start bar replay mode, optionally at a specific date |
| replay_stepA | Advance one bar in replay mode |
| replay_autoplayA | Toggle autoplay in replay mode, optionally set speed |
| replay_stopA | Stop replay and return to realtime |
| replay_tradeB | Execute a trade action in replay mode (buy, sell, or close position) |
| replay_statusA | Get current replay mode status |
| indicator_set_inputsB | Change indicator/study input values (e.g., length, source, period) |
| indicator_toggle_visibilityB | Show or hide an indicator/study on the chart |
| watchlist_getA | Get all symbols from the current TradingView watchlist with last price, change, and change% |
| watchlist_addB | Add a symbol to the TradingView watchlist |
| ui_clickB | Click a UI element by aria-label, data-name, text content, or class substring |
| ui_open_panelB | Open, close, or toggle TradingView panels (pine-editor, strategy-tester, watchlist, alerts, trading) |
| ui_fullscreenA | Toggle TradingView fullscreen mode |
| layout_listB | List saved chart layouts |
| layout_switchA | Switch to a saved chart layout by name or ID |
| ui_keyboardB | Press keyboard keys or shortcuts (e.g., Enter, Escape, Alt+S, Ctrl+Z) |
| ui_type_textA | Type text into the currently focused input/textarea element |
| ui_hoverA | Hover over a UI element by aria-label, data-name, or text content |
| ui_scrollB | Scroll the chart or page up/down/left/right |
| ui_mouse_clickB | Click at specific x,y coordinates on the TradingView window |
| ui_find_elementA | Find UI elements by text, aria-label, or CSS selector and return their positions |
| ui_evaluateB | Execute JavaScript code in the TradingView page context for advanced automation |
| pane_listA | List all chart panes in the current layout with their symbols and active state |
| pane_set_layoutB | Change the chart grid layout (e.g., single, 2x2, 2h, 3v) |
| pane_focusA | Focus a specific chart pane by index (0-based) |
| pane_set_symbolB | Set the symbol on a specific pane by index |
| tab_follow_visibleA | Attach this MCP connection to the visible TradingView tab without activating a tab or changing its chart. Call between operations, never during a bound drawing run. |
| tab_listA | List all open TradingView chart tabs |
| tab_newB | Open a new chart tab |
| tab_closeA | Close the current chart tab |
| tab_switchB | Switch to a chart tab by index |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 79 tools
Most domain prefixes (chart_, pine_, replay_, alert_) carve out distinct areas, but several clusters overlap heavily: ui_click vs ui_mouse_click vs ui_hover vs ui_find_element, ui_keyboard vs ui_type_text, and four compile/validate tools (pine_compile, pine_smart_compile, pine_check, pine_analyze) whose boundaries are only explained in prose. chart_scroll_to_date vs chart_set_visible_range and tab_follow_visible vs tab_switch also require reading descriptions to choose correctly.
Nearly every tool is prefixed by its domain (data_, draw_, alert_, replay_, ui_, pane_, tab_, chart_, pine_), making grouping predictable. Ordering within the prefix varies (chart_get_state vs draw_shape vs alert_create vs capture_screenshot), but the convention remains readable and no chaotic mixing of camelCase/snake_case occurs.
79 tools is far beyond a well-scoped set even for a broad desktop-automation domain; many low-level UI primitives (ui_mouse_click, ui_scroll, ui_hover, ui_evaluate) arguably belong behind a single generic action tool. The count forces agents to scan a large, flat surface for routine operations.
Coverage is deep across chart control, Pine scripting, data extraction, replay, alerts, layouts, panes, and watchlists, so core workflows have no dead ends. Minor gaps remain (no watchlist_remove or alert_update, no layout save/delete, no cleanup for panes/scripts), but agents can work around them via ui_evaluate.