How to Connect TradingView with Claude via MCP

Read Time: 5-6 minutes
In early 2026, an open-source Model Context Protocol (MCP) was released to connect TradingView directly to Claude Code, giving you access to technical analysis, chart control, and workflow automation through a conversational interface, without having to click through menus manually.
This article walks you through how to connect Claude Code to TradingView using this open-source MCP.
Before you start, it’s worth understanding the risks that come with using an open-source server.
Local system security: The server connects via Chrome DevTools Protocol (localhost:9222). If compromised, it could interact with your machine.
Code injection: Vulnerabilities exist for injection attacks through crafted tool inputs.
Data leakage: Tool outputs could unintentionally expose information from your session.
Terms of service: Programmatic control of TradingView, even via local desktop, may conflict with their official Terms of Use.
Note: This tool is not affiliated with, endorsed by, or associated with TradingView. It interacts with your locally running TradingView Desktop application via the Chrome DevTools Protocol.
The TradingView MCP is an open-source server that acts as a bridge between Claude and TradingView. This server lets Claude read your TradingView session and carry out operations such as analysing charts, applying indicators, and responding to your requests through a conversational interface.
Rather than clicking through menus manually, you can type “show me the RSI on the EUR/USD 4-hour chart” and get the result directly.
This MCP is part of a broader shift towards agentic AI tools that don’t just answer questions but execute tasks on TradingView. For traders, that means Claude can do more than just explain what the chart shows; it can act on it.
Step 1: Before you start, make sure all the prerequisites below are fulfilled
Node.js installed (v18 or higher)
Claude Code with MCP support
TradingView Desktop app
Paid subscription to TradingView (to receive real-time data)
Step 2: Clone TradingView MCP Server from GitHub
Run the following commands in your terminal to clone the server:
git clone https://github.com/tradesdontlie/tradingview-mcp.git
cd tradingview-mcp
npm install
Step 3: Launch TradingView in Debug Mode
The TradingView Desktop app must run with CDP enabled on port 9222. Use the provided scripts:
Mac: ./scripts/launch_tv_debug_mac.sh
Windows: scripts\launch_tv_debug.bat
Linux: ./scripts/launch_tv_debug_linux.sh
Or launch manually on any platform:
/path/to/TradingView --remote-debugging-port=9222
Step 4: Configure your MCP client
Add the following to Claude Code config (~/.claude/.mcp.json or project-level .mcp.json):
{
"mcpServers": {
"tradingview": {
"command": "node",
"args": ["/path/to/tradingview-mcp/src/server.js"]
}
}
}
Replace “/path/to/tradingview-mcp/src/server.js” with the actual path where the file server.js is located.
Step 5: Verify connection status
Restart Claude Code. Then ask Claude: “Use tv_health_check to verify that TradingView is connected.
Step 6: Test your connection with a sample query
To confirm the connection is working, try a simple query: “Get the current price and RSI for BTCUSDT on the 1-hour chart.”
Claude will call the MCP tool and return live data from your TradingView session.
When connecting to an external AI agent via an MCP, it is recommended to set permissions to read-only first. You should grant execution permissions (e.g., modifying Pine Script) once you're comfortable with how the AI Assistant responds to your requests.
Once connected, Claude can handle a range of tasks directly within TradingView. Here are a few examples of what’s possible:
1. Chart Analysis
Describe the chart you’re looking at and ask Claude for a structured read: “Analyse the AUD/USD daily chart and identify the dominant trend and any notable patterns.”
Claude will read the current chart data in your TradingView session and return a plain-English summary, including the trends and patterns it identifies.
2. Indicator Queries
Rather than adding indicators manually from the library, you can ask Claude: “Add a 200-period EMA and a MACD to the current chart, and tell me whether they suggest bullish or bearish momentum.”
Claude will apply the indicators and interpret them in one step without requiring any tool switching.
3. Alert & Watchlist Management
Ask Claude: “Check my current alerts. If there’s an alert for XAUUSD below $4,700, cancel it and create a new alert when XAUUSD falls below $4,600.”
Claude will interact with TradingView’s alert system, check the conditions you’ve specified, and set up the new alert. It can also review, list, or delete existing alerts, which will be useful for keeping your alerts manager clean.
Claude can also read and modify your watchlists, scan across hundreds of symbols, and run a bulk analysis. This can help save a significant amount of time compared to reviewing each position manually.
If you are using Pine Script on TradingView, this is one of the strongest use cases for TradingView MCP. Claude can meaningfully accelerate your Pine Script workflow through the following capabilities:
1. Generating Code with Context
When you ask Claude to write Pine Script, it has visibility of the chart currently open in your TradingView session. The code it produces is tailored to that chart, not just a generic template.
2. Debugging Existing Scripts
Paste your Pine Script code into the chat, and Claude can help you identify errors, suggest improvements, or walk through what each section does. This is particularly useful if you’ve received a script from someone else or are still working through the Pine Script learning curve.
3. Iterative Refinement
You can refine your strategy through a back-and-forth conversation. Start with a basic idea, implement it, request a modification such as adding a stop-loss, implement the modification, then request further changes, all within the same chat session.
Here’s an example request: “Here is my current script. This strategy works well in trending markets but not in ranging ones. Could you add a filter that checks the ADX and avoids entries when the ADX value is below 25?”
That kind of targeted edit takes considerably less time than working through documentation or community forums.
The TradingView MCP is a useful addition to a trader’s workflow, but there are a few common mistakes worth knowing about before you start.
Overreliance on AI-written code
Always review AI-generated code before using it. Claude can make mistakes in strategy logic, particularly around order sizes or stop placement, that are easy to miss if you don’t read through the output carefully.
Not testing your strategy before going live
Even if a strategy looks sound, run it through TradingView’s Strategy Tester before going live. It’s a straightforward way to see how the strategy holds up across different market conditions.
Accepting an analysis without questioning it
Claude can be confident and wrong. If an analysis confirms your existing view, it does not mean you should act without further scrutiny. Ask Claude to consider the opposite scenario or identify what could invalidate the analysis.
Poor permissions management
Grant only the permissions Claude needs for the task at hand. Review your connections periodically and remove any you’re no longer using. Do not share your TradingView login credentials with any third-party application.
Lacking market data
Claude can only work with what you provide it with. If you’re only sharing data from one timeframe or one asset, its analysis will be limited to that scope. Where it matters, provide a broader context, such as multiple timeframes and related instruments, to get a more complete read.
By providing a connection between TradingView and Claude, this open-source MCP can make your workflow more efficient, but it is not a substitute for your own trading judgment. In addition, The open-source risks outlined above are real and worth weighing before you proceed. We recommend using this tool only if you’re comfortable with those trade-offs.
Once the connection is in place, you will have a context-aware AI assistant that can read your charts, apply indicators, manage alerts, and support your Pine Script work through a conversational interface. The traders who will get the most from this are likely those who use it to extend what they already know, such as delegating the repetitive work, so they can focus on the decisions that matter.
If you’re ready to get started, the steps above are everything you need. Connect your TradingView account to Claude Code and take it from there.
We’ll never share your email with third-parties. Opt-out anytime.