Logo: Tradingview MCP

Tradingview MCP

Communautéit
pueschel88

Tradingview MCP server for controlling Tradingview Desktop from Claude Code via Chrome DevTools Protocol

Editeurpueschel88
RepositoryTradingview-MCP
SproochTypeScript
Forks
312
Stären
132
Disponibel Tools
0
Transporttypstdio
Kategorien
LizenzMIT
Linken
  • Tools mat KI-Workflows verbannen

    Tradingview MCP bitt MCP-Funktiounen un, déi vu kompatibele KI-Clienten a KI-Agente kënne benotzt ginn.

  • Disponibel Tools: 0

    Kuckt Iech déi opruffbar Aktiounen hei drënner un, mat Nimm a Beschreiwungen, wa se vum Server geliwwert ginn.

  • Konfiguratioun fir ze kopéieren

    Benotzt d'Installatiounsbeispiller, fir dëse Server an deem MCP-Client ze konfiguréieren, deen Dir am léifste benotzt.

  • Interessi vun der Communautéit um Open-Source-Projet

    Zuele vum verlinkte Repository – Stären: 132, Forks: 312.

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.

[!IMPORTANT] 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.

[!IMPORTANT] 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.

[!NOTE] All processing is local. No TradingView data is transmitted, stored, or redistributed by this tool. Your charts, your data, your machine.

[!CAUTION] 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 the version 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)   │
                  └───────────────┘

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, noUncheckedIndexedAccess on.
  • One responsibility per file. Connection, page, tools, and server are separate layers — version drift only requires fixing one spot.
  • Typed errors. ConnectionError, ToolExecutionError, ChartStateError etc. 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

For development:

bash
git clone https://github.com/pueschel88/Tradingview-MCP.git
cd Tradingview-MCP
npm install
npm run build

Redis (optional, recommended)

Read tools (chart_get_state, quote_get, chart_get_ohlcv) are cached in a local Redis instance to reduce CDP round-trips. Redis is enabled by default and connects to 127.0.0.1:6379.

Windows (Docker):

powershell
docker run -d --name redis -p 6379:6379 redis:7-alpine

macOS (Homebrew):

bash
brew install redis
brew services start redis

If Redis is not running, the server still works — it logs a warning and skips caching. Set TV_MCP_REDIS_ENABLED=false to disable Redis entirely.


Setup — 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:

bash
open -a "TradingView" --args --remote-debugging-port=9222

Windows:

powershell
& "C:\Users\<you>\AppData\Local\Programs\TradingView\TradingView.exe" --remote-debugging-port=9222

Linux:

bash
tradingview --remote-debugging-port=9222

[!NOTE] The --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

bash
tradingview-mcp doctor

If 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):

json
{
  "mcpServers": {
    "tradingview": {
      "command": "tradingview-mcp",
      "env": {
        "TV_MCP_PORT": "9222",
        "TV_MCP_REDIS_HOST": "127.0.0.1",
        "TV_MCP_REDIS_PORT": "6379"
      }
    }
  }
}

Restart Claude Code. The tools below will be available.


Tools

ToolDescription
chart_get_stateRead current symbol, timeframe, visible studies, last price
chart_set_symbolChange the active symbol (e.g. NASDAQ:AAPL, NSE:RELIANCE)
chart_set_timeframeChange resolution (1m, 5m, 1h, 1d, etc.)
chart_get_ohlcvFetch 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 varDefaultDescription
TV_MCP_HOSTlocalhostCDP host
TV_MCP_PORT9222CDP debug port
TV_MCP_TARGET(auto-detect)Explicit CDP target ID — only needed if you have multiple TradingView windows open
TV_MCP_REDIS_ENABLEDtrueEnable local Redis caching for read tools
TV_MCP_REDIS_HOST127.0.0.1Redis host
TV_MCP_REDIS_PORT6379Redis port
TV_MCP_REDIS_PASSWORD(none)Redis password, if required
TV_MCP_REDIS_DB0Redis database index
TV_MCP_REDIS_KEY_PREFIXtradingview-mcp:Key prefix for cached entries
TV_MCP_REDIS_TTL_QUOTE5Quote cache TTL in seconds
TV_MCP_REDIS_TTL_STATE5Chart state cache TTL in seconds
TV_MCP_REDIS_TTL_OHLCV60OHLCV cache TTL in seconds

Development

bash
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 --noEmit

The 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)
│   ├── redis.ts          local Redis cache via oscar-redis
│   └── tradingview.ts    TradingView-page interactions (all evaluated JS lives here)
└── tools/
    ├── index.ts          tool registry
    └── chart.ts          chart_* tools

To add a tool:

  1. Create a new file under src/tools/ (or extend an existing one).
  2. Export <name>Input and <name>Output Zod schemas plus the handler function.
  3. Add the entry to TOOLS in src/tools/index.ts.
  4. Add a test under tests/.

That's it — auto-registered, auto-validated, auto-introspectable.


Version compatibility

TradingView Desktoptradingview-mcpStatus
2026.x.x0.1.xTested

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.

Installatioun

TypingMind
{
  "mcpServers": {
    "pueschel88-tradingview-mcp": {
      "command": "tradingview-mcp",
      "args": []
    }
  }
}

Tradingview MCP MCP mat verschiddene KI-Modeller benotzen

TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Soubal Tradingview MCP verbonnen ass, kënnt Dir et mat verschiddene KI-Modeller an TypingMind benotzen, amplaz et fir all Modell separat anzeriichten. Dës MCP-Integratioun leeft lokal iwwer den TypingMind-MCP-Connector op Ärem Apparat.

Ariichtungsuleedung, fir de lokale Connector ze benotzen

Benotzt dës Optioun, wann den MCP-Server Zougrëff op lokal Fichieren, Appen oder privat Ressourcen op Ärem Computer brauch.

1

D'MCP-Astellungen opmaachen

Gitt an TypingMind op „Astellungen“, „Erweidert Astellungen“, dann op „Model Context Protocol“ a wielt „Connector ariichten“.

  1. Maacht TypingMind an Ärem Browser op.
  2. Klickt op d'Astellungssymbol.
  3. Gitt op „Erweidert Astellungen“.
  4. Maacht d'Sektioun „Model Context Protocol“ op.
  5. Klickt op „Connector ariichten“ a wielt „Dësen Apparat“.
Ariichtungsbildschierm vum TypingMind-MCP-Connector: D'Optioun „Dësen Apparat“ ass ausgewielt
2

De Connector-Befeel ausféieren

Wielt „Dësen Apparat“, kopéiert de Befeel aus TypingMind a féiert en am Terminal aus. Loosst de Prozess lafen, wärend Dir MCP benotzt.

  1. Kopéiert den Ariichtungsbefeel, deen TypingMind uweist.
  2. Maacht Terminal op macOS oder Windows Terminal op Windows op.
  3. Setzt de kopéierte Befeel an a féiert en aus.
  4. Bestätegt d'Installatioun vum Package, wann den Terminal Iech freet, ob Dir weiderfuere wëllt.
  5. Loosst den Terminal an de Prozess doranner lafen, wärend Dir MCP-Tools benotzt.
3

Tradingview MCP als Server derbäisetzen

Wann de Connector-Status „Prett“ ass, klickt op „Serveren änneren“ a setzt d'MCP-Serverkonfiguratioun an.

  1. Waart, bis de Connector-Status „Prett“ weist.
  2. Klickt op „Serveren änneren“.
  3. Setzt d'MCP-Serverkonfiguratioun fir Tradingview MCP an.
  4. Späichert d'Serverlëscht.
  5. Aktualiséiert d'Säit, wann Dir kontrolléiere wëllt, ob de Connector nach ëmmer prett ass.
MCP-Astellunge vun TypingMind mat aktivem Server an dem Knäppchen „Serveren änneren“
{
  "mcpServers": {
    "pueschel88-tradingview-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "tradingview-mcp"
      ]
    }
  }
}
4

D'Verbindung mat verschiddene Modeller benotzen

Späichert d'Serverlëscht, maacht „Plugins“ op an aktivéiert d'MCP-Tools vun der Integratioun Tradingview MCP. Wielt dann e belibegen ënnerstëtzte KI-Modell an TypingMind a benotzt d'Tools am Chat oder weist se engem KI-Agent zou.

  1. Maacht d'Säit „Plugins“ an TypingMind op.
  2. Aktivéiert d'MCP-Tools vun der Integratioun Tradingview MCP.
  3. Start e Chat a wielt de KI-Modell, deen Dir benotze wëllt.
  4. Benotzt d'MCP-Tools am Chat oder weist se engem KI-Agent zou.
  5. Wiesselt bei Bedarf op en anere KI-Modell, ouni MCP nei ze verbannen.
TypingMind-Chat mat aktivéierten MCP-Tools an engem ausgewielte KI-Modell
Kënnt Dir mir mat Tradingview MCP bei dëser Aufgab hëllefen?
Tradingview MCP
Jo. Ech hunn et gelies.
Dat hunn ech mat Tradingview MCP fonnt.

Heefeg gestallte Froen

Fir wat gëtt den MCP-Server Tradingview MCP benotzt?

Tradingview MCP ass en MCP-Server, deen et kompatibele KI-Clienten erlaabt, op extern Tools a Kontextinformatioune zouzegräifen. An TypingMind kënnt Dir dësen MCP-Server eemol derbäisetzen a seng Tools an Ärem KI-Aarbechtsberäich zur Verfügung stellen.

Kann ech Tradingview MCP MCP mat méi KI-Modeller an TypingMind benotzen?

Jo. TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Sou kënnt Dir Tradingview MCP mat verschiddene KI-Modeller wéi Claude, ChatGPT, Gemini oder anere Modeller benotzen, déi Dir an TypingMind konfiguréiert hutt, ouni den MCP-Server fir all Modell separat anzeriichten.

Firwat Tradingview MCP MCP mat TypingMind benotzen?

TypingMind ass eng vun de beschte Benotzeruewerfläche fir LLM-Chat, well et méi KI-Modeller, Prompts, Plugins, KI-Agenten, API-Schlësselen a MCP-Tools an engem Aarbechtsberäich zesummebréngt. Wann Tradingview MCP verbonnen ass, kënnt Dir seng MCP-Tools mat Äre bevorzugte Modeller benotzen a gläichzäiteg Ären Aarbechtsoflaf beim Chatten an TypingMind organiséieren.

Wéi verbannen ech Tradingview MCP MCP mat TypingMind?

Tradingview MCP leeft iwwer de lokale MCP-Connector vun TypingMind. Dat eegent sech am beschten, wann den MCP-Server Zougrëff op lokal Fichieren, Desktop-Apps, Kommandozeilen-Tools oder privat Ressourcen op Ärem Computer brauch.

Wéi eng Tools stellt Tradingview MCP MCP an TypingMind zur Verfügung?

Tradingview MCP stellt MCP-Funktioune zur Verfügung, déi Dir op der Plugins-Säit vun TypingMind aktivéiere kënnt, fir se am Chat ze benotzen oder KI-Agente zouzeweisen.

Muss ech meng API-Schlëssele mat TypingMind deelen, fir Tradingview MCP MCP ze benotzen?

Nee. TypingMind ass nom Local-first-Prinzip opgebaut a léisst Iech d'Kontroll iwwer Är Modellubidder, API-Schlësselen, Prompts a MCP-Konfiguratioun. Wann Tradingview MCP eng Authentifizéierung verlaangt, setzt déi néideg Headeren, OAuth-Astellungen oder lokal Konfiguratioun fir deen MCP-Server derbäi, wann Dir d'Verbindung erstallt.

Änlech MCP-Serveren

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇