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 "Install 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-codexSet 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
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.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/gagahkharismanuary/tradingview-mcp-codex'
If you have feedback or need assistance with the MCP directory API, please join our Discord server