Logo vun TradingView MCP Server

TradingView MCP Server

Communautéit
jaipreet15

tradingview mcp that exposes tradingview market data, multi-exchange scanners and ai backtesting engine to AI assistants and tradingview mcp automation tools

Editeurjaipreet15
Repositorytradingview-mcp
SproochTypeScript
Forks
206
Stären
150
Disponibel Tools
0
Transporttypstdio
Kategorien
LizenzMIT
Linken
  • Tools mat KI-Workflows verbannen

    TradingView MCP Server stellt MCP-Funktioune bereit, déi vu kompatibele KI-Clienten a KI-Agente kënne benotzt ginn.

  • 0 disponibel Tools

    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 Ärem bevorzugte MCP-Client ze konfiguréieren.

  • Indicateure fir Open Source

    150 Stären an 206 Forks aus dem verlinkte Repository.

TradingView MCP Server

A production-oriented Model Context Protocol server that exposes TradingView market data, multi-exchange screeners, technical analysis, sentiment, news, and a built-in backtesting engine to AI assistants and automation tools.

Disclaimer: Independent open-source project — not affiliated with TradingView Inc. Outputs are for research and education only, not financial advice.


Table of Contents


Feature Highlights

CapabilityDetails
Multi-exchange screenersCrypto, US equities, EGX, BIST, HKEX, SSE, TWSE, and more via static symbol lists + TradingView scanner API
Technical analysisBollinger ratings, RSI, multi-timeframe alignment, volume breakouts, candle patterns
Backtesting9 strategies with Sharpe, Calmar, walk-forward overfitting detection
Market intelligenceReddit sentiment, RSS financial news, Yahoo Finance quotes
ResilienceRetry/backoff, in-memory + optional distributed cache, structured error envelopes
MCP-native36 tools, stdio transport, works with Claude Desktop, Cursor, Copilot, and other MCP clients

Architecture

Layer responsibilities

  1. MCP router (src/server.ts) — validates inputs, delegates to services, returns JSON payloads.
  2. Services — domain logic with no MCP dependencies; independently testable.
  3. Screener provider — HTTP client with retry, jitter, throttling, and cache integration.
  4. Persistence — optional Redis-backed cache with graceful fallback to in-memory storage.

Workflows

Screener request flow

Combined analysis flow


Project Structure

tradingview-mcp/
├── src/
│   ├── index.ts              # CLI entry point
│   ├── server.ts             # MCP tool registration
│   ├── config/               # Environment validation (Zod)
│   ├── core/                 # Errors, shared types
│   ├── indicators/           # Pure indicator math + metrics
│   ├── persistence/          # Redis connection + cache store
│   ├── services/             # Domain services
│   │   ├── screener/         # TradingView scanner integration
│   │   ├── scanner/          # Volume breakout scanners
│   │   ├── backtest.ts       # Strategy backtesting
│   │   ├── yahoo-finance.ts  # Price quotes + OHLCV
│   │   ├── sentiment.ts      # Reddit analysis
│   │   ├── news.ts           # RSS aggregation
│   │   ├── egx.ts            # Egyptian Exchange tools
│   │   └── futures.ts        # Futures overview tools
│   ├── utils/                # Validators, HTTP, logging
│   └── data/coinlist/        # Per-exchange symbol lists
├── tests/unit/               # Vitest unit tests
├── docs/AUDIT.md             # Pre-migration audit notes
├── .env.example              # Configuration reference
├── package.json
├── tsconfig.json
└── tsup.config.ts

Design decisions:

  • Strict TypeScript — strict, noUnusedLocals, noUncheckedIndexedAccess enabled.
  • Service isolation — MCP layer contains zero business logic.
  • Cache abstraction — Redis is optional; server runs without it.
  • Structured errors — stable ErrorCode strings for programmatic handling.

Installation

Requirements

  • Node.js 18+
  • npm 9+
  • (Optional) Redis 6+ for distributed caching

Setup

bash
git clone https://github.com/your-org/tradingview-mcp.git
cd tradingview-mcp
npm install
npm run build

Claude Desktop

json
{
  "mcpServers": {
    "tradingview": {
      "command": "node",
      "args": ["D:/path/to/tradingview-mcp/dist/index.js"]
    }
  }
}

Cursor / VS Code MCP

Point your MCP configuration at the built dist/index.js binary. Restart the host after changes.

Docker (with Redis)

bash
docker compose up -d

Configuration

Copy .env.example to .env:

VariableDefaultDescription
LOG_LEVELinfoLogging verbosity
REDIS_ENABLEDfalseEnable distributed cache
REDIS_URL—Full Redis connection URL
REDIS_HOST127.0.0.1Redis host when URL not set
REDIS_PORT6379Redis port
REDIS_KEY_PREFIXtradingview-mcp:Key namespace prefix
TRADINGVIEW_MCP_CACHE_TTL60Fresh cache TTL (seconds)
TRADINGVIEW_MCP_STALE_TTL21600Stale fallback TTL (seconds)
TRADINGVIEW_MCP_RETRY_DELAYS1.0,4.0Retry backoff schedule
TRADINGVIEW_MCP_MAX_INFLIGHT2Concurrent TA request cap
PROXY_ENABLEDfalseEnable rotating HTTP proxy

See .env.example for the complete list.


Development

bash
# Watch mode
npm run dev

# Type check
npm run typecheck

# Lint
npm run lint

# Full validation pipeline
npm run validate

Adding a new MCP tool

  1. Implement logic in src/services/.
  2. Register the tool in src/server.ts with Zod parameter schema.
  3. Add unit tests under tests/unit/.
  4. Run npm run validate.

Testing

bash
npm test              # run once
npm run test:watch    # watch mode

Current coverage focuses on:

  • Structured error envelopes
  • Timeframe/exchange validators
  • Cache store behavior

Integration tests against live TradingView/Yahoo APIs are intentionally excluded to keep CI deterministic.


Troubleshooting

Empty screener results vs errors

SymptomMeaningAction
[] empty arrayNo symbols matched filters todayNormal — adjust filters
{"error":{"code":"ALL_BATCHES_FAILED"}}Upstream failureWait and retry; check network
Timeout messagesScanner slow or rate-limitedReduce batch size; enable cache

Redis connection failures

The server degrades gracefully — if Redis is unreachable at startup, in-memory caching is used automatically. Check REDIS_URL, firewall rules, and that Redis accepts connections.

Windows MCP timeout on first launch

Pre-build the project (npm run build) before configuring your MCP host so the server starts instantly:

bash
npm install && npm run build

Node version errors

Requires Node 18+. Verify with node --version.


Contributing

  1. Fork the repository and create a feature branch.
  2. Follow existing TypeScript conventions and strict compiler settings.
  3. Keep MCP handlers thin — put logic in services.
  4. Add tests for non-trivial changes.
  5. Run npm run validate before opening a PR.
  6. Write clear commit messages describing why, not just what.

FAQ

Does this require a TradingView account?
No. The server uses public scanner and chart endpoints. No login or API key is needed.

Can I run without Redis?
Yes. Set REDIS_ENABLED=false (default). Caching uses in-memory storage only.

Which exchanges are supported?
Any exchange with a symbol list in src/data/coinlist/ and a TradingView scanner market mapping in src/utils/validators.ts.

Are backtest results guaranteed?
No. Backtests use historical Yahoo Finance data with simulated costs. Past performance does not predict future results.

How do I handle rate limits?
Tune TRADINGVIEW_MCP_MAX_INFLIGHT, TRADINGVIEW_MCP_MIN_INTERVAL_S, and enable Redis caching to reduce duplicate upstream calls.

Is this financial advice?
No. This software is an informational tool. Consult a licensed professional before making financial decisions.


License

MIT — see LICENSE.

Installatioun

TypingMind
{
  "mcpServers": {
    "tradingview-mcp": {
      "command": "docker",
      "args": [
        "compose",
        "up",
        "-d"
      ]
    }
  }
}

TradingView MCP Server MCP mat verschiddene KI-Modeller benotzen

TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Soubal TradingView MCP Server 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 mat „Dësen Apparat“ 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. Pescht de 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 Server als Server derbäisetzen

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

  1. Waart, bis de Connector-Status „Prett“ weist.
  2. Klickt op „Serveren änneren“.
  3. Pescht d'MCP-Serverkonfiguratioun vu TradingView MCP Server an.
  4. Späichert d'Serverlëscht.
  5. Aktualiséiert, 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": {
    "tradingview-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "tradingview-mcp-server"
      ]
    }
  }
}
4

D'Verbindung mat verschiddene Modeller benotzen

Späichert d'Serverlëscht, maacht „Plugins“ op an aktivéiert d'MCP-Tools vu TradingView MCP Server. 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 vu TradingView MCP Server.
  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éierte MCP-Tools an engem ausgewielte KI-Modell
Hëlleft Dir mir bei dëser Aufgab mat TradingView MCP Server?
TradingView MCP Server
Jo. Ech hunn et gelies.
Dat hunn ech mat TradingView MCP Server fonnt.

Heefeg gestallte Froen

Fir wat gëtt de MCP-Server TradingView MCP Server benotzt?

TradingView MCP Server ass e MCP-Server, deen et kompatibele KI-Clienten erlaabt, sech mat externen Tools a Kontext ze verbannen. An TypingMind kënnt Dir dëse MCP-Server eemol derbäisetzen a seng Tools an Ärem KI-Aarbechtsberäich zur Verfügung stellen.

Kann ech TradingView MCP Server 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 Server mat verschiddene KI-Modeller wéi Claude, ChatGPT, Gemini oder anere Modeller benotzen, déi Dir an TypingMind konfiguréiert hutt, ouni de MCP-Server fir all Modell separat anzeriichten.

Firwat TradingView MCP Server 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 Server verbonnen ass, kënnt Dir seng MCP-Tools mat Äre bevorzugte Modeller benotzen a gläichzäiteg Är Chataarbecht an TypingMind organiséieren.

Wéi verbannen ech TradingView MCP Server MCP mat TypingMind?

TradingView MCP Server leeft iwwer de lokale MCP-Connector vun TypingMind. Dat eegent sech am beschten, wann de 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 Server MCP an TypingMind zur Verfügung?

TradingView MCP Server stellt MCP-Funktiounen 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-Agenten zouzeweisen.

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

Nee. TypingMind setzt op lokal Veraarbechtung a léisst Iech d'Kontroll iwwer Är Modellubidder, API-Schlësselen, Prompts a MCP-Konfiguratioun. Wann TradingView MCP Server eng Authentifizéierung verlaangt, setzt déi néideg Headeren, OAuth-Astellungen oder lokal Konfiguratioun fir dee MCP-Server derbäi, wann Dir d'Verbindung erstallt.

Änlech MCP-Serveren

All weisen

Elo Ären eegene KI-Workspace ariichten

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