Skip to main content
Glama
TVControl

TVControl

by FerroxLabs

TVControl

TradingView MCP System · by Ferrox Labs

Tell your AI what you want from your TradingView chart. Watch it happen on screen.

TVControl turns your TradingView Desktop into something you can talk to. You type a sentence ("summarise this chart", "sweep this strategy across SPY, QQQ and IWM on 5m and 15m", "step through last March bar by bar and call out the breakout") and the AI reads, clicks, types, compiles and screenshots inside the actual TradingView app on your machine. No copy-paste and no TVControl-operated cloud backend. TradingView Desktop and explicitly selected public-API helpers still communicate with TradingView as documented.

It works because every Chromium app, TradingView Desktop included, ships with a built-in debugging interface (the same one Chrome uses to debug itself). TVControl speaks that interface on your behalf, exposing 113 chart-control and diagnostic tools to any agent that speaks the Model Context Protocol. It is client-neutral: anything that can launch an MCP server over stdio works, and it is in daily use across several. Pair-program in Pine Script. Optimize parameter grids. Snapshot and restore whole chart setups. Drive 4-pane layouts. Step through replay. Scan a watchlist. All by speech-to-action.

113 MCP tools · 938 deterministic offline tests · 10 verify scripts · 9 prompt-library workflows · no TVControl cloud backend. Everything in this repo is real, tested, and used daily.

What is new in 2.5

The 2.5 line is about one thing: a tool must build its answer from an independent read, never from the request or from the response of the thing it just did. Every fix below is a place where that was not true.

  • A result you can act on when a call times out. chart_set_symbol and chart_set_timeframe had already applied the change by the time their readiness wait expired, then threw as though nothing had happened, so a caller that retried applied it twice. They now return chart_ready: false and say not to retry. indicator_add_from_search polls for the study instead of sleeping 1500ms and guessing. The contract is now stated in the tool descriptions: a thrown error means nothing changed.

  • pine_open no longer risks the wrong script. It fetched a script's source and pasted it into whatever buffer was open, leaving the editor bound to the previous script while reporting success. A following save wrote over the wrong file. It now reads the editor's own title back and refuses on a mismatch. New in this release: pine_get_script_source reads a saved script over the REST API without touching the editor at all, which is what you want for comparing a saved script against a local file.

  • Screenshots are refused rather than stale. A hidden tab returns the last frame Chromium painted for it: a real PNG of the right chart showing the wrong data, with the clock still ticking in the corner. capture_screenshot now requires a visible tab, and region: "chart" captures the active pane instead of whichever pane happened to be first in the DOM.

  • replay_start will not quietly move your date. A date outside a symbol's replay depth was relocated silently, so every read afterwards was correct for a date nobody asked for. It now refuses, stops replay, and tells you where the cursor would have landed.

  • tab_close explains the dialog that is blocking it. TradingView's unsaved-changes prompt is its own debug target, invisible to every selector the chart page can run, so the old failure read like a bug in tab handling. It is now found and named, and discard_unsaved: true answers it. "Save and close" is never clicked for you.

  • draw_shape refuses a shape name it does not recognise instead of silently drawing a flag and echoing back the name you asked for.

  • The CLI can reach every safety guard the MCP tools expose. Three of them were refusals whose own hint named a flag the CLI did not have.

  • The server starts even when it cannot read its own files. Under restrictive install directories (Windows Program Files with Controlled Folder Access), a startup scan of its own tool directory threw before the server existed, and every client saw a bare Connection closed. Both startup reads now fail soft onto a catalog generated at publish time, and say so on stderr.

  • A contract for embedding TVControl in a desktop app ships in the package: docs/EMBEDDING.md. Read it before bundling this inside a host application.

See the changelog and upgrade guide.


Related MCP server: TradingView MCP Jackson

What it actually does (with prompts that work)

Paste any of these into your MCP client once TVControl is wired up. Nothing here is specific to one agent.

Read your chart in one prompt.

Use chart_vision_read to summarise my chart: symbol, timeframe, last price, visible indicators with their current values, custom Pine levels and labels, and the last 100-bar move.

A single tool call returns symbol, timeframe, indicator values, custom Pine drawings, OHLCV summary, and a screenshot. Roughly 5 to 10 KB back instead of ~80 KB across five separate calls.

Pair-program in Pine Script.

Write me a Pine v6 indicator that plots a 20-period EMA in blue and a 50-period EMA in orange, then compile it on my chart. Fix any errors. Save it as "EMA Cross".

Inject, server-side compile, read errors, fix, save. The compiler errors come back to the agent directly, so iteration is seconds, not minutes.

Optimize a parameter grid.

Use strategy_sweep to test my current strategy across [SPY, QQQ, IWM] on 5 and 15 with length of 10, 14, 20 and multiplier of 1.5, 2, 2.5. Rank by net profit.

Cartesian product, 24h-TTL disk cache (re-runs are near-instant), optional parallelism: N worker tabs, resume-from-partial. Caps at 500 combinations.

Snapshot a setup. Restore it later.

Snapshot my current chart as "morning-prep". Switch to BTCUSDT 4h with VWAP and Bollinger Bands. Done? Restore "morning-prep".

Captures symbol, timeframe, all studies and their inputs, drawings, and the full metaInfo blob for published Pine, even ones that normally won't reload.

Practice with replay.

Start replay at 2025-03-10 09:30 ET. Step through the open. Call out any breakouts on the 1-min and simulate the entry. Show me the running P&L.

Scan a watchlist.

For every symbol in my watchlist, take a 1-day chart screenshot, read the RSI(14), and rank by overbought-to-oversold.

Alert on everything you watch, without setting them one at a time.

Set an alert 5% above the last price on every symbol in my watchlist, all pointing at https://my-app.example/tv-hook, on bar close, 1h. Show me the dry run first.

One call. alert_create_bulk reads your active watchlist, prices each alert off that symbol's own last trade, and verifies the whole batch with a single read of the alert list afterwards. Everything lands on your webhook, so the filtering, grouping and deduping happen in your code rather than in your inbox.

The full prompt library (every workflow above plus chart analysis, watchlist and alerts, screening, and agent prompting tips) lives in examples/prompts/. Nine files. Copy-pasteable.


How it stays grounded (the proof)

This isn't a demo. It ships with a test battery.

  • 938 offline tests: Pine analyzer, sanitization, replay, pane and indicator boundaries, watchlist, alerts, state snapshots, sweep planning, vision wrapper, telemetry, capability gating, privacy-safe bundles, chaos cleanup, soak bounds, golden workflows, native watchdog services, startup resilience, embedding contract, CLI/MCP guard parity, update safety, tool registration, and CLI routing. Live Pine-service checks are isolated in tests/pine_api.test.js.

  • Mutation-tested, not just green. A test that cannot fail is worse than no test, because it turns an unknown into false confidence. Fixes in this project are checked by reintroducing the bug and confirming the suite goes red. Where behaviour lives in page-side JavaScript, the tests execute that generated code against a stub DOM rather than describing it in a mock.

  • The suite has a floor. A run that reports fewer tests than expected fails, so tests cannot silently disappear from a green run.

  • 10 end-to-end verify scripts under examples/verify/ that drive the same MCP tools through the tv CLI against a live TradingView. Run examples/verify/run-all.sh and it auto-skips when TV isn't up.

  • GitHub Actions CI runs lint, offline tests, dependency audit, and package checks on Node 18 and 22 across Linux, macOS, and Windows.

  • CDP smoke (scripts/smoke.sh): live connection sanity check against your local TradingView.

npm test                                    # offline suite
./examples/verify/00-verify-install.sh      # offline install check
./examples/verify/run-all.sh                # full live battery

If your version of TradingView reshapes some internal API, the verify battery is how you'll know within seconds.


Quick starts

Install the current public release from npm:

npm install -g @ferroxlabs/tvcontrol
tv --help

The package installs both tv and tvcontrol. For MCP-server configuration, use the installed src/server.js or one of the repository paths below.

Path A. Let your agent install it

Paste this into any coding agent that can edit files and run commands, and let it do the rest.

Install the TVControl MCP server. Clone https://github.com/ferroxlabs/tvcontrol.git into ~/tvcontrol, run npm install, register it in my MCP client config as a server named tvcontrol running node ~/tvcontrol/src/server.js, then call tv_launch to start TradingView in debug mode and tv_health_check to confirm the connection.

It will clone, install, register the server, and verify. Restart your client when it finishes so the new MCP server loads.

Path B. Manual, any MCP client

# 1. Clone and install
git clone https://github.com/ferroxlabs/tvcontrol.git
cd tvcontrol
npm install

# 2. Launch TradingView with the debug port enabled (one-time, per platform)
./scripts/launch_tv_debug_mac.sh        # macOS
./scripts/launch_tv_debug_linux.sh      # Linux
scripts\launch_tv_debug.bat             # Windows

# Or by hand on any platform:
/path/to/TradingView --remote-debugging-port=9222

On Windows Store/MSIX installations, tv_launch also detects the package with Get-AppxPackage. If Windows blocks CDP from the protected WindowsApps directory, it launches a versioned local copy under %LOCALAPPDATA%\tvcontrol\desktop-cache and reports msix_local_copy: true.

Then add this to your MCP client's config file, replacing the path with your own absolute path. Every MCP client uses the same shape; only the file location differs, and your client's documentation names it.

{
  "mcpServers": {
    "tvcontrol": {
      "command": "node",
      "args": ["/absolute/path/to/tvcontrol/src/server.js"]
    }
  }
}

Restart your client. A copy-pasteable example config lives at examples/mcp-config.example.json, including a variant with an absolute path to node for the case where your client launches servers without your shell's PATH.

Bundling TVControl inside a desktop application? Read docs/EMBEDDING.md first. It is the spawn contract, and it exists because the two ways an embed fails both happen before the server can emit a single message, so neither can report itself.

Verify with:

Use tv_health_check, then chart_vision_read to summarise my chart.

If you get back a paragraph describing your actual chart, you're up.

Path C. CLI only (no agent required)

Every MCP tool is also a tv command, JSON-out, jq-friendly. Skip the AI client entirely if you just want a programmable handle on your TradingView.

git clone https://github.com/ferroxlabs/tvcontrol.git
cd tvcontrol
npm install
npm link                          # optional: puts `tv` on your PATH

# launch TV with debug port (see Path B), then:
tv status                         # connection check
tv quote                          # latest price
tv ohlcv --summary                # compact stats
tv pine compile                   # compile current Pine on chart
tv stream quote | jq '.close'     # tick-by-tick price stream

Examples directory map

Each prompt file lists the tools that fire, what to expect, and the common gotchas, so you can read it like a runbook before you paste, or pull it into your own automation.


CLI surface

tv status / launch / state / symbol / timeframe / type / info / search
tv quote / ohlcv / values
tv data lines / labels / tables / boxes / strategy / trades / equity / depth / indicator
tv pine get / set / source / compile / analyze / check / save / new / open / list / errors / console
tv draw shape / list / get / remove / clear
tv alert list / create / delete
tv watchlist get / add / remove / export / import
tv indicator add / remove / toggle / set / get
tv layout list / switch
tv pane list / layout / focus / symbol
tv tab list / new / close / switch
tv replay start / step / stop / status / autoplay / trade
tv stream quote / bars / values / lines / labels / tables / all
tv ui click / keyboard / hover / scroll / find / eval / type / panel / fullscreen / mouse
tv screenshot / discover / ui-state / range / scroll
tv capabilities / support
tv chaos / soak / golden
tv compatibility / watchdog sample / watchdog history / watchdog service-plan

All commands return JSON. Core chart-control tools have CLI counterparts; long-running or disruptive reliability runners are deliberately CLI-first.

Reliability toolkit

The compatibility layer checks the TradingView APIs required by each tool before execution. A tool is blocked only when the live canary explicitly confirms a required API is absent; if the canary itself is unavailable, recovery tools are still allowed to run.

tv capabilities                       # per-tool live capability matrix
tv support                            # redacted .json.gz support bundle
tv chaos                              # dry-run fault plan
tv chaos --allow-live-faults          # bounded disconnect/stall/tab recovery checks
tv soak --duration-ms 3600000         # health + stream + watchdog soak
tv golden                             # six receipt-producing live workflows
tv watchdog service-plan              # native service definition, no changes
tv watchdog install --apply           # launchd/systemd-user/Task Scheduler

Chaos is dry-run unless --allow-live-faults is present. Restore/sweep soak scenarios and snapshot/replay golden checks require --allow-mutations. Watchdog install and uninstall are dry-run unless --apply is present. Receipts are bounded and omit symbols, URLs, account-linked identifiers, source code, and raw error messages.


Streaming

tv stream polls your local TradingView Desktop over CDP and emits JSONL. TVControl has no streaming cloud backend; TradingView Desktop continues to communicate with TradingView normally.

tv stream quote                          # tick-by-tick price
tv stream bars                           # bar-by-bar updates
tv stream values                         # indicator values
tv stream lines --filter "NY Levels"     # custom Pine levels
tv stream tables --filter Profiler       # Pine table rows
tv stream all                            # all panes at once
WARNING

Programmatic consumption of TradingView data may conflict with their Terms of Use regardless of how it's accessed. You are solely responsible for compliance.


Architecture

AI Agent  <->  MCP Server (stdio)  <->  CDP (localhost:9222)  <->  TradingView Desktop (Electron)
  • Transport: MCP over stdio plus a tv CLI exposing the same surface.

  • Connection: Chrome DevTools Protocol on localhost:9222.

  • Streaming: poll-and-diff loop with deduplication, JSONL on stdout.

  • Runtime deps: @modelcontextprotocol/sdk, chrome-remote-interface. That's it.

The full per-tool decision tree (which tool to call for which question) lives in CLAUDE.md. The filename is a convention some clients load automatically; the content is plain Markdown and is worth reading whichever agent you use, or pasting into its own instructions file.


How this stays safe to run

  • The debug port is off in TradingView until you enable it via the standard --remote-debugging-port=9222 flag.

  • TVControl's chart-control path speaks CDP to the Electron app already running on your machine. TradingView Desktop and explicitly documented public helpers still communicate with TradingView.

  • TVControl does not operate a cloud backend. Local snapshots, telemetry, reliability receipts, and support bundles are written only when their corresponding features are used.

  • No real trades are executed. Chart, drawings, indicators, and Pine code only.

  • TV_MCP_READONLY=1 registers only the tools that cannot change your TradingView state. For unattended use (a scheduled morning brief, a cron job, a CI agent) where nobody is there to approve a call. An MCP grant is server-level, so a host that can reach TVControl can reach every tool it registers; under this flag the mutating ones are never registered, so calling one is an unknown-tool error rather than a promise the model is asked to keep. Reads, diagnostics, screenshots and chart navigation (symbol, timeframe, range, pane/tab/layout switching) stay available; watchlist edits, alert create/delete, drawing writes, indicator changes, Pine saves, replay, state_restore and tv_launch do not. ui_evaluate stays off even if TV_MCP_ADVANCED=1 is also set.

The same CDP interface is built into every Chromium app: VS Code, Slack, Discord, Chrome itself. It's not a side door; it's the standard debugging interface Google ships with the runtime.


Compatibility

  • TVControl talks to undocumented internal TradingView APIs through the Electron debug interface. Those can change in any TradingView update without notice. Pin your TradingView Desktop version if stability matters to you.

  • Tested on macOS, Windows, and Linux at release time.

  • Requires Node.js 18.14.1 or newer.


Disclaimer

This project is provided for personal, educational, and research purposes only.

By using this software, you acknowledge that:

  1. You are solely responsible for ensuring your use complies with TradingView's Terms of Use and all applicable laws.

  2. TradingView's Terms of Use restrict automated data collection, scraping, and non-display usage of their platform and data. TVControl uses Chrome DevTools Protocol to programmatically interact with the TradingView Desktop app, which may conflict with those terms.

  3. You assume all risk. Ferrox Labs and its contributors are not responsible for account bans, suspensions, legal actions, or any consequences resulting from use of this tool.

  4. This tool must not be used for: redistributing or commercially exploiting TradingView's market data; circumventing TradingView's access controls or paywalls; performing automated live trading; or violating intellectual property rights of Pine Script authors.

  5. Streaming functionality polls only your local TradingView Desktop instance; the Desktop app remains responsible for its normal TradingView network connection.

  6. Market data accessed through this tool remains subject to exchange and provider licensing terms. Do not redistribute, store, or commercially exploit it.

TVControl is not affiliated with, endorsed by, or associated with TradingView Inc. TradingView is a trademark of TradingView Inc.

If you are unsure whether your intended use complies with TradingView's terms, do not use TVControl.


Acknowledgements

TVControl began as a fork of tradingview-mcp by tradesdontlie. That project established the core CDP-bridge approach and the original tool surface, and proved the whole "drive TradingView Desktop from an MCP agent" pattern was viable.

TVControl builds on that foundation with full state snapshot and restore (including the metaInfo blob for published Pine), Cartesian strategy sweeps with disk memoization and parallel worker tabs, the combined chart_vision_read one-shot, classified-error handling with remediation hints, opt-in JSONL telemetry, capability-aware runtime gates, privacy-safe diagnostics, watchdog services, chaos/soak/golden verification, an expanded offline test battery, end-to-end verify scripts, cross-platform GitHub Actions CI, and a curated prompt library.

Credit for the groundwork belongs to the upstream author. If you came here looking for the original, that's right here.


License

MIT. See LICENSE.

The MIT license applies to the source code of this project only. It does not grant rights to TradingView's software, data, trademarks, or other intellectual property.


Available Tools

113 tools
alert_createB

Create a price alert on the current chart using TradingView's authenticated alert API

Inputs: price (required), condition (required), message, frequency, +3 more.

alert_create_bulkA

Create price alerts across MANY symbols, or the whole watchlist, in one call. Does NOT touch the chart. Each alert can carry a webhook URL so every fire posts to your own endpoint instead of your inbox. Use percent_from_last to set a level per symbol from its live price, which is the only thing that makes sense across a mixed watchlist.

Inputs: price, dry_run, message, symbols, +6 more.

alert_deleteC

Delete all alerts or open context menu for deletion

Inputs: alert_id, alert_ids, delete_all.

alert_delete_by_idA

Delete a single alert by ID

Inputs: alert_id (required).

alert_listA

List active alerts

Inputs: no named parameters.

batch_runB

Run an action across multiple symbols and/or timeframes

Inputs: action (required), symbols (required), delay_ms, entity_id, +4 more.

capture_screenshotA

Take a screenshot of the TradingView chart. REFUSES on a hidden tab, because a hidden tab returns the last frame it painted - a real PNG of the right chart showing stale data. region:"chart" captures the ACTIVE pane and reports which selector found it.

Inputs: method, region, filename, allow_hidden, +1 more.

chart_get_stateA

Get current chart state (symbol, timeframe, chart type, indicators)

Inputs: no named parameters.

chart_get_visible_rangeA

Get the visible date range (unix timestamps) and bars range on the chart

Inputs: no named parameters.

chart_manage_indicatorB

Add or remove an indicator/study on the chart

Inputs: action (required), inputs, entity_id, indicator.

chart_scroll_to_dateA

Jump the chart view to center on a specific date

Inputs: date (required).

chart_set_symbolC

Change the chart symbol

Inputs: symbol (required).

chart_set_timeframeB

Change the chart timeframe/resolution

Inputs: timeframe (required).

chart_set_typeC

Change chart type

Inputs: chart_type (required).

chart_set_visible_rangeB

Zoom the chart to a specific date range (unix timestamps)

Inputs: to (required), from (required).

chart_vision_readA

Take a screenshot and read all chart data in one call (quote, indicators, Pine graphics, OHLCV). Returns mixed content: inline image when <= max_image_bytes, else file_path only.

Inputs: include, study_filter, max_image_bytes.

data_get_equityA

Get equity curve data from Strategy Tester. Pass entity_id when more than one strategy is loaded.

Inputs: entity_id.

data_get_indicatorC

Get indicator/study info and input values

Inputs: entity_id (required).

data_get_ohlcvA

Get OHLCV bar data from the chart. Use summary=true for compact stats instead of all bars (saves context).

Inputs: count, summary.

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.

Inputs: verbose, study_filter.

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.

Inputs: verbose, max_labels, study_filter.

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.

Inputs: verbose, study_filter.

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.

Inputs: study_filter.

data_get_strategy_resultsA

Get strategy performance metrics. Pass entity_id when more than one strategy is loaded. Auto-opens Strategy Tester and unhides the selected strategy so TradingView computes its report.

Inputs: entity_id.

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()).

Inputs: no named parameters.

data_get_tradesA

Get the most recent strategy orders. Pass entity_id when more than one strategy is loaded. Auto-opens Strategy Tester and unhides the selected strategy.

Inputs: entity_id, max_trades.

depth_getA

Get order book / DOM (Depth of Market) data from the chart

Inputs: no named parameters.

draw_clearA

Remove ALL drawings from the ACTIVE PANE. On a multi-pane layout this is NOT the whole chart: use pane_list to see the panes and pane_focus to pick one first. DESTRUCTIVE and there is no undo through this API: every trendline, level and annotation on the active chart is deleted, not just ones you added. Use draw_remove_one with an entity_id to remove a single drawing.

Inputs: no named parameters.

draw_get_propertiesA

Get properties and points of a specific drawing

Inputs: entity_id (required).

draw_listA

List shapes/drawings on the ACTIVE PANE ONLY. On a multi-pane layout the other panes are not included and a count of 0 does NOT mean the chart is empty: use pane_list to see every pane and pane_focus to switch.

Inputs: no named parameters.

draw_remove_oneA

Remove a specific drawing by entity ID

Inputs: entity_id (required).

draw_shapeA

Draw a shape/line on the chart. The created shape name is read back and an unrecognised name is REFUSED rather than silently becoming a flag.

Inputs: point (required), shape (required), text, point2, +1 more.

indicator_get_inputsA

Read a study's current input values back. Use this to confirm indicator_set_inputs landed, to detect settings changed by hand, or to record the configuration a result was produced under.

Inputs: entity_id (required).

indicator_set_inputsB

Change indicator/study input values (e.g., length, source, period)

Inputs: inputs (required), entity_id (required).

indicator_toggle_visibilityA

Show, hide, or flip an indicator on the chart. Omit visible to toggle. Confirms the result by reading the study back rather than trusting setVisible().

Inputs: entity_id (required), visible.

layout_createA

Create a NEW chart and save it under this name. Use this to build a user a chart from scratch - layout_list and layout_switch can only reach layouts that already exist. The new chart starts empty: add studies with indicator_add_from_search and set the timeframe, then call layout_save again to keep them. Verified by re-reading the account, not by the return value.

Inputs: name (required).

layout_get_activeA

Which saved layout the attached chart is currently showing. Use it to confirm a layout switch landed, to detect that the user has moved since a setup was saved, and to state which chart a reading describes.

Inputs: no named parameters.

layout_listB

List saved chart layouts with bounded pagination

Inputs: limit, offset, include_details.

layout_saveA

Save the current chart layout silently, with no Save-As dialog. Pass name to save it under that name - that is what names a layout, not layout_create. Call this after changing symbol, timeframe or studies so the layout keeps them. Verifies the account lists it rather than trusting the save.

Inputs: name.

layout_switchA

Switch to a saved chart layout by name or ID. Stops rather than discarding unsaved changes on the current chart unless discard_unsaved is set.

Inputs: name (required), discard_unsaved.

pane_focusB

Focus a specific chart pane by index (0-based)

Inputs: index (required).

pane_listA

List all chart panes in the current layout with their symbols and active state

Inputs: no named parameters.

pane_set_layoutB

Change the chart grid layout (e.g., single, 2x2, 2h, 3v)

Inputs: layout (required).

pane_set_symbolB

Set the symbol on a specific pane by index

Inputs: index (required), symbol (required).

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.

Inputs: source (required).

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.

Inputs: source (required).

pine_compileA

Compile the current Pine Script and add it to the chart. WARNING: this SAVES first, clicking Save and add to chart, which persists the current editor buffer to the saved script it is bound to.

Inputs: no named parameters.

pine_get_consoleB

Read Pine Script console/log output (compile messages, log.info(), errors)

Inputs: no named parameters.

pine_get_errorsB

Get Pine Script compilation errors from Monaco markers

Inputs: no named parameters.

pine_get_script_sourceA

Read a saved Pine Script's source over the REST API WITHOUT touching the editor buffer. Use this to compare a saved script against a local file or audit what is deployed - it cannot destroy unsaved work and cannot mis-bind the editor.

Inputs: name (required).

pine_get_sourceA

Get current Pine Script source code from the editor

Inputs: no named parameters.

pine_list_scriptsA

List saved Pine Scripts. Returns a page, not the whole library — pass name_filter to find one by name.

Inputs: limit, offset, name_filter.

pine_newA

Replace the Pine editor buffer with a blank template. WARNING: this does NOT create a new saved script. It overwrites whatever script the editor currently has open, and a following pine_save or pine_compile persists that overwrite to the cloud. It refuses to run when the buffer holds real content unless confirm_overwrite is set.

Inputs: type (required), confirm_overwrite.

pine_openA

Load a saved Pine Script into the editor buffer. THIS REPLACES THE BUFFER and does not guarantee the editor is bound to that script - check binding_verified before any pine_save. To READ a script with no buffer risk, use pine_get_script_source instead.

Inputs: name (required), confirm_overwrite.

pine_saveA

Save the current Pine Script buffer to the saved script the editor is bound to. WARNING: this persists to the cloud and overwrites that script. Verified by reading the editor Save/Saved state; an unverified save is never reported as success.

Inputs: no named parameters.

pine_set_sourceA

Set Pine Script source code in the editor. Refuses to overwrite a buffer holding real content unless confirm_overwrite is set.

Inputs: source (required), confirm_overwrite.

pine_smart_compileB

Intelligent compile: detects button, compiles, checks errors, reports study changes WARNING: like pine_compile this SAVES the current buffer to the bound saved script before compiling.

Inputs: no named parameters.

quote_batchA

Get live quotes for MANY symbols in ONE request without touching the chart. Use this for watchlist and universe sweeps: 29 symbols return in about 270ms. quote_get switches the chart symbol and takes ~20s each, so never loop it.

Inputs: symbols (required).

quote_getA

Get quote data. A different symbol briefly switches the chart, serializes concurrent quote calls, and restores the original chart.

Inputs: symbol.

replay_autoplayA

Turn autoplay on or off in replay mode, optionally setting the speed. Pass enabled to say which state you want; omit it to flip whatever the current state is. Confirms the result by reading autoplay back.

Inputs: speed, enabled.

replay_startA

Start bar replay mode, optionally at a specific date. A date outside this symbol/timeframe replay depth is REFUSED rather than silently relocated - every read taken after a relocation is correct for a date you did not ask for.

Inputs: date, allow_relocation.

replay_statusA

Get current replay mode status

Inputs: no named parameters.

replay_stepA

Advance one bar in replay mode

Inputs: no named parameters.

replay_stopA

Stop replay and return to realtime

Inputs: no named parameters.

replay_tradeB

Execute a trade action in replay mode (buy, sell, or close position)

Inputs: action (required).

state_deleteB

Delete a named chart state snapshot

Inputs: name (required).

state_listA

List all saved chart state snapshots sorted by capture date

Inputs: no named parameters.

state_restoreA

Restore a saved chart state snapshot by name. DESTRUCTIVE: this makes the chart MATCH the snapshot, which removes every study and every drawing that is not in it. Take a state_snapshot of the current chart first if you might want it back.

Inputs: name (required).

state_snapshotA

Capture full chart state (symbol, timeframe, studies, drawings, visible range) to a named snapshot file

Inputs: name (required), overwrite.

strategy_sweepB

Iterate a strategy across symbols × timeframes × indicator input combinations

Inputs: symbols (required), entity_id (required), timeframes (required), inputs, +10 more.

symbol_infoA

Get detailed metadata about the current symbol (name, exchange, type, description)

Inputs: no named parameters.

tab_closeA

Close the currently active chart tab. Names the tab it is about to close and refuses when no tab is marked active. Closing a chart tab cannot be undone through this API, so pass expect_title when it matters which one goes.

Inputs: expect_title, discard_unsaved.

tab_listA

List all open TradingView chart tabs

Inputs: no named parameters.

tab_newA

Open a new TradingView tab, optionally loading a saved layout

Inputs: name, layout.

tab_switchB

Switch to a chart tab by index

Inputs: index (required).

tv_capability_matrixB

Map every TVControl tool to its required TradingView APIs and report which tools are currently available or blocked.

Inputs: force, probe.

tv_chart_healthA

Check whether each chart pane has a live data session. Finds the failure where ONE pane sits in a reconnect loop forever while the rest of the layout is fine: a study whose id never registered with the server kills that pane's session on every reconnect, and the pane cannot recover on its own. Read-only. Use tv_repair_chart to fix what this reports.

Inputs: no named parameters.

tv_compatibility_checkB

Canary for critical TradingView internal APIs used by TVControl. Reports the Desktop version and exactly which required capabilities are missing.

Inputs: no named parameters.

tv_compatibility_snapshotA

Record, compare, or list immutable per-version TradingView API compatibility baselines. Critical failures and informational method drift are reported separately.

Inputs: action, overwrite.

tv_discoverA

Report which known TradingView API paths are available and their methods

Inputs: no named parameters.

tv_health_checkB

Check CDP, TradingView market-data connection, compatibility, and current chart state

Inputs: no named parameters.

tv_launchA

Launch TradingView Desktop with Chrome DevTools Protocol (remote debugging) enabled. Auto-detects install location on Mac, Windows, and Linux.

Inputs: port, kill_existing.

tv_repair_chartA

Repair a chart pane stuck in a reconnect loop, without rebuilding the layout. Removes the studies whose id never registered with the server (they are what kill the session on every reconnect) and reconnects the pane. Names every study it removes so you can add them back with indicator_add_from_search. Run tv_chart_health first, or pass dry_run to see the plan.

Inputs: pane, dry_run.

tv_support_bundleA

Create a privacy-safe compressed diagnostics bundle with identifiers, source code, URLs, titles, and secret-like values removed.

Inputs: telemetry_lines.

tv_ui_stateA

Get current UI state: which panels are open, what buttons are visible/enabled/disabled

Inputs: no named parameters.

tv_updateA

Safely fast-forward a clean git checkout from its configured upstream. Refuses package installs, untracked branches, dirty trees, and diverged history.

Inputs: no named parameters.

tv_watchdog_historyC

Return bounded privacy-safe watchdog state-transition history

Inputs: limit.

tv_watchdog_sampleA

Run one read-only health watchdog sample. Persists only state transitions and never chart symbols, URLs, or account data.

Inputs: no named parameters.

tv_watchdog_startA

Start the read-only in-process health watchdog. Samples are coalesced and only state transitions are persisted.

Inputs: interval_ms.

tv_watchdog_statusB

Return watchdog runtime status and its latest privacy-safe sample

Inputs: no named parameters.

tv_watchdog_stopA

Stop the in-process health watchdog

Inputs: no named parameters.

ui_clickB

Click a UI element by aria-label, data-name, text content, or class substring

Inputs: by (required), value (required).

ui_find_elementA

Find UI elements by text, aria-label, or CSS selector and return their positions

Inputs: query (required), strategy.

ui_fullscreenA

Toggle TradingView fullscreen mode

Inputs: no named parameters.

ui_hoverA

Hover over a UI element by aria-label, data-name, or text content

Inputs: by (required), value (required).

ui_keyboardB

Press keyboard keys or shortcuts (e.g., Enter, Escape, Alt+S, Ctrl+Z)

Inputs: key (required), modifiers.

ui_mouse_clickB

Click at specific x,y coordinates on the TradingView window

Inputs: x (required), y (required), button, double_click.

ui_open_panelB

Open, close, or toggle TradingView panels (pine-editor, strategy-tester, watchlist, alerts, trading)

Inputs: panel (required), action (required).

ui_scrollB

Scroll the chart or page up/down/left/right

Inputs: direction (required), amount.

ui_type_textA

Type text into the currently focused input/textarea element. Refuses when nothing is focused or the focused element cannot accept text, and reports which element received the characters.

Inputs: text (required), expect_focus.

watchlist_addA

Add a symbol to the TradingView watchlist

Inputs: symbol (required).

watchlist_add_bulkA

Add multiple symbols sequentially and report per-symbol results

Inputs: symbols (required).

watchlist_createA

Create a NEW named watchlist, optionally populated in one call. Use this to build a user a list from scratch - watchlist_import and watchlist_add_bulk only write into whichever list is already active, so neither can make one. Returns the new id; pin by id, never by name.

Inputs: name (required), symbols, allow_duplicate_name.

watchlist_exportB

Export the current watchlist to a JSON file on disk

Inputs: file_path.

watchlist_getA

Get every symbol in the active TradingView watchlist. Membership comes from the symbols_list API so it is complete even when the panel is scrolled or closed. Quote cells are best effort and only present when the watchlist panel is open; check quotes_available.

Inputs: no named parameters.

watchlist_get_by_idA

Get one watchlist's membership by explicit id (or exact name). This is what a universe scan should use - it is verifiable, where "active" is not. Refuses rather than guessing when a name matches more than one list.

Inputs: name_or_id (required).

watchlist_importB

Import symbols into the TradingView watchlist from a JSON file

Inputs: file_path (required), mode, dry_run.

watchlist_listA

List every custom watchlist on the account with its id, name and symbol count. Use this before scanning: watchlist_get answers "whatever is active", which can name a different list than the panel is showing. Names are not unique, so resolve by id.

Inputs: no named parameters.

watchlist_removeB

Remove a symbol from the TradingView watchlist

Inputs: symbol (required).

watchlist_remove_bulkA

Remove multiple symbols sequentially and report per-symbol results

Inputs: symbols (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 113 tools

    Disambiguation2/5

    The tool set is organized into clear resource prefixes, but several tools have overlapping boundaries: pine_compile vs pine_smart_compile, chart_manage_indicator vs indicator_add_from_search, data_get_indicator vs data_get_study_values, and multiple tv_* health/compatibility checks. While individual descriptions are unusually explicit, the sheer number of near-synonym pairs (plus watchlist_add_bulk/import/create and batch_run/strategy_sweep) makes mis-selection likely.

    Naming Consistency4/5

    Most tools follow a consistent resource_action pattern (chart_set_symbol, watchlist_create, alert_create_bulk, replay_start, draw_remove_one, state_snapshot). Minor deviations like quote_get/depth_get, tv_discover, ui_keyboard, and pine_new/pine_open break the pattern slightly, but the prefixes make the set predictable overall.

    Tool Count1/5

    113 tools is far beyond the 50+ threshold and creates an unwieldy surface even for a desktop automation server. The broad domain justifies many categories, but the count is excessive and should be split into focused sub-servers.

    Completeness4/5

    The server covers an impressive breadth: chart state, watchlist CRUD, Pine editing/compilation, alerts, replay, drawings, layouts, tabs, panes, UI automation, diagnostics, and strategy sweeps. Minor lifecycle gaps exist (no layout_delete, watchlist_delete, or alert_update), but these are workarounds rather than dead ends.

    Maintenance

    ActivityStale
    ResponsivenessUsually handled

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      A type-safe MCP server that enables AI agents to control TradingView Desktop via Chrome DevTools Protocol, allowing chart state reading, symbol/timeframe changes, and OHLCV data fetching.
      11
      88 npm
      1
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Controls the TradingView Desktop app via MCP, allowing AI agents to manage charts, indicators, Pine Script strategies, and optionally mirrors signals to MetaTrader 5 for automated trading.
      1
      MIT
    • F
      license
      Not graded
      quality
      C
      maintenance
      An MCP server that extends TradingView with AI-driven morning briefs, trading rule automation, and 81 tools for chart control, Pine Script development, replay practice, and multi-pane layouts.
      88 npm
      -