tv-cdp-mcp
Provides tools for controlling TradingView Desktop, enabling chart manipulation (symbol, timeframe, chart type), reading chart state and screenshots, managing indicators and their inputs, exporting data, handling alerts and layouts, and paper trading with bracket orders.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@tv-cdp-mcp Export the last 500 bars with all indicators for BTC/USDT to CSV."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
tv-cdp-mcp
Drive TradingView Desktop from an AI agent — charts, indicators, alerts, layouts and paper trades — over the Chrome DevTools Protocol.
TradingView Desktop is an Electron app. Launch it with a debugging port open and
everything the UI can do becomes scriptable — because the UI itself is just
JavaScript calling window.TradingViewApi. tv-cdp-mcp is a
Model Context Protocol server that exposes that
surface as 29 typed tools, so an MCP-capable agent (Claude Code, Claude Desktop,
or anything else that speaks MCP) can read your charts and act on them.
It talks to your TradingView Desktop, on your machine, over localhost. There is no cloud service, no account of ours, and no credential of any kind in this repo.
Table of contents
Related MCP server: TradingView MCP Bridge
Features
Chart control — read and set the symbol, timeframe and chart type; read the full chart state; capture PNG screenshots of the chart or the whole tab.
Indicators (studies) — list what is on the chart, read every input with its human name, type, options and ranges, and write inputs back with type coercion and validation.
Market data — pull OHLCV bars straight out of the loaded series, and read the plotted values of any indicator bar by bar (up to 500 bars).
Data export — join bars and every indicator's plots into one table and write it as CSV or JSON. TradingView Desktop refuses its own "Export chart data"; this composes the export from the loaded series instead.
Alerts — list alerts with their machine-readable firing condition, inspect one in full, pause, resume, retarget the condition, create new alerts by cloning an existing one, and delete permanently (with a required confirmation).
Layouts — list saved layouts, open any chart URL (including someone else's shared View Only chart), "Make a copy", rename, and delete with a protect list.
Indicator templates — list, snapshot to a file, save, apply and delete.
Paper trading — read broker status, place bracket orders (entry + stop + target), close positions, cancel orders and move the stop/target of an open position. Paper accounts only, behind a hard refusal and a configurable risk gate.
Multi-tab aware — with several chart windows open, the server finds the one that is actually painting rather than trusting
visibilityState, which lies in Electron.Tested without TradingView — 330 unit tests run against a fake page, so the whole tool surface is covered in CI without an account or a running chart.
Examples
alert-to-order-bridge — a beginner-friendly, exchange-agnostic reference for the rest of the pipeline: a chart alert fires, a webhook arrives, and a bracket order (entry + stop + target) is placed on your own exchange account, behind a guided
npm run setupwizard and a refuse-by-default risk gate. Demo/testnet by default, your keys stay on your machine, and it is a starting point rather than a production trading system. New to this? It ships a paste-into-your-AI-agent setup prompt as well as the terminal wizard.
Requirements
Node.js | >= 22 (ESM, |
TradingView Desktop | installed and logged in, launched with a remote debugging port |
OS | Windows, macOS or Linux. The bundled launcher scripts are Windows-only; on other platforms start TradingView with the flag yourself |
An MCP client | Claude Code, Claude Desktop, or any MCP-capable agent |
A TradingView subscription tier that allows the features you drive (alerts, multiple layouts, etc.) is between you and TradingView — this server only clicks the buttons you already have.
Installation
Have Claude Code? SETUP-WITH-CLAUDE-CODE.md is the fastest route in this repo — two commands, one prompt, then a library of plain-English prompts instead of tool names.
Never set up an MCP server before? Use GETTING-STARTED.md instead — the same steps, click by click, with the failure modes explained as you hit them. This section is the short version for people who already know the drill.
No Claude Code? SETUP-CLAUDE-DESKTOP.md walks through the whole thing using the Claude Desktop app instead — including the two JSON mistakes that silently stop it working.
No AI app at all? You don't need one. USE-WITHOUT-AI.md drives every tool from a terminal via
scripts/tv-cli.mjs— same handlers the MCP server calls, no subscription of any kind.
git clone https://github.com/pbajkovic-hub/tv-cdp-mcp.git
cd tv-cdp-mcp
npm install
npm test # 330 tests, no TradingView and no exchange account needed1. Start TradingView Desktop with the debugging port
The server attaches to TradingView's own Electron process. That process must be started
with --remote-debugging-port, which it does not do by default.
Windows — use the bundled launcher, which resolves the Store install at run time so TradingView updates do not break it:
.\scripts\launch-tv.ps1 # start it (or report that the port is already open)
.\scripts\launch-tv.ps1 -Restart # already running without the port? restart it with onemacOS / Linux — start the app with the flag directly, for example:
# macOS — adjust the path to your install
"/Applications/TradingView.app/Contents/MacOS/TradingView" --remote-debugging-port=9222 &Verify the port is live — this should return a JSON array of open tabs:
curl http://127.0.0.1:9222/json2. Register the server with your MCP client
Claude Code:
claude mcp add tv-cdp -- node <path-to-this-repo>/src/server.mjsClaude Desktop — add to claude_desktop_config.json:
{
"mcpServers": {
"tv-cdp": {
"command": "node",
"args": ["<path-to-this-repo>/src/server.mjs"]
}
}
}Replace <path-to-this-repo> with the absolute path to your clone.
Quick start
With TradingView Desktop running on the debug port and the server registered, ask your agent something like "what's on my chart right now?" and it will call:
// tv_get_chart_state {}
{
"layout_name": "EXAMPLE BTC 1h",
"symbol": "BYBIT:BTCUSDT.P",
"resolution": "60",
"chartType": 1,
"study_count": 2,
"layout_id": "AbC12XyZ"
}The responses below are trimmed to the interesting keys; see docs/ for the full
shapes.
A typical read → act sequence:
// 1. what indicators are loaded?
// tv_list_studies {}
{ "studies": [ { "id": "P6SYjF", "name": "Example Oscillator [Vendor]" } ] }
// 2. read one indicator's inputs by name substring
// tv_get_study_inputs { "study": "oscillator" }
{ "id": "P6SYjF", "inputs": [ { "id": "in_0", "name": "Length", "type": "integer", "value": 14 } ] }
// 3. change a setting
// tv_set_study_inputs { "study": "P6SYjF", "inputs": { "in_0": 21 } }
{ "changed": [ { "id": "in_0", "previous": 14, "current": 21 } ] }
// 4. export bars + every plot to CSV
// tv_export_data { "count": 300 }
{ "symbol": "BYBIT:BTCUSDT.P", "bars": 300, "file": "<repo>/exports/BYBIT_BTCUSDT.P_60_20260914-2210.csv" }Every mutating tool returns the previous value next to the new one, so an agent can always undo what it just did.
Tools / API reference
29 tools across 8 modules. MUTATES marks anything that changes your chart, account or
broker state; everything else is strictly read-only.
Chart
Tool | Mutates | Description |
| no | List every open chart tab (index, layout id, title, url) and which one is actually painting |
| no | Symbol, extended symbol info, resolution, chart type, study count, layout name and id |
| yes | Change the active chart symbol; returns |
| yes | Change the timeframe ( |
| no | PNG screenshot of the chart tab; |
Indicators (studies)
Tool | Mutates | Description |
| no | Indicators and strategies on the chart with their study ids |
| no | One study's inputs with human names, types, options and ranges; accepts id or name substring |
| yes | Set one or more inputs by id, coerced to the declared type and validated, then re-read |
Data
Tool | Mutates | Description |
| no | OHLCV bars from the loaded series, newest last; max 500, only what the chart holds |
| no | Plotted values of one study for the most recent bars, newest last |
| no | Bars + every study's plots joined on bar time, written as CSV/JSON or returned inline |
Alerts
Tool | Mutates | Description |
| no | Account alerts in panel order with their machine-readable firing condition and |
| no | One alert in full: complete description, untruncated condition with every study input, raw model |
| yes | Shallow-merge a patch (condition, message, webhook, name, resolution…) into a live alert |
| yes | Pause alerts — they stay defined but stop firing; returns per-id previous/current state |
| yes | Resume alerts so they fire again, webhooks included |
| yes | Create an alert by cloning an existing one and retargeting the clone; paused by default |
| yes | Permanently delete alerts by id; requires |
Layouts
Tool | Mutates | Description |
| no | Saved layouts of the logged-in account, newest first, with an optional name filter |
| yes | Open a chart URL or bare layout id in the tab — your own or someone's View Only chart |
| yes | "Make a copy" of the layout on screen (or of |
| yes | Rename the layout on screen; refuses a read-only chart |
| yes | Delete one saved layout by id or exact name; |
Indicator templates
Tool | Mutates | Description |
| yes | One tool switched on |
Paper trading
All five refuse unless the connected broker is TradingView Paper Trading on a demo
account — checked in JS before the call and again inside the page body.
Tool | Mutates | Description |
| no | Broker id/title, account id/type, connection, open positions, working orders, capabilities, active gate |
| yes | Place an order with a mandatory stop loss and optional take profit; qty sized from |
| yes | Market-close an open position by symbol or position id |
| yes | Cancel one working order by id |
| yes | Move the stop loss and/or take profit of an open position; side-sanity checked; |
Prefer a terminal to an agent? node scripts/tv-cli.mjs --list runs any tool below
directly — see USE-WITHOUT-AI.md.
See docs/ for full argument shapes, return values and the research notes behind
each module: ALERTS, LAYOUTS,
STUDY-INPUTS, TEMPLATES,
TRADING, EXPORT.
Common arguments
Every session-backed tool also accepts:
layout— which chart tab to act on: a layout id, a DevTools target id, or a 0-based index. Default is the tab that is actually painting.expect_layout— the layout id the caller believes that tab is showing. The call refuses withexpect_layout mismatchif the tab has moved on.
expect_layout matters more than it looks: a tab keeps its DevTools target id when you
open a different layout in it, so an active pick can land on a different chart than the
agent last saw. Every mutating result therefore carries the layout_id / layout_name of
the chart it actually hit.
Configuration
All configuration is environment variables. No config file, no credentials, no secrets.
Variable | Default | Meaning |
|
| Port the CDP session connects to on |
|
| Where |
|
| Paper-trading gate: max USD at risk per entry |
|
| Paper-trading gate: max simultaneous open positions |
| (empty) | Comma-separated tickers the trading tools always refuse |
|
| Exchange prefix applied to bare tickers ( |
Example:
TV_MAX_RISK_USD=25 TV_DENY_SYMBOLS=FOOUSDT,BARUSDT node src/server.mjsThe risk gate is a guard rail against a runaway agent, not a trading strategy. Set it to something you would be comfortable losing while you are not watching.
Security
The debugging port is a root shell into your logged-in TradingView session. Anything
that can reach 127.0.0.1:9222 can read your charts, your alerts and your account, and
can act as you.
The server connects to
127.0.0.1only.Never expose that port beyond localhost and never tunnel it — no ngrok, no SSH port-forward, no
--remote-debugging-address=0.0.0.0.Close the debug-port instance when you are done, or run it only while you are working.
The MCP server stores no credentials and reads no secret files. The only environment variables it touches are the ones in the table above. (The optional example under
examples/is separate software you opt into: it keeps your exchange keys in its own git-ignored.env, sends them only to your exchange, and is never loaded by the MCP server.)
Troubleshooting
TradingView Desktop is not reachable on 127.0.0.1:9222
The app is not running with the debugging port. Run scripts\launch-tv.ps1 (add
-Restart if it is already running without the port), or start it manually with
--remote-debugging-port=9222. Confirm with curl http://127.0.0.1:9222/json.
no TradingView chart tab is open
The server needs at least one .../chart tab as a CDP target. Open a chart window in
TradingView Desktop.
A tool acted on the wrong chart
You have several chart tabs open and the agent used the default active pick. Pass an
explicit layout (layout id or index), and pass expect_layout on mutating calls.
Screenshots hang forever
TradingView's Page.captureScreenshot never returns while the window is minimised. The
server detects the minimised state and races the capture against a 12 s timeout, but the
fix is to un-minimise the window.
A study's inputs come back but writes silently do nothing
Check that you are addressing the input by its id (in_0, …) as returned by
tv_get_study_inputs, not by its display name.
Tests fail after a TradingView update They should not — the suite runs entirely against a fake page. If live behaviour breaks after an update, the page-side object paths may have moved; see Limitations.
Limitations and known issues
Honest list. Most of these are properties of TradingView, not bugs we can fix.
Private API, no stability promise. This drives
window.TradingViewApiand several underscore-prefixed internals (_activeChartWidgetWV,_chartWidgetCollection). A TradingView update can move them without warning. The page-side paths are documented indocs/and in each module header so they are quick to re-verify.visibilityStatelies in Electron. Every TradingView Desktop tab reports itself asvisible. The server scores tabs with arequestAnimationFrameprobe — only the painting tab fires one — and binds that tab. This costs ~250 ms when more than one chart tab is open.Creating an alert means cloning one. Building an alert from scratch requires driving the create dialog; retargeting a server-side clone through the UI's own modify path is far more reliable. So
tv_create_alertneeds an existing alert as its template, and new alerts are created paused by default.Clone-retarget quirk. When you clone an alert and point it at a new symbol, the symbol lives in the model as both a parsed object and an
"="-prefixed JSON string, and the condition's study inputs can hold a reference to another study's plot. Change only one of those and the server accepts the alert but it either fires on the old symbol or comes back with astudy_errorand never fires at all — silently, with no UI warning.tv_create_alertrewrites both representations and strips stale plot references; always checklast_errorafter creating one. This is the single sharpest edge in the whole TradingView alert API.Alert resume is eventually-consistent.
restartAlertsreturns success before the alert actually flips to active — allow 60–90 s, and re-check rather than assuming the call failed.Copying a layout takes 45–60 s. It is a server-side clone plus a full page reload. Copying another user's chart opens the copy in a new tab.
Export is limited to what is loaded. Max 500 bars, and only history the chart has actually scrolled into memory. Built-in studies without a data series (Volume, etc.) expose only the last bar's formatted strings and are reported under
skipped.Paper trading only, by design. The trading tools hard-refuse any broker that is not TradingView Paper Trading on a
demoaccount. Connecting a real broker and removing that check is not supported and not advised.Alert
messagebodies are opaque. The server passes them through as text and does not parse, validate or redact them.Windows-first tooling. The launcher scripts are PowerShell. The server itself is platform-agnostic; contributions for macOS/Linux launchers are welcome.
Contributing
Issues and pull requests are welcome — see CONTRIBUTING.md for the module contract, code style and test expectations. In short: one owner per file, every tool module exports the same shape, and the test suite must keep running without TradingView.
Disclaimer
This software automates a trading application. Trading carries financial risk and you can lose money.
Provided as-is, without warranty of any kind. See LICENSE.
This is not financial advice and contains no trading strategy.
The trading tools are restricted to paper/demo accounts. Do not modify them to reach a live account unless you fully understand the consequences — an automated agent with a bug can act faster than you can stop it.
You are responsible for complying with TradingView's Terms of Service. Automating a desktop client you are logged into may or may not be permitted for your account type; check before you rely on it.
Nothing here is affiliated with or endorsed by TradingView.
License
MIT.
Available Tools
29 toolstv_cancel_orderADestructive
MUTATES the connected TradingView broker: cancel one working order by id (entry orders; bracket orders belong to their position). PAPER ONLY. Returns the cancelled order and the remaining working orders.
Inputs: order_id (required), layout, expect_layout.
tv_close_positionADestructive
MUTATES the connected TradingView broker: close an open position by symbol or position id (market close via the broker adapter). PAPER ONLY. Returns the position that was closed and the remaining open positions.
Inputs: layout, symbol, position_id, expect_layout.
tv_copy_layoutADestructive
TradingView "Make a copy": clone the layout shown in the bound tab (optionally opening source_url first, e.g. someone else's View Only chart) into a new saved layout with the given name. Settles when the copy appears in the saved-layout list (45-60 s: server clone + page reload); reports which tab shows it (TV Desktop opens a copy of another user's chart in a NEW tab). Refuses an empty name or a name that already exists among the saved layouts unless allow_duplicate_name=true.
Inputs: name (required), layout, timeout_s, source_url, +3 more.
tv_create_alertADestructive
MUTATES: create a new alert by CLONING an existing one (from_id) server-side and retargeting the clone through the UI's own modifyRestartAlert path, with optional overrides for symbol, resolution (applied to the alert AND every condition - they move together), name, message and web_hook (empty string removes the webhook). Clone-based because it must be: /create_alert rejects every hand-built payload (invalid_request), and only an existing alert carries the live study plots + pineId a strategy condition needs. The new alert is created PAUSED by default - resuming it is a separate, explicit tv_resume_alerts call. ARMED WINDOW: when overrides are applied, modify_restart re-arms the clone and the stop rail lands right after (~1s) - a fire inside that window would deliver the alert's real message/webhook; a pure clone with no overrides never arms. If the retarget fails the clone is deleted again automatically. Returns { new_id, cloned_from, active, alert, warning? }. Clone -> modify -> stop path verified live 2026-09-05 on defanged throwaway clones. Alerts on this account fire real webhooks that place live orders.
Inputs: from_id (required), name, active, layout, +5 more.
tv_delete_alertsADestructive
MUTATES: PERMANENTLY delete the given alerts (REST /delete_alerts via the alerts REST handler; there is no undo - a deleted alert can only be re-created by cloning another one). Requires confirm=true. Every id is resolved to name + symbol BEFORE anything is deleted (unknown ids abort the whole call), and the result echoes { id, name, symbol, resolution, active } per deleted alert plus confirmed_gone read back from the server list (the delete can lag seconds; still_present lists ids that were still there after ~5 s). VERIFIED LIVE 2026-09-05: a paused clone (id 7700000006) deleted, confirmed gone in ~1 s.
Inputs: ids (required), confirm (required), layout, expect_layout.
tv_delete_layoutADestructive
Delete ONE saved layout from the TradingView account by layout id, numeric id or exact name. Irreversible: requires confirm=true, refuses anything listed in protect (ids or names), and refuses the layout currently shown in the bound tab unless force=true. Verifies by re-listing.
Inputs: layout_id (required), force, layout, confirm, +3 more.
tv_export_dataARead-only
Read-only: export the active chart as one table - OHLCV bars plus the plotted values of every study (or the studies you name) joined on bar time - to a CSV (default) or JSON file under the export directory, or inline with write=false. TradingView Desktop refuses its own "Export chart data", so this composes the export from the loaded series: at most 500 bars and only what the chart has scrolled into memory. Studies without a data series (built-in Volume etc.) are listed under skipped. Column names are " | ". Returns symbol, resolution, bar count, first/last bar, the columns and the file path.
Inputs: file, count, write, format, +5 more.
tv_get_alertARead-only
Read one alert in full: the complete description, the untruncated firing condition (including every study input), the projected alert model, and the raw snake_case REST payload from listAlerts() for that id. Read-only. presentation_data is omitted - it is megabytes of chart state and is never needed to edit an alert.
Inputs: id (required), layout, expect_layout.
tv_get_barsARead-only
Read OHLCV bars of the active chart straight from the loaded series (newest last). Read-only. Returns at most 500 bars; TradingView only holds what has been scrolled into memory, so available tells you how many bars the chart currently has. Also reports whether the symbol failed to resolve.
Inputs: count, layout, expect_layout.
tv_get_chart_stateARead-only
Read the active chart: symbol, extended symbol info, resolution, chart type, study count, saved layout name and layout id. Read-only.
Inputs: layout, expect_layout.
tv_get_study_inputsARead-only
Read one study's inputs with their human names, types, options and ranges. Accepts a study id or a case-insensitive name substring. Read-only.
Inputs: study (required), filter, layout, expect_layout, +1 more.
tv_get_study_valuesARead-only
Read the plotted values of one study for the most recent bars (newest last). Read-only. Accepts a study id or a case-insensitive part of its name. Each row is keyed by plot title (e.g. "Buy", "Sell", "Plot (plot_8)"); colour/fill plots are dropped unless include_decoration=true. Built-in studies such as Volume have no series and return the formatted data-window strings instead.
Inputs: study (required), count, layout, expect_layout, +1 more.
tv_list_alertsARead-only
List the account's TradingView alerts with their machine-readable firing condition. Read-only. Returns at most 200 projected rows in the same order as the TradingView alert panel (newest first), each with panel_pos = its 1-based row on the full unfiltered list, plus id, symbol, resolution, name, description (the string the UI shows), type, complexity, active, expiration, conditionType, condition, hasWebhook, webhookUrl, message. Refer to an alert by name + symbol, never by position alone. In list mode the description is capped at 400 chars, message at 200, and study inputs / plotOffsets maps with more than 20 entries are collapsed to a count - use tv_get_alert for the full detail.
Inputs: layout, symbol, active_only, expect_layout.
tv_list_layoutsARead-only
List every open TradingView chart tab (index, layout id, title, url) and which one is actually painting (active). Read-only; the paint probe runs one requestAnimationFrame per tab.
Inputs: no named parameters.
tv_list_saved_layoutsARead-only
List the saved chart layouts of the logged-in TradingView account (id, layout id, name, symbol, resolution, modified). Read-only; from TradingViewApi.getSavedCharts(). Optional name filter (case-insensitive substring).
Inputs: filter, layout, expect_layout.
tv_list_studiesARead-only
List the indicators/strategies on the active TradingView chart with their study ids. Read-only.
Inputs: layout, expect_layout.
tv_open_chart_urlADestructive
Open a TradingView chart URL (or bare layout id) in the bound chart tab - own layouts and other users' shared / View Only charts alike. Full page reload, ~20 s; waits until the chart is ready and reports the layout it landed on, its owner and whether it is read-only. Refuses while the current layout has unsaved changes unless discard_changes=true.
Inputs: url (required), layout, timeout_s, expect_layout, +1 more.
tv_pause_alertsADestructive
MUTATES: stop (pause) the given alerts via AlertsCollection.stopAlerts - they stay defined but stop firing. Returns per-id { previous_active, current_active } read back from the server, so tv_resume_alerts reverses it. Verified live 2026-09-04 on a price alert.
Inputs: ids (required), layout, expect_layout.
tv_place_orderADestructive
MUTATES the connected TradingView broker: place an order with a mandatory stop loss and optional take profit through the in-page broker adapter. PAPER ONLY - refuses unless the broker is TradingView Paper Trading on a demo account. Gate (configurable): risk <= 50 USD, max 2 open positions, one position per symbol, denied symbols refused. qty is sized from risk_usd / stop distance unless qty is given. Market orders size off the chart price of the active layout (set the chart to the symbol) or entry_price. dry_run=true returns the exact pre-order and sends nothing; use it first.
Inputs: sl (required), side (required), symbol (required), tp, +10 more.
tv_rename_layoutADestructive
Rename the layout shown in the bound tab (TradingView "Rename"). Refuses a read-only / View Only chart. Returns the previous and new name.
Inputs: name (required), layout, timeout_s, expect_layout.
tv_resume_alertsADestructive
MUTATES: restart (resume) the given alerts via AlertsCollection.restartAlerts - they begin firing again, webhooks included. Returns per-id { previous_active, current_active } read back from the server, so tv_pause_alerts reverses it. Verified live 2026-09-04 on a price alert.
Inputs: ids (required), layout, expect_layout.
tv_screenshotARead-only
Capture a PNG screenshot of the chart tab and return it as an image. Read-only. Set clip_to_chart to crop to the chart container.
Inputs: layout, clip_to_chart, expect_layout.
tv_set_alert_conditionADestructive
MUTATES a live alert: shallow-merge patch (camelCase model fields: conditions, message, webhook, name, resolution, ...) into the alert through the same modifyRestartAlert call path the TradingView UI uses - the ONLY path the server accepts (raw snake_case payload round-trips are rejected with invalid_request and were removed). Returns { id, patched_keys, sent, previous, current, was_active, paused_restored, current_raw } so the change is reversible - feed previous back as the next patch to undo it. Refuses an empty patch, identity fields (id/alert_id) and unknown field names. ARMED WINDOW: modify_restart always re-arms the alert; if it was paused before the call it is stopped again right after (~1s later, paused_restored: true) - a fire inside that window would deliver the alert's real message/webhook. Clone -> modify -> stop path verified live 2026-09-05 on defanged throwaway clones. Alerts on this account fire real webhooks that place live orders.
Inputs: id (required), patch (required), layout, expect_layout.
tv_set_position_bracketsADestructive
MUTATES the connected TradingView broker: move the stop loss and/or take profit of an OPEN position via the broker adapter (editPositionBrackets). PAPER ONLY - refuses unless the broker is TradingView Paper Trading on a demo account. Give symbol or position_id and at least one of stop_loss / take_profit; the value you leave out keeps its current level (both are always sent). Sanity gate against the position side and price: long needs stop_loss < price < take_profit, short the reverse - no override. Returns previous and applied levels plus the position before/after, read back until the broker shows the new values. dry_run=true returns the plan and sends nothing; use it first. Verified live against a paper position: stop moved and restored, ~450 ms each.
Inputs: layout, symbol, dry_run, stop_loss, +3 more.
tv_set_resolutionBDestructive
MUTATES the chart: change the active chart timeframe/resolution ("1", "5", "60", "1D", "1W"). Returns { previous, current } so the change can be reverted.
Inputs: resolution (required), layout, expect_layout.
tv_set_study_inputsADestructive
MUTATES the chart: set one or more inputs on a study by id, then re-read them. Values are coerced to the input's declared type and validated against its options/min/max. Returns the previous value for every change so it can be undone.
Inputs: study (required), inputs (required), layout, expect_layout.
tv_set_symbolADestructive
MUTATES the chart: change the active chart symbol (e.g. "BYBIT:ETHUSDT.P"). Returns { previous, current } so the change can be reverted. TradingView does not validate the symbol up front - check symbol_resolved in the result.
Inputs: symbol (required), layout, expect_layout.
tv_study_templateADestructive
Indicator (study) templates of the TradingView account, one tool switched on action. list (read-only): saved templates - custom first, then the built-in standard/fundamental ones. snapshot (read-only): the study set of the chart on screen as a template object (optionally written to file) - take one before apply so it can be undone. save: store the chart's studies under name (POST /api/v1/study-templates; replace=true to overwrite an existing custom template). apply: MUTATES THE CHART - REPLACES EVERY STUDY on the layout with the template from name (saved), template (inline) or file (JSON); returns studies before/after. delete: remove a custom template by name; confirm=true required; built-ins refuse. Verified live: full round trip - snapshot, save (listed in ~2 s), apply back (studies_before == studies_after), delete with confirm (gone in ~1 s).
Inputs: action (required), file, name, layout, +6 more.
tv_trading_statusARead-only
Read the broker connected inside TradingView: broker id/title, account id/type, connection, open positions, working orders, capability flags and the gate this server enforces. Pass symbol to also check tradability, qty step/min and the chart price. Read-only.
Inputs: layout, symbol, expect_layout.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 29 tools
Every tool targets a distinct resource and action—alerts, layouts, chart state, studies, and trading each have clear boundaries. Even similar-sounding tools like tv_list_alerts vs tv_get_alert or tv_list_layouts vs tv_list_saved_layouts are unambiguously separated by read scope and detail.
The dominant pattern is tv_verb_noun in snake_case (list_alerts, set_symbol, delete_layout), which is consistent and predictable. Minor deviations include tv_screenshot, tv_study_template (noun with action parameter), and tv_trading_status, but these do not undermine the overall pattern.
29 tools is on the higher end for an MCP server, but the server covers five distinct domains (alerts, layouts, chart, studies, trading), and each tool has a distinct role. The count feels justified rather than bloated, though it is close to the upper bound of what is appropriate.
The surface is nearly complete for the stated scope: full CRUD for alerts and layouts, chart inspection and mutation, study input management, template lifecycle, and paper trading operations. Minor gaps exist—such as no way to remove a single study from a chart or modify an existing order's price/size—but agents can work around them.
Maintenance
Related MCP Connectors
> TradingMCP puts a market analyst inside your AI assistant. Paste one URL into Claude, ChatGPT, Cursor, VS Code or any MCP client and ask in plain language: screen for breakouts, run a multi-timeframe analysis, backtest a strategy with walk-forward validation, scan for smart-money and volume signals, or get a one-prompt morning market brief. In clients that support MCP Apps, price charts and the Markets panel are drawn right in the chat. > 40+ tools covering crypto (real-time), stocks, ETFs, FX, futures and commodities across major global exchanges. > Hosted, nothing to install: Pro $9/month (2,500 tool calls) or Pro+ $29/month (10,000). Paid upfront with a 14-day money-back guarantee; your API key arrives right after checkout. > Built on the open-source tradingview-mcp core (MIT, ~5k GitHub stars): self-host it free, or use the hosted version with zero ops. > For research and education, not financial advice. Not affiliated with TradingView
Evidence-gated quant research for TradingView Pine Script strategies, run from your AI client.
Unified financial infrastructure connecting AI agents directly to trade live/demo brokerage accounts, Web3 non-custodial wallets, real-time market data across equities, ETFs, crypto, forex, options, DeFi swaps, and prediction markets, institutional research feeds, and algorithmic strategy backtesters.
LuxAlgo for AI agents: the Library, prop firms, Market Trackers, Edge Stats, and your Trade Journal
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceEnables AI assistants to interact with TradingView Desktop charts for analysis, Pine Script development, and workflow automation via Chrome DevTools Protocol.-
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with locally running TradingView Desktop for chart analysis, Pine Script development, and workflow automation via Chrome DevTools Protocol.7,202-
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with locally running TradingView Desktop for chart analysis, Pine Script development, and workflow automation via Chrome DevTools Protocol.88 npm-
- FlicenseNot gradedqualityCmaintenanceEnables AI assistants to interact with TradingView Desktop charts via Chrome DevTools Protocol for chart analysis, Pine Script development, and workflow automation.88 npm-