tradingview-mcp
Provides tools for reading and controlling TradingView Desktop charts, including changing symbols, timeframes, fetching OHLCV bars, and capturing screenshots.
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 fetch the last 30 minute candles for EURUSD"
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
tradingview-mcp/ v0.1 ──────────────────────────────────────────────────A focused, type-safe MCP server that lets Claude Code (or any MCP-compatible client) drive a locally-running TradingView Desktop application — read chart state, change symbols and timeframes, fetch OHLCV bars, capture screenshots.
This project is not affiliated with, endorsed by, or associated with TradingView Inc. It is a personal-use bridge that interacts with your locally running TradingView Desktop application via the Chrome DevTools Protocol — the same standard debug interface built into Slack, VS Code, Discord, and every other Electron app.
Requires a valid TradingView subscription. This tool does not bypass, scrape, or circumvent any TradingView paywall or access control. Everything happens on your machine, against the TradingView Desktop instance you have already logged into and paid for.
All processing is local. No TradingView data is transmitted, stored, or redistributed by this tool. Your charts, your data, your machine.
TradingView's internal page API is undocumented. It can change between Desktop releases. Pin a working TradingView Desktop version if you want stability, and check theversion compatibility note before upgrading.
What it does
Wraps the TradingView Desktop chart in a small set of well-defined MCP tools. Tools are typed end-to-end with Zod schemas, validated at the boundary, and surface useful error messages when something goes wrong.
┌───────────────┐
│ Claude Code │
│ (or any MCP │
│ client) │
└───────┬───────┘
│ stdio (MCP)
▼
┌───────────────┐
│tradingview-mcp│
└───────┬───────┘
│ Chrome DevTools Protocol
▼
┌───────────────┐
│ TradingView │
│ Desktop │
│ (--remote- │
│ debugging- │
│ port=9222) │
└───────────────┘Related MCP server: TradingView MCP Jackson
Why another TradingView integration?
Existing TradingView automation projects exist. This one is deliberately scoped down:
12 tools, not 78. Every tool is documented, typed, and tested.
Strict TypeScript. No
any, no implicit returns,noUncheckedIndexedAccesson.One responsibility per file. Connection, page, tools, and server are separate layers — version drift only requires fixing one spot.
Typed errors.
ConnectionError,ToolExecutionError,ChartStateErroretc. with actionable messages.tradingview-mcp doctor. A diagnostic command that tells you exactly what's wrong with your setup.
Use this if you want a small, predictable surface you can read in an afternoon. Use the kitchen-sink alternatives if you want every TradingView feature wrapped.
Install
Requires Node.js 20+.
npm install -g tradingview-mcp
# or, in a project:
npm install tradingview-mcpFor development:
git clone https://github.com/harshil1502/tradingview-mcp.git
cd tradingview-mcp
npm install
npm run buildSetup — three steps
1. Quit any running TradingView Desktop
Otherwise the debug port can't be enabled.
2. Launch TradingView Desktop with the debug port enabled
macOS:
open -a "TradingView" --args --remote-debugging-port=9222Windows:
& "C:\Users\<you>\AppData\Local\Programs\TradingView\TradingView.exe" --remote-debugging-port=9222Linux:
tradingview --remote-debugging-port=9222The--remote-debugging-port flag is a standard Chromium debug flag. It is opt-in and disabled by default. Nothing happens without you explicitly passing it.
3. Verify the connection
tradingview-mcp doctorIf everything is wired up, you'll see something like:
tradingview-mcp · doctor
─────────────────────────────────────────────
[ok] CDP endpoint reachable on localhost:9222
[ok] TradingView page found (NASDAQ:AAPL · 1h)
[ok] tvWidget detected — chart state readable
─────────────────────────────────────────────
ready.Use with Claude Code
Add this to your Claude Code MCP config (~/.claude/mcp.json or project .mcp.json):
{
"mcpServers": {
"tradingview": {
"command": "tradingview-mcp",
"env": {
"TV_MCP_PORT": "9222"
}
}
}
}Restart Claude Code. The tools below will be available.
Tools
Tool | Description |
| Read current symbol, timeframe, visible studies, last price |
| Change the active symbol (e.g. |
| Change resolution ( |
| Fetch up to 5,000 most-recent OHLCV bars from the active chart |
More tools coming — see docs/roadmap.md.
Example session
You: What's the chart showing?
Claude: [calls chart_get_state]
Showing NASDAQ:AAPL on 1h timeframe with EMA20, EMA50.
Last price 187.42.
You: Switch to BTCUSDT 4h and pull the last 200 bars.
Claude: [calls chart_set_symbol, chart_set_timeframe, chart_get_ohlcv]
Done. Range: 187 days. Open at start: 62,440.
Close at end: 67,830. +8.6%.Configuration
Env var | Default | Description |
|
| CDP host |
|
| CDP debug port |
| (auto-detect) | Explicit CDP target ID — only needed if you have multiple TradingView windows open |
Development
npm install
npm run build # tsc to dist/
npm run dev # tsc --watch
npm test # vitest run
npm run test:coverage # with v8 coverage report
npm run typecheck # tsc --noEmitThe codebase has four layers:
src/
├── index.ts entry — reads env, starts stdio server
├── server.ts MCP server, tool registration, request handlers
├── errors.ts typed error classes
├── types.ts shared types + Zod schemas
├── connection/
│ ├── cdp.ts CDP client wrapper (chrome-remote-interface)
│ └── tradingview.ts TradingView-page interactions (all evaluated JS lives here)
└── tools/
├── index.ts tool registry
└── chart.ts chart_* toolsTo add a tool:
Create a new file under
src/tools/(or extend an existing one).Export
<name>Inputand<name>OutputZod schemas plus the handler function.Add the entry to
TOOLSinsrc/tools/index.ts.Add a test under
tests/.
That's it — auto-registered, auto-validated, auto-introspectable.
Version compatibility
TradingView Desktop | tradingview-mcp | Status |
2026.x.x | 0.1.x | Tested |
If TradingView updates and tools start failing, check connection/tradingview.ts first — that's the single file that knows about TradingView's internal API.
Disclaimer
This software is provided "as is" without warranty of any kind. By running it, you acknowledge:
You are using your own paid TradingView Desktop instance, against your own data.
You enabled the Chrome DevTools debug port yourself.
TradingView's internal API is undocumented and may break.
Nothing in this software guarantees correctness of trading decisions made by an AI agent on top of it. Use it on a paper account before letting it touch real capital.
License
MIT © 2026 Harshil Patel
Acknowledgments
This is a fresh implementation — built from scratch with the goal of being small, well-typed, and easy to read. If you've worked on similar tools in this space, thanks for paving the way.
Available Tools
11 toolschart_get_ohlcvB
Fetch recent OHLCV bars from the active chart.
Inputs: count.
chart_get_stateA
Read the current chart state: symbol, timeframe, visible studies, and last price.
Inputs: no named parameters.
chart_set_symbolB
Change the active chart symbol (e.g. "NASDAQ:AAPL").
Inputs: symbol (required).
chart_set_timeframeB
Change the active chart timeframe / resolution.
Inputs: timeframe (required).
pine_compileB
Trigger a Pine compile and return diagnostics (errors, warnings).
Inputs: no named parameters.
pine_get_sourceA
Read the current Pine Editor source code. Pine Editor must be open.
Inputs: no named parameters.
pine_saveA
Save the current Pine script (commits + reloads the indicator on the chart).
Inputs: no named parameters.
pine_set_sourceB
Replace the Pine Editor source code with new content.
Inputs: code (required).
quote_getA
Get a real-time quote snapshot for the active symbol (last price, day OHLC, volume).
Inputs: no named parameters.
screenshot_chartA
Capture the chart pane as a base64-encoded PNG.
Inputs: no named parameters.
screenshot_fullA
Capture the full TradingView viewport as a base64-encoded PNG.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Each tool has a clearly distinct purpose. The chart_* tools handle different aspects of chart interaction, pine_* tools manage Pine script editing and compilation, screenshot_* tools capture images, and quote_get fetches real-time quotes. No overlapping functionality.
Tool names follow a consistent pattern: <domain>_<verb>_<noun> (e.g., chart_get_ohlcv, pine_set_source, screenshot_chart). All use lowercase with underscores, and the verb-noun structure is uniform across domains.
With 11 tools, the server is well-scoped for a TradingView MCP. It covers chart manipulation, Pine scripting, quotes, and screenshots without being bloated or too sparse.
The tool set covers core workflows like symbol/timeframe changes, data retrieval, Pine script management, and screenshots. A minor gap is the lack of tools to add or remove studies (only visible studies are read), but this does not severely hinder typical use cases.
Maintenance
Related MCP Connectors
Trading MCP server for AI agents, with live market data, account reads and controlled execution.
MCP server for OpenMM — exposes market data, account, trading, and strategy tools to AI agents
> TradingMCP puts a market analyst inside your AI assistant. Paste one URL into Claude, ChatGPT, Cursor, VS Code or any MCP client and ask in plain language: screen for breakouts, run a multi-timeframe analysis, backtest a strategy with walk-forward validation, scan for smart-money and volume signals, or get a one-prompt morning market brief. In clients that support MCP Apps, price charts and the Markets panel are drawn right in the chat. > 40+ tools covering crypto (real-time), stocks, ETFs, FX, futures and commodities across major global exchanges. > Hosted, nothing to install: Pro $9/month (2,500 tool calls) or Pro+ $29/month (10,000). Paid upfront with a 14-day money-back guarantee; your API key arrives right after checkout. > Built on the open-source tradingview-mcp core (MIT, ~5k GitHub stars): self-host it free, or use the hosted version with zero ops. > For research and education, not financial advice. Not affiliated with TradingView
Official Intrinio MCP server. US stock prices, options and fundamentals for AI agents.
Related MCP Servers
- AlicenseBqualityAmaintenanceMCP server that lets AI agents directly control and interact with the TradingView desktop app via 88 chart-control tools, enabling automated chart reading, Pine Script compilation, strategy optimization, and replay control.11347 npm60MIT
- 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.91 npm-
- AlicenseAqualityDmaintenanceA Codex-first MCP server that bridges TradingView Desktop via Chrome DevTools Protocol, enabling launch, symbol/timeframe control, and health checks from Codex CLI.54MIT
- 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