TradingView MCP
TradingView MCP
Servidor Model Context Protocol (MCP) para TradingView Desktop en tu máquina: lee gráficos, ejecuta un resumen matutino diario, desarrolla Pine Script y automatiza flujos de trabajo mediante el Chrome DevTools Protocol (localhost:9222).
Mantenido por John Anthony. Este proyecto amplía el upstream tradingview-mcp de @tradesdontlie con un flujo de trabajo de resumen matutino, una configuración de reglas (rules.json) y correcciones para tv_launch en TradingView Desktop v2.14+.
[!WARNING] No afiliado a TradingView Inc. ni a Anthropic. Esta herramienta se conecta a tu aplicación TradingView Desktop local mediante Chrome DevTools Protocol. Revisa el Aviso legal antes de usarla.
[!IMPORTANT] Requiere una suscripción válida de TradingView. Esta herramienta no elude ningún muro de pago de TradingView. Lee y controla la aplicación TradingView Desktop que ya se está ejecutando en tu máquina.
[!NOTE] Todo el procesamiento de datos se realiza localmente. No se envía nada a ningún sitio. Ningún dato de TradingView sale de tu máquina.
Novedades de este fork
Característica | Qué hace |
| Un comando que escanea tu lista de seguimiento, lee todos tus indicadores y devuelve datos estructurados para que Claude genere tu sesgo de sesión |
| Guarda tu resumen diario en |
| Escribe tus reglas de trading una sola vez: criterios de sesgo, reglas de riesgo, lista de seguimiento. El resumen matutino las aplica automáticamente cada día |
Corrección de lanzamiento | Corregida la compatibilidad de |
CLI | Ejecuta tu resumen matutino desde la terminal con una sola palabra |
Configuración en un solo paso
Pega esto en Claude Code y se encargará de todo:
Set up TradingView MCP for me.
Clone https://github.com/anthonyjohn17/tradingview-mcp.git to ~/tradingview-mcp, run npm install, then add it to my MCP config at ~/.claude/.mcp.json (merge with any existing servers, don't overwrite them).
The config block is: { "mcpServers": { "tradingview": { "command": "node", "args": ["/Users/YOUR_USERNAME/tradingview-mcp/src/server.js"] } } } — replace YOUR_USERNAME with my actual username.
Then copy rules.example.json to rules.json and open it so I can fill in my trading rules.
Finally restart and verify with tv_health_check.O sigue los pasos manuales a continuación.
Requisitos previos
Aplicación TradingView Desktop (se requiere suscripción de pago para datos en tiempo real)
Node.js 18+
Claude Code (para herramientas MCP) o cualquier terminal (para la CLI)
macOS, Windows o Linux
Inicio rápido
1. Clona e instala
git clone https://github.com/anthonyjohn17/tradingview-mcp.git ~/tradingview-mcp
cd ~/tradingview-mcp
npm install2. Configura tus reglas
cp rules.example.json rules.jsonAbre rules.json y rellena:
Tu lista de seguimiento (símbolos que escanear cada mañana)
Tus criterios de sesgo (qué hace que algo sea alcista/bajista/neutral para ti)
Tus reglas de riesgo (las reglas que quieres que Claude revise antes de cada sesión)
3. Inicia TradingView con CDP
TradingView debe ejecutarse con el puerto de depuración habilitado.
Mac:
./scripts/launch_tv_debug_mac.shWindows:
scripts\launch_tv_debug.batLinux:
./scripts/launch_tv_debug_linux.shO usa la herramienta MCP después de la configuración: "Usa tv_launch para iniciar TradingView en modo depuración"
4. Añádelo a Claude Code
Añádelo a ~/.claude/.mcp.json (combínalo con cualquier servidor existente):
{
"mcpServers": {
"tradingview": {
"command": "node",
"args": ["/Users/YOUR_USERNAME/tradingview-mcp/src/server.js"]
}
}
}Reemplaza YOUR_USERNAME con tu nombre de usuario real. En Mac: echo $USER para comprobarlo.
Transporte SSE (alternativa)
Ejecuta el servidor MCP a través de HTTP/SSE en lugar de stdio:
Inicia el servidor SSE:
# Mac/Linux
TRANSPORT=sse PORT=3000 node src/server.js
# Windows
set TRANSPORT=sse
node src/server.jsScripts de lanzamiento:
# Mac/Linux - custom port
./scripts/launch_mcp_sse.sh 8080
# Windows - custom port
scripts\launch_mcp_sse.bat 8080Configura Claude Code para conectarse mediante SSE:
{
"mcpServers": {
"tradingview": {
"url": "http://127.0.0.1:3000/sse"
}
}
}El servidor SSE escucha en http://127.0.0.1:3000/sse por defecto. Anula el puerto con la variable de entorno PORT.
5. Verificación
Reinicia Claude Code y pregunta: "Usa tv_health_check para verificar que TradingView está conectado"
6. Ejecuta tu primer resumen matutino
Pídele a Claude: "Ejecuta morning_brief y dame mi sesgo de sesión"
O desde la terminal:
npm link # install tv CLI globally (one time)
tv briefFlujo de trabajo del resumen matutino
Esta es la función que convierte esto de un conjunto de herramientas en un hábito diario.
Antes de cada sesión:
TradingView está abierto (iniciado con puerto de depuración)
Ejecuta:
tv briefen tu terminal (o pídele a Claude: "ejecuta morning_brief")Claude escanea cada símbolo de tu lista de seguimiento, lee tus valores de indicadores, aplica los criterios de tu
rules.jsone imprime:
BTCUSD | BIAS: Bearish | KEY LEVEL: 94,200 | WATCH: RSI crossing 50 on 4H
ETHUSD | BIAS: Neutral | KEY LEVEL: 3,180 | WATCH: Ribbon direction on daily
SOLUSD | BIAS: Bullish | KEY LEVEL: 178.50 | WATCH: Hold above 20 EMA
Overall: Cautious session. BTC leading bearish, SOL the exception — watch for divergence.Guárdalo: "guarda este resumen" (usa
session_save)A la mañana siguiente, compara: "obtén la sesión de ayer" (usa
session_get)
Qué hace esta herramienta
Resumen matutino — escanea la lista de seguimiento, lee indicadores, aplica tus reglas e imprime el sesgo de sesión
Desarrollo de Pine Script — escribe, inyecta, compila y depura scripts con IA
Navegación de gráficos — cambia símbolos, marcos temporales, amplía a fechas, añade/elimina indicadores
Análisis visual — lee valores de indicadores, niveles de precio y niveles dibujados de indicadores personalizados
Dibujar en gráficos — líneas de tendencia, niveles horizontales, rectángulos, texto
Gestionar alertas — crea, lista, elimina alertas de precio
Práctica de replay — avanza por barras históricas, practica entradas y salidas con seguimiento de P&L
Capturas de pantalla — captura el estado del gráfico
Distribuciones multipanel — cuadrículas 2x2, 3x1 con distintos símbolos por panel
Transmitir datos — salida JSONL desde tu gráfico en vivo para scripts de monitoreo
Acceso CLI — cada herramienta es también un comando
tv, con salida JSON compatible con tuberías
Cómo sabe Claude qué herramienta usar
Claude lee CLAUDE.md automáticamente cuando trabaja en este proyecto. Contiene el árbol de decisión completo.
Tú dices... | Claude usa... |
"Ejecuta mi resumen matutino" |
|
"¿Cuál era mi sesgo ayer?" |
|
"¿Qué hay en mi gráfico?" |
|
"Dame un análisis completo" |
|
"Cambia a BTCUSD diario" |
|
"Escribe un Pine Script para..." |
|
"Inicia el replay el 1 de marzo" |
|
"Configura una cuadrícula de 4 gráficos" |
|
"Dibuja un nivel en 94200" |
|
Referencia de herramientas (81 herramientas MCP)
Resumen matutino (nuevo en este fork)
Herramienta | Qué hace |
| Escanea la lista de seguimiento, lee indicadores y devuelve datos estructurados para el sesgo de sesión. Lee |
| Guarda el resumen generado en |
| Recupera el resumen de hoy (o el de ayer si el de hoy aún no se ha guardado) |
Lectura de gráficos
Herramienta | Cuándo usarla | Tamaño de salida |
| Primera llamada: obtén símbolo, marco temporal, nombres de indicadores + IDs | ~500B |
| Lee los valores actuales de RSI, MACD, BB, EMA de todos los indicadores | ~500B |
| Obtén el último precio, OHLC, volumen | ~200B |
| Obtén barras de precio. Usa | 500B (resumen) / 8KB (100 barras) |
Datos de indicadores personalizados (dibujos de Pine)
Lee la salida de line.new(), label.new(), table.new(), box.new() de cualquier indicador Pine visible.
Herramienta | Cuándo usarla |
| Niveles de precio horizontales (soporte/resistencia, niveles de sesión) |
| Anotaciones de texto + precios ("PDH 24550", "Bias Long") |
| Tablas de datos (estadísticas de sesión, paneles de análisis) |
| Zonas de precio como pares {high, low} |
Usa siempre study_filter para apuntar a un indicador específico: study_filter: "MyIndicator".
Control de gráficos
Herramienta | Qué hace |
| Cambia el ticker (BTCUSD, AAPL, ES1!, NYMEX:CL1!) |
| Cambia la resolución (1, 5, 15, 60, D, W, M) |
| Cambia el estilo (Candles, HeikinAshi, Line, Area, Renko) |
| Añade/elimina indicadores. Usa nombres completos: "Relative Strength Index", no "RSI" |
| Salta a una fecha (ISO: "2025-01-15") |
| Cambia la configuración de indicadores, mostrar/ocultar |
Desarrollo de Pine Script
Herramienta | Paso |
| 1. Inyecta código en el editor |
| 2. Compila con detección automática + comprobación de errores |
| 3. Lee los errores de compilación si los hay |
| 4. Lee la salida de log.info() |
| 5. Guarda en la nube de TradingView |
| Análisis estático sin conexión (no se necesita gráfico) |
| Comprobación de compilación en el servidor (no se necesita gráfico) |
Modo replay
Herramienta | Paso |
| Entra en replay en una fecha |
| Avanza una barra |
| Avance automático (ajusta la velocidad en ms) |
| Comprar/vender/cerrar posiciones |
| Comprueba posición, P&L, fecha |
| Vuelve a tiempo real |
Multipanel, alertas, dibujos, interfaz de usuario
Tool | What it does |
| Change grid: |
| Set symbol on any pane |
| Draw horizontal_line, trend_line, rectangle, text |
| Manage price alerts |
| Run action across multiple symbols/timeframes |
| Read/modify watchlist |
| Screenshot (regions: full, chart, strategy_tester) |
| Launch TradingView and verify connection |
CLI Commands
tv brief # run morning brief
tv session get # get today's saved brief
tv session save --brief "..." # save a brief
tv status # check connection
tv quote # current price
tv symbol BTCUSD # change symbol
tv ohlcv --summary # price summary
tv screenshot -r chart # capture chart
tv pine compile # compile Pine Script
tv pane layout 2x2 # 4-chart grid
tv stream quote | jq '.close' # monitor price ticksFull command list: tv --help
Troubleshooting
Problem | Solution |
| TradingView isn't running with |
| TradingView isn't running or port 9222 is blocked |
MCP server not showing in Claude Code | Check |
| Run |
| Run |
| Add symbols to the |
Tools return stale data | TradingView still loading — wait a few seconds |
Pine Editor tools fail | Open Pine Editor panel first: |
Architecture
Claude Code ←→ MCP Server (stdio or SSE) ←→ CDP (port 9222) ←→ TradingView Desktop (Electron)78 original tools + 3 morning brief tools = 81 MCP tools total
Transport: MCP over stdio (default) or SSE (
TRANSPORT=sse)Connection: Chrome DevTools Protocol on localhost:9222
No external network calls — everything runs locally
Zero extra dependencies beyond the original
SSE Transport
Run the server over HTTP/SSE instead of stdio:
TRANSPORT=sse node src/server.jsThe server listens on http://127.0.0.1:3000/sse by default. Override with:
TRANSPORT=sse PORT=8080 HOST=0.0.0.0 node src/server.jsConfigure Claude Code to connect via SSE:
{
"mcpServers": {
"tradingview": {
"url": "http://127.0.0.1:3000/sse"
}
}
}Credits
Upstream: tradingview-mcp by @tradesdontlie — the original MCP bridge and foundation.
This fork: John Anthony — morning brief, session helpers,
rules.json, and launch fixes for recent TradingView Desktop builds.
If you find the upstream useful, star their repository.
Disclaimer
This project is provided for personal, educational, and research purposes only.
This tool uses the Chrome DevTools Protocol (CDP), a standard debugging interface built into all Chromium-based applications. It does not reverse engineer any proprietary TradingView protocol, connect to TradingView's servers, or bypass any access controls. The debug port must be explicitly enabled by the user via a standard Chromium command-line flag.
By using this software you agree that:
You are solely responsible for ensuring your use complies with TradingView's Terms of Use and all applicable laws.
This tool accesses undocumented internal TradingView APIs that may change at any time.
This tool must not be used to redistribute, resell, or commercially exploit TradingView's market data.
The authors are not responsible for any account bans, suspensions, or other consequences.
Use at your own risk.
License
MIT — see LICENSE. Applies to source code only, not to TradingView's software, data, or trademarks.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Real-time market data, screeners, technical analysis & backtesting for stocks, crypto and forex.
TradeOS MCP: ticker search, My Agent, chart TA, macro news. npm stdio or HTTP.
LuxAlgo Library — the encyclopedia of trading & technical analysis for AI agents. Free, keyless.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/rkilchmn/tradingview-control-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server