Skip to main content
Glama
tradingview-mcp-codex

tradingview-mcp-codex

tradingview-mcp-codex

Connect Codex to your TradingView Desktop chart. Control symbols, timeframes, indicators, and screenshots via AI or CLI.

Not affiliated with TradingView Inc. Interacts only with your locally running TradingView Desktop app via Chrome DevTools Protocol.

Requires a valid TradingView subscription. Does not bypass any paywall or access control.

All processing is local. No chart data leaves your machine.


Prerequisites

  • Node.js 18+

  • TradingView Desktop installed (paid subscription)

  • Codex CLI with MCP support


Related MCP server: TradingView MCP Jackson

Install

git clone https://github.com/gagahkharismanuary/tradingview-mcp-codex.git
cd tradingview-mcp-codex
npm install

Step 1: Launch TradingView with debug port

TradingView must run with Chrome DevTools Protocol enabled on port 9222.

Mac (auto):

npm run launch

Mac (manual):

/Applications/TradingView.app/Contents/MacOS/TradingView --remote-debugging-port=9222

Windows:

"%LOCALAPPDATA%\TradingView\TradingView.exe" --remote-debugging-port=9222

Linux:

tradingview --remote-debugging-port=9222

Verify connection:

npm run health

Expected:

{
  "success": true,
  "cdp_connected": true,
  "chart_symbol": "BTCUSD"
}

Step 2: Register with Codex

codex mcp add tradingview-codex -- node /path/to/tradingview-mcp-codex/src/server.js

Replace /path/to/tradingview-mcp-codex with where you cloned. To find it:

pwd  # run inside the repo folder

Verify:

codex mcp list
codex mcp get tradingview-codex

Restart Codex after adding — tools load on session start.


Step 3: Verify in Codex

Ask Codex to call tvx_health_check. Expected:

{
  "success": true,
  "cdp_connected": true,
  "chart_symbol": "BTCUSD",
  "api_available": true
}

MCP Tools

Tool

What it does

tvx_health_check

Check CDP connection and chart status

tvx_launch

Launch TradingView Desktop with debug port

tvx_chart_state

Get symbol, timeframe, chart type, and indicator list

tvx_set_symbol

Change chart symbol

tvx_set_timeframe

Change chart timeframe

tvx_set_chart_type

Change chart type (Candles, Line, HeikinAshi, etc.)

tvx_manage_indicator

Add or remove an indicator

tvx_symbol_search

Search symbols by name or keyword

tvx_screenshot

Capture a screenshot of the chart


CLI

Install tvx globally (optional):

npm link
tvx status                                        # health check
tvx launch                                        # launch TradingView
tvx state                                         # get chart state
tvx symbol AAPL                                   # change symbol
tvx timeframe 15                                  # change timeframe (1, 5, 15, 60, D, W)
tvx charttype HeikinAshi                          # change chart type
tvx indicator add "Relative Strength Index"       # add indicator (full name required)
tvx indicator remove <entity_id>                  # entity_id from tvx state output
tvx search bitcoin                                # search symbols
tvx screenshot chart                              # capture chart (full, chart, strategy_tester)

Without npm link:

node src/cli/index.js symbol AAPL

Troubleshooting

Problem

Fix

cdp_connected: false

Launch TradingView with --remote-debugging-port=9222

ECONNREFUSED

TradingView not running or port 9222 blocked

Tools missing in Codex

Restart Codex after codex mcp add

tvx command not found

Run npm link inside the repo folder

Indicator add fails

Use full name: "Relative Strength Index" not "RSI"


One-liner Codex install prompt

Paste into Codex and it will handle the rest:

Clone https://github.com/gagahkharismanuary/tradingview-mcp-codex.git, run npm install, register with codex mcp add tradingview-codex -- node <path>/src/server.js, then verify with tvx_health_check.


Credits

Built on top of tradesdontlie/tradingview-mcp — a TradingView MCP server for Claude Code that connects AI agents to TradingView Desktop via Chrome DevTools Protocol. Core architecture, CDP connection patterns, chart API bindings, and tool designs are derived from that work. This project adapts and extends it for Codex workflows.

Licensed MIT. Copyright (c) 2026 tradesdontlie.

Available Tools

5 tools
tvx_chart_stateA

Get current chart symbol, timeframe, and type

Inputs: no named parameters.

tvx_health_checkB

Check TradingView CDP connection and current chart state

Inputs: no named parameters.

tvx_launchA

Launch TradingView Desktop with remote debugging enabled

Inputs: port, killExisting.

tvx_set_symbolC

Set TradingView chart symbol

Inputs: symbol (required).

tvx_set_timeframeC

Set TradingView chart timeframe

Inputs: timeframe (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: launch, health check, get chart state, set symbol, set timeframe. No overlap or ambiguity.

    Naming Consistency4/5

    All tools use the 'tvx_' prefix, but the pattern varies: 'tvx_launch' is just a verb, while others combine verb+noun or are noun phrases. Still mostly predictable.

    Tool Count5/5

    Five tools is well-scoped for a TradingView chart control MCP server. Each tool serves a core function without redundancy.

    Completeness4/5

    Covers essential chart operations (launch, health check, get/set symbol and timeframe). Minor gaps like indicator manipulation or data retrieval, but core workflow is complete.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    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