tradingview-mcp-codex
This server connects TradingView Desktop to AI assistants (like Codex) or CLIs via the Chrome DevTools Protocol, enabling programmatic control over chart functionalities:
Check connection/chart state: Verify the CDP connection is active and retrieve the current chart status.
Launch TradingView: Start TradingView Desktop with remote debugging enabled, with options for CDP port and killing existing processes.
Get chart details: Retrieve the current symbol, timeframe, chart type, and active indicators.
Change symbol: Switch the chart to a different trading symbol (e.g., AAPL, BTCUSD), with exchange-prefix support.
Adjust timeframe: Change the chart's timeframe (e.g., 1, 5, 15, 1D).
Modify chart type: Switch between types such as Candles, Line, or HeikinAshi.
Manage indicators: Add new indicators or remove existing ones from the chart.
Search symbols: Look up trading symbols by name or keyword.
Capture screenshots: Take screenshots of the chart or specific sections of the TradingView application.
Provides tools to control TradingView Desktop via Chrome DevTools Protocol, allowing symbol and timeframe changes, chart state queries, and launch management.
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., "@tradingview-mcp-codex Set symbol to BTCUSD on 15-minute chart"
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.
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 installStep 1: Launch TradingView with debug port
TradingView must run with Chrome DevTools Protocol enabled on port 9222.
Mac (auto):
npm run launchMac (manual):
/Applications/TradingView.app/Contents/MacOS/TradingView --remote-debugging-port=9222Windows:
"%LOCALAPPDATA%\TradingView\TradingView.exe" --remote-debugging-port=9222Linux:
tradingview --remote-debugging-port=9222Verify connection:
npm run healthExpected:
{
"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.jsReplace /path/to/tradingview-mcp-codex with where you cloned. To find it:
pwd # run inside the repo folderVerify:
codex mcp list
codex mcp get tradingview-codexRestart 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 |
| Check CDP connection and chart status |
| Launch TradingView Desktop with debug port |
| Get symbol, timeframe, chart type, and indicator list |
| Change chart symbol |
| Change chart timeframe |
| Change chart type (Candles, Line, HeikinAshi, etc.) |
| Add or remove an indicator |
| Search symbols by name or keyword |
| Capture a screenshot of the chart |
CLI
Install tvx globally (optional):
npm linktvx 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 AAPLTroubleshooting
Problem | Fix |
| Launch TradingView with |
| TradingView not running or port 9222 blocked |
Tools missing in Codex | Restart Codex after |
| Run |
Indicator add fails | Use full name: |
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 toolstvx_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
Scored across 5 tools
Each tool has a clearly distinct purpose: launch, health check, get chart state, set symbol, set timeframe. No overlap or ambiguity.
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.
Five tools is well-scoped for a TradingView chart control MCP server. Each tool serves a core function without redundancy.
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
Related MCP Connectors
Trading MCP server for AI agents, with live market data, account reads and controlled execution.
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
MCP server for Gainium — manage trading bots, deals, and balances via AI assistants
MCP server for OpenMM — exposes market data, account, trading, and strategy tools to AI agents
Related MCP Servers
- AlicenseAqualityDmaintenanceA 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.1188 npm1MIT
- FlicenseNot gradedqualityDmaintenanceAn MCP server that connects to TradingView Desktop via Chrome DevTools Protocol, enabling chart control, Pine Script development, and a morning brief workflow with AI-driven analysis.88 npm-
- AlicenseNot gradedqualityAmaintenanceA local MCP server that connects TradingView Desktop to AI assistants via Chrome DevTools Protocol, enabling Pine Script development, multi-timeframe analysis, and Wyckoff scanning with a rules engine.44 npm1MIT
- FlicenseNot gradedqualityDmaintenanceMCP server that connects AI assistants to TradingView Desktop via Chrome DevTools Protocol, enabling chart analysis, Pine Script development, and workflow automation through natural language.88 npm-