Logotipo de TradingView MCP Server

TradingView MCP Server

Comunidad
jaipreet15

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

Editorjaipreet15
Repositoriotradingview-mcp
IdiomaTypeScript
Forks
206
Estrellas
150
Herramientas disponibles
0
Tipo de transportestdio
Categorías
LicenciaMIT
Enlaces
  • Conecta herramientas a flujos de trabajo con IA

    TradingView MCP Server ofrece funciones MCP que pueden usar los clientes y agentes de IA compatibles.

  • 0 herramientas disponibles

    Explora a continuación las acciones que se pueden invocar, con sus nombres y descripciones cuando el servidor los proporcione.

  • Configuración lista para copiar

    Usa los ejemplos de instalación para configurar este servidor en tu cliente MCP preferido.

  • Indicadores de interés en el código abierto

    150 estrellas y 206 forks en el repositorio enlazado.

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.

Instalación

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

Usa el MCP de TradingView MCP Server con varios modelos de IA

TypingMind conecta las herramientas MCP a nivel del espacio de trabajo, por lo que, una vez conectado TradingView MCP Server, puedes usarlo con distintos modelos de IA en TypingMind sin tener que configurarlo por separado para cada modelo. Esta integración MCP se ejecuta localmente en tu dispositivo a través del conector MCP de TypingMind.

Guía de configuración para usar el conector local

Usa esta opción si el servidor MCP necesita acceder a archivos locales, aplicaciones o recursos privados de tu ordenador.

1

Abre los ajustes de MCP

En TypingMind, ve a Ajustes, luego a Ajustes avanzados y a Model Context Protocol, y elige Configurar conector.

  1. Abre TypingMind en tu navegador.
  2. Haz clic en el icono de Ajustes.
  3. Ve a Ajustes avanzados.
  4. Abre la sección Model Context Protocol.
  5. Haz clic en Configurar conector y elige Este dispositivo.
Pantalla de configuración del conector MCP de TypingMind con «Este dispositivo» seleccionado
2

Ejecuta el comando del conector

Elige Este dispositivo, copia el comando de TypingMind y ejecútalo en Terminal. Mantén el proceso en ejecución mientras uses MCP.

  1. Copia el comando de configuración que muestra TypingMind.
  2. Abre Terminal en macOS o Windows Terminal en Windows.
  3. Pega y ejecuta el comando.
  4. Acepta la instalación del paquete si Terminal te pide confirmación para continuar.
  5. Mantén el proceso en ejecución en la ventana de Terminal mientras uses las herramientas MCP.
3

Añade TradingView MCP Server como servidor

Cuando el estado del conector sea «Listo», haz clic en «Edita servidores» y pega la configuración del servidor MCP.

  1. Espera hasta que el estado del conector indique «Listo».
  2. Haz clic en Edita servidores.
  3. Pega la configuración del servidor MCP de TradingView MCP Server.
  4. Guarda la lista de servidores.
  5. Actualiza para comprobar que el conector sigue listo.
Ajustes de MCP de TypingMind con un servidor activo y el botón «Edita servidores»
{
  "mcpServers": {
    "tradingview-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "tradingview-mcp-server"
      ]
    }
  }
}
4

Úsala con distintos modelos

Guarda la lista de servidores, abre Plugins, activa las herramientas MCP de TradingView MCP Server y selecciona cualquier modelo de IA compatible en TypingMind para usar las herramientas en el chat o asignárselas a un agente de IA.

  1. Abre la página Plugins en TypingMind.
  2. Activa las herramientas MCP de TradingView MCP Server.
  3. Inicia un chat y elige el modelo de IA que quieras usar.
  4. Usa las herramientas MCP en el chat o asígnalas a un agente de IA.
  5. Cambia a otro modelo de IA cuando lo necesites sin volver a conectar MCP.
Chat de TypingMind que usa herramientas MCP activadas con un modelo de IA seleccionado
¿Puedes usar TradingView MCP Server para ayudarme con esta tarea?
TradingView MCP Server
Claro. Lo he leído.
Esto he encontrado usando TradingView MCP Server.

Preguntas frecuentes

¿Para qué sirve el servidor MCP TradingView MCP Server?

TradingView MCP Server es un servidor MCP que permite a los clientes de IA compatibles conectarse a herramientas y contexto externos. En TypingMind, basta con añadir este servidor MCP una vez para que sus herramientas estén disponibles en tu espacio de trabajo de IA.

¿Puedo usar el servidor MCP TradingView MCP Server con varios modelos de IA en TypingMind?

Sí. TypingMind conecta las herramientas MCP a nivel del espacio de trabajo, por lo que puedes usar TradingView MCP Server con distintos modelos de IA, como Claude, ChatGPT, Gemini u otros que hayas configurado en TypingMind, sin configurar el servidor MCP por separado para cada modelo.

¿Por qué usar el conector MCP de TradingView MCP Server con TypingMind?

TypingMind es una de las mejores interfaces de chat con LLM porque reúne varios modelos de IA, prompts, plugins, agentes de IA, claves de API y herramientas MCP en un solo espacio de trabajo. Con TradingView MCP Server conectado, puedes usar sus herramientas MCP con tus modelos preferidos y mantener organizado tu flujo de trabajo de chat en TypingMind.

¿Cómo conecto el servidor MCP TradingView MCP Server a TypingMind?

TradingView MCP Server funciona a través del conector MCP local de TypingMind. Es la mejor opción cuando el servidor MCP necesita acceder a archivos locales, aplicaciones de escritorio, herramientas de línea de comandos o recursos privados de tu ordenador.

¿Qué herramientas ofrece el servidor MCP TradingView MCP Server en TypingMind?

TradingView MCP Server ofrece funciones MCP que puedes activar desde la página Plugins de TypingMind y usar en el chat o asignar a agentes de IA.

¿Tengo que compartir mis claves de API con TypingMind para usar el servidor MCP TradingView MCP Server?

No. TypingMind prioriza el funcionamiento local y te permite mantener el control de tus proveedores de modelos, claves de API, prompts y configuración MCP. Si TradingView MCP Server requiere autenticación, añade las cabeceras, los ajustes de OAuth o la configuración local necesarios para ese servidor MCP al crear la conexión.

Servidores MCP relacionados

Ver todos

Crea ya tu propio espacio de trabajo IA

Suscríbete a nuestro boletín para recibir avisos sobre nuevas funciones y próximos sorteos 👇