Skip to main content
Glama
trading-crew-mcp

trading-crew-mcp

trading-crew-mcp

An MCP server that lets Claude read and annotate the chart open in a locally running TradingView Desktop app: read price and candles, draw lines, manage price alerts. Written from scratch (original code, MIT).

Tools (21)

Group

Tools

Read

chart_health, get_quote, get_candles (up to 500 candles as a compact table; optional resolution reads D, 240, 60... and restores the chart), save_candles (writes up to 20,000 candles to a JSON file so analysis never copies numbers by hand), find_pivots, suggest_chain (finds a chain of swing points that no candle cuts, ready for draw_chain)

View

set_timeframe, set_visible_range, screenshot

Draw

list_drawings, get_drawing, draw_trend_line, draw_chain, draw_horizontal_line, remove_drawing, clear_drawings

Alerts

list_alerts, create_alert, modify_alert, list_fires, delete_alert

draw_chain takes pivot points and draws a connected chain of straight lines (each starts where the last ended). It checks every segment against the candles first and refuses, listing the candles it would cut through, unless force is set.

Safety by design:

  • There is no tool that clicks the UI, types, or runs arbitrary page code, so the server cannot reach the order panel or place a trade.

  • create_alert refuses a level on the wrong side of live price (it would fire at once), then reads the alert back and fails if the stored level differs.

  • modify_alert changes a message or level in place (same alert id), applies the same wrong-side check, and reads the result back.

  • delete_alert confirms the alert is gone.

Related MCP server: TradingView MCP Jackson

How it works

TradingView Desktop is started with Chromium's standard debug port. The server connects to that port on localhost and runs small functions in the open chart page: it reads candles and draws through the page's own chart object (window.TradingViewApi). For alerts it makes the same requests to TradingView's alert service that the page itself makes, using your already signed-in session, so it does talk to TradingView's servers on your behalf. It does not bypass any login, subscription or access control.

Install

npm install

Start TradingView with its debug port (macOS example):

open -a TradingView --args --remote-debugging-port=9222

Add to Claude Code:

claude mcp add trading-crew --scope project -- node /full/path/to/trading-crew-mcp/src/server.js

Environment: TV_DEBUG_HOST (default 127.0.0.1), TV_DEBUG_PORT (default 9222), TV_DATA_DIR (where save_candles writes; default ./trading-crew-data).

Check it against your chart: npm run selftest (23 live checks: reads, draws and removes lines, creates, edits and deletes a far-away test alert, restores your zoom, and confirms your alert and drawing counts are unchanged).

Reliability

Chart calls run strictly one at a time, in the order they arrive. Agents often fire several tool calls at once, and two timeframe switches or history loads at the same moment leave the chart on the wrong timeframe. Every tool call has a time limit (60 to 180 seconds depending on the tool). If TradingView is busy or the page does not answer, you get an error back instead of a hang, and the connection is closed and reopened. The timeframe and zoom are restored even after a failed read, and a shape TradingView refuses to create is retried once.

Status

Version 0.1. Works on TradingView Desktop (macOS) with the page version of 12 Nov 2026. TradingView can change its internals at any time, which would break the page calls; the alert payload in particular was matched to a real request and may need updating.

Disclaimer

Personal and educational use. Not affiliated with, endorsed by, or associated with TradingView Inc. TradingView's Terms of Use restrict automated access to their platform, and this tool drives the desktop app programmatically, which may conflict with those terms. You are responsible for your own use and accept the risk, including account restrictions. Do not use it to resell market data or for automated trading. Nothing here is financial advice.

Available Tools

21 tools
chart_healthB

Symbol, timeframe, layout name and how many bars are loaded on the open chart.

Inputs: no named parameters.

clear_drawingsA

Remove all drawings from the chart.

Inputs: no named parameters.

create_alertA

Create a price alert that fires when price crosses a level. Refuses a level on the wrong side of live price, and reads the alert back to confirm the stored level.

Inputs: level (required), message (required), direction (required), days_to_expire.

delete_alertB

Delete one alert by id and confirm it is gone.

Inputs: alert_id (required).

draw_chainA

Draw a connected chain of straight lines through pivot points (each line starts where the last ended). side "above" = red chain over swing highs, "below" = green chain under swing lows. Refuses and reports the candles if any line would cut through a candle, unless force is true.

Inputs: side (required), points (required), color, force, +3 more.

draw_horizontal_lineC

Draw a horizontal line at a price.

Inputs: price (required), color, width.

draw_trend_lineC

Draw a straight line between two points (exact candle time and price).

Inputs: p1 (required), p2 (required), color, width, +1 more.

find_pivotsC

Swing highs and lows with exact candle times and prices, from the last N candles of a timeframe.

Inputs: count, strength, resolution.

get_candlesA

Last N candles (up to 500) as a compact table {fields, rows}, oldest first, with unix times. For more than 500, use save_candles. Pass resolution (e.g. 60, 240, D) to read another timeframe; the chart is switched and then restored.

Inputs: count, resolution.

get_drawingC

Points, colour and width of one drawing by id.

Inputs: id (required).

get_quoteB

Latest candle (open, high, low, close, volume, time) of the open chart.

Inputs: no named parameters.

list_alertsA

All price alerts on the account: id, symbol, level, active, message, last fired.

Inputs: no named parameters.

list_drawingsC

Ids and names of all drawings on the chart.

Inputs: no named parameters.

list_firesB

Alerts that have fired, newest first, with fire time and message.

Inputs: limit.

modify_alertA

Change an alert's message and/or level in place (same id). Changing the level needs direction. Reads it back to confirm.

Inputs: alert_id (required), level, message, direction.

remove_drawingC

Remove one drawing by id.

Inputs: id (required).

save_candlesB

Save up to 20000 candles of a timeframe to a JSON file and return its path, so analysis scripts can read exact data. Loads the full history if needed (M15 reaches back about 4 months).

Inputs: name, count, resolution.

screenshotB

Save a PNG of the TradingView window and return the file path.

Inputs: dir.

set_timeframeA

Change the chart timeframe (1, 5, 15, 60, 240, D, W). Set it back afterwards.

Inputs: resolution (required).

set_visible_rangeB

Scroll and zoom the chart to a time range (unix seconds).

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

suggest_chainB

Find a connected chain of swing points that no candle cuts through, on the chart's current timeframe. side "above" = falling chain over highs (red), "below" = rising chain under lows (green). Returns points to pass straight to draw_chain, with the same tolerance.

Inputs: side (required), count, strength, tolerance, +1 more.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 21 tools

    Disambiguation4/5

    Most tools target a distinct resource+action (draw_* vs list/get/remove/clear_drawings, alerts CRUD, chart control, data reads). A few pairs are close: draw_trend_line vs draw_chain (single line vs connected pivot chain), and find_pivots vs suggest_chain (raw swings vs a validated chain), but the descriptions clearly separate these by input/output and purpose (suggest_chain explicitly hands off points to draw_chain). get_candles vs save_candles is well delineated by the 500-candle cap and file-export intent.

    Naming Consistency4/5

    Almost all names follow a verb_noun or verb_noun_noun pattern (draw_trend_line, set_timeframe, list_alerts, create_alert, delete_alert, save_candles). The only deviations are the noun-style chart_health and screenshot, which break the verb-first convention but remain unambiguous. Minor deviation overall, not confusing.

    Tool Count3/5

    At 21 tools the surface is at the upper end of what an agent can hold comfortably; the rubric's 16-25 band is borderline heavy. Each tool does earn a place (7 drawing, 5 data, 5 alerts, 4 chart/screenshot), so it is justified by breadth of functionality rather than padding. Still, some consolidation (e.g. a single draw tool with a type parameter, or merging get_drawing into list_drawings) could trim the set.

    Completeness4/5

    Drawings have full lifecycle (multiple create types, list, get, remove, clear) and alerts have near-complete CRUD plus fired-history, with data reads, pivots, screenshots, and chart state all covered. Notable gaps: no way to edit/move an existing drawing (only delete and redraw), no alert enable/disable toggle despite 'active' being listed, and no tool to change the chart symbol (only timeframe), which agents might expect on a trading server. These are workable around but real.

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables Claude to control and read from the TradingView Desktop app, providing automated morning briefs, chart analysis, Pine Script development, and replay mode.
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables Claude to control TradingView Desktop for automated morning briefs, chart analysis, Pine Script development, and session management via MCP tools.
      88 npm
      -
    • F
      license
      Not graded
      quality
      C
      maintenance
      Enables AI assistants to connect to a locally running TradingView Desktop app to analyze charts, develop Pine Scripts, navigate symbols and timeframes, draw annotations, manage alerts, and automate chart workflows.
      88 npm
      -