How tradesdontlie/tradingview-mcp works
TradingView MCP Bridge exposes a local TradingView Desktop chart to AI assistants through MCP tools and a matching JSON-output CLI. The main workflow is a request routed through either interface to domain operations, which inspect or control the chart over CDP and return results. Distinct capabilities include chart navigation, data analysis, Pine development, drawings and alerts, replay, panes and tabs, and streaming. Sampled source supports the interface wiring and CDP boundary; some domain links are based on README descriptions because their implementations were not excerpted.
Main entry points: connection.js CDP connection · server.js MCP server · router.js Command router · data.js Chart data
Components 24
User interfaces
- MCP server
src/server.js - CLI commands
src/cli/index.js - Command router
src/cli/router.js - Data tools
src/tools/data.js - Pine tools
src/tools/pine.js - Chart tools
src/tools/chart.js
Chart and data
- Chart control
src/core/chart.js - Chart data
src/core/data.js - Indicators
src/core/indicators.js
Chart workflows
- Pine development
src/core/pine.js - Drawings and alerts
src/core/drawing.js - Replay practice
src/core/replay.js - Pane layouts
src/core/pane.js - Tab management
src/core/tab.js - Watchlists
src/core/watchlist.js - Chart streaming
src/core/stream.js - UI automation
src/core/ui.js - Screenshots
src/core/capture.js
Local runtime
- Connection health
src/core/health.js - CDP connection
src/connection.js - Chart readiness
src/wait.js
Other components
- AI assistant
- CLI user
- TradingView Desktop
Connections 27
- AI assistant → MCP server: requests tools
README.md - CLI user → CLI commands: runs commands
README.md - CLI commands → Command router: dispatches commands
src/cli/index.js - MCP server → Data tools: registers tools
src/server.js - MCP server → Pine tools: registers tools
src/server.js - MCP server → Chart tools: registers tools
src/server.js - Data tools → Chart data: calls
src/tools/data.js - Pine tools → Pine development: calls
src/tools/pine.js - Chart tools → Chart control: calls
src/tools/chart.js - Command router → Chart control: dispatches chart commands
src/cli/commands/chart.js - Command router → Chart data: dispatches data commands
src/cli/commands/data.js - Command router → Pine development: dispatches Pine commands
src/cli/commands/pine.js - Chart control → CDP connection: evaluates chart state
src/core/chart.js - Chart data → CDP connection: reads chart data
src/core/data.js - Chart data → Chart readiness: waits for readiness
src/core/data.js - Pine development → CDP connection: controls editor
src/core/pine.js - Indicators → CDP connection: accesses chart
src/core/indicators.js - Drawings and alerts → CDP connection: controls drawings
README.md - Replay practice → CDP connection: controls replay
README.md - Pane layouts → CDP connection: controls panes
README.md - Tab management → CDP connection: controls tabs
README.md - Watchlists → CDP connection: manages watchlist
README.md - Chart streaming → CDP connection: polls chart
README.md - UI automation → CDP connection: drives interface
src/core/ui.js - Screenshots → CDP connection: captures screen
README.md - Connection health → CDP connection: checks connection
src/core/health.js - CDP connection → TradingView Desktop: communicates via CDP
README.md