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 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
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided; description states it's a read operation ('Get') but does not disclose any side effects, authentication requirements, or rate limits. Adequate but minimal for a simple getter.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single concise sentence that efficiently communicates the tool's purpose without any unnecessary words or length.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Description does not specify the return format or structure of the output (e.g., object fields). Given no output schema, additional detail would improve completeness.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
No parameters exist in the schema, so description does not need to add meaning beyond schema; baseline 4 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb 'Get' and lists the resources 'current chart symbol, timeframe, and type', clearly distinguishing it from sibling tools like tvx_set_symbol (sets) and tvx_set_timeframe (sets).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit guidance on when to use this tool vs alternatives. However, being a read operation, it's implied for retrieving current state, but no exclusions or alternatives are mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
tvx_health_checkB
Check TradingView CDP connection and current chart state
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries full burden. Only states 'Check', implying read-only, but does not confirm safety, latency, side effects, or whether it modifies anything.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single short sentence. No waste. Front-loaded with key action and targets.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Simple tool with no parameters and no output schema. Description covers both connection and chart state. Lacks specifics on return format or when to invoke, but adequate for a health check.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
No parameters defined. Schema coverage is 100% (vacuous). Description adds no parameter meaning, but baseline for 0 parameters is 4.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clear verb 'Check' and specific resources ('TradingView CDP connection' and 'current chart state'). Distinguishes from sibling tvx_chart_state, which likely only handles chart state, but no explicit differentiation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool vs alternatives (e.g., tvx_chart_state for chart state alone). No mention of prerequisites or typical usage context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
tvx_launchA
Launch TradingView Desktop with remote debugging enabled
| Name | Required | Description | Default |
|---|---|---|---|
| port | No | CDP port, default 9222 | |
| killExisting | No | Kill existing TradingView processes first |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description mentions 'remote debugging enabled' which hints at a behavioral trait, but it does not disclose what happens if TradingView is already running, permissions required, or the impact of killExisting. No annotations are provided, so the description partially carries the transparency burden. A score of 3 reflects basic transparency with room for improvement.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single concise sentence with no unnecessary words. It is front-loaded and efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool is simple with two optional parameters and no output schema. The description is minimally adequate but does not address prerequisites (e.g., TradingView installation), failure behavior, or what the return value indicates. A score of 3 captures acceptable but not thorough completeness.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema covers 100% of parameters with descriptions, so the baseline is 3. The description adds the context of 'remote debugging' but does not enhance understanding of individual parameters beyond what the schema provides.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Launch TradingView Desktop with remote debugging enabled'. It uses a specific verb ('Launch') and resource ('TradingView Desktop'), and the sibling tools handle different tasks (chart state, health check, symbol, timeframe), so it is well-distinguished.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives (e.g., when remote debugging is needed, prerequisites, or scenarios where other tools are more appropriate). The description lacks context for decision-making.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
tvx_set_symbolC
Set TradingView chart symbol
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | Symbol or exchange-prefixed symbol |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description bears full responsibility. It fails to disclose what 'set' entails (e.g., changes current chart symbol, requires open chart, persistence). Behavioral traits are minimally conveyed.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is one short sentence with no wasted words. It front-loads the core function, though more detail could be added without sacrificing conciseness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with no annotations and one parameter, the description is under-specified. It lacks information on prerequisites, side effects, or return values, leaving significant gaps in contextual understanding.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% for the single 'symbol' parameter. The description adds no extra meaning beyond the schema, which already describes the parameter format. Baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'Set TradingView chart symbol' clearly states the tool's action and resource. It distinguishes from sibling tools like tvx_chart_state (get state) and tvx_set_timeframe (set timeframe) by focusing on symbol setting.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives. Sibling tools exist but are not mentioned. The description does not specify prerequisites or context for usage.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
tvx_set_timeframeC
Set TradingView chart timeframe
| Name | Required | Description | Default |
|---|---|---|---|
| timeframe | Yes | Timeframe like 1, 5, 15, 1D |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are present. The description only states the action without disclosing behavioral traits like side effects, required chart state, or data loading implications. For a mutation tool, this lack of transparency is a significant gap.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence with no waste. It is appropriately concise for a simple tool. However, it lacks structure (e.g., separate sections) and could include brief usage hints without compromising conciseness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (one required parameter, no output schema), the description is minimally adequate. However, it omits behavioral context and usage guidelines that would help an agent use it correctly in dynamic scenarios.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% coverage with a clear parameter 'timeframe' and example values ('1, 5, 15, 1D'). The description adds no extra meaning beyond the schema, so it meets the baseline of 3 without adding value.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'Set TradingView chart timeframe' clearly states the verb (Set) and resource (TradingView chart timeframe). It is specific and easily understood. However, it does not differentiate from sibling tools like tvx_chart_state, which might also modify chart settings, leaving a minor ambiguity.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives such as tvx_chart_state or tvx_set_symbol. There is no mention of prerequisites, typical use cases, or exclusions, leaving the agent without context for selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
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
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
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
MCP server exposing the Backtest360 engine API as tools for AI agents.
A paid remote MCP for OpenAI Codex agent coordination MCP, built to return verdicts, receipts, usage
Related MCP Servers
- AlicenseAqualityCmaintenanceA 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.115521MIT
- 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.552
- 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.441MIT
- FlicenseNot gradedqualityBmaintenanceMCP server that connects AI assistants to TradingView Desktop via Chrome DevTools Protocol, enabling chart analysis, Pine Script development, and workflow automation through natural language.552
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- 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