Skip to main content
Glama
tradingview-mcp

tradingview-mcp

by Miha21222

tradingview-mcp

Servidor MCP que brinda a los agentes de IA un kit de herramientas de trading centrado en TradingView: consultas de screener, datos históricos de FX y — a medida que se alcanzan los hitos — escaneo de patrones SMC/ICT, renderizado de gráficos con marcado, backtesting, herramientas Pine y un conjunto de habilidades de agente complementarias.

No afiliado con TradingView, Inc. "TradingView", "Pine Script" y "Lightweight Charts" son marcas comerciales de TradingView, Inc.

Estado

M0-M5 completos: el servidor arranca con los valores predeterminados public/data; conjuntos de herramientas opcionales para escaneo SMC, renderizado de gráficos, backtesting, sincronización de diario FX Replay, datos de cuenta de TradingView (session), compilación Pine, CDP de escritorio (capturas de pantalla, navegación, dibujo en el gráfico en vivo, lectura de los propios indicadores del usuario — valores de trazado y zonas FVG/OB dibujadas con Pine), y estrategias declarativas. Incluye una CLI tv (cada herramienta = un subcomando que emite JSON), 10 habilidades complementarias y un manifiesto de plugin de Claude Code validado. Elementos pendientes: la puerta de confianza de M1 aún espera las configuraciones SMC reales etiquetadas a mano del propietario; el receptor de webhooks, las aplicaciones MCP y la vía de escape de estrategia Python en sandbox están diferidos. Hoja de ruta: docs/PLAN.md.

Related MCP server: TradingView MCP Jackson

Instalar como plugin de Claude Code

/plugin marketplace add Miha21222/tradingview-mcp
/plugin install tradingview-mcp@tradingview-mcp-marketplace

La instalación solicita credenciales opcionales (clave de práctica de OANDA, sessionid de TradingView) y configuraciones del operador (TV_TOOLSETS, TV_READ_ONLY, ...) — no se requiere nada para la superficie predeterminada public,data, que funciona sin ninguna cuenta de TradingView. Requiere uv en PATH.

Inicio rápido

uv sync
uv run python -m tvmcp --check    # list registered tools
uv run python -m tvmcp            # run on stdio
uv run tv --check                 # CLI: list tools
uv run tv tv_data_get_bars '{"symbol":"EURUSD","count":10}'   # CLI: call any tool -> JSON

El conjunto de herramientas opcional chart renderiza mediante Chromium sin interfaz; ejecuta uv run playwright install chromium una vez si lo habilitas. Habilita los conjuntos de herramientas opcionales mediante TV_TOOLSETS=default,scan,chart,backtest,journal.

Claude Code: el .mcp.json del repositorio registra el servidor automáticamente cuando confías en el proyecto.

Configuración (variables de entorno)

Var

Default

Meaning

TV_TOOLSETS

default (= public,data)

Lista separada por comas; all habilita todo. Opcionales: scan (escaneo SMC), chart (renderizado PNG), backtest, journal, pine (compilar/verificar tipos), strategy (especificaciones YAML declarativas), session (datos de cuenta de TV, riesgo de ToS), desktop (CDP a TradingView Desktop, riesgo de ToS)

TV_READ_ONLY

off

1 = las herramientas con capacidad de escritura nunca se registran (prevalece sobre todo)

TV_CACHE_DIR

~/.tvmcp/cache

Caché Parquet OHLCV

TV_CHART_DIR

~/.tvmcp/charts

Salida PNG renderizada (nombres de archivo gestionados y seguros contra colisiones)

TV_JOURNAL_DIR

~/.tvmcp/journal

Carpeta de vigilancia CSV de FX Replay para tv_journal_scan / tv_journal_parse

TV_STRATEGY_DIR

~/.tvmcp/strategies

Especificaciones de estrategia YAML para tv_strategy_list / tv_strategy_run

TV_SESSIONID

—

Tu cookie sessionid de TradingView controla el conjunto de herramientas opcional session (riesgo de ToS; ver más abajo). La obtención en vivo funciona: la cookie se intercambia por un JWT de websocket y se alimenta a tvdatafeed mejorado

TV_CDP_URL

http://127.0.0.1:9222

Dirección CDP de TradingView Desktop para el conjunto de herramientas opcional desktop (inicia mediante scripts/start-tv-desktop.ps1, que por defecto usa el puerto 9223 — configura esta variable para que coincida; otra aplicación CDP puede ocupar el 9222)

TV_MAX_BARS

5000

Límite máximo de barras por respuesta

OANDA_API_KEY

—

La clave gratuita de cuenta de práctica habilita el proveedor OANDA

OANDA_ENV

practice

practice o live

Ejecuta uv run tv tv_setup_doctor para verificar cada requisito previo: cada comprobación fallida devuelve el comando de corrección exacto.

Términos de servicio de TradingView

Los conjuntos de herramientas predeterminados no usan ninguna cuenta de TradingView: el conjunto public se comunica con el endpoint público de escáner de TradingView, y los datos de mercado provienen de Dukascopy/OANDA. Los ToS de TradingView prohíben la recopilación automatizada de datos y el uso no visual de sus datos; los conjuntos de herramientas opcionales session y desktop (desactivados por defecto) interactúan con tu propia cuenta/aplicación de escritorio de TradingView bajo tu propio riesgo — habilitarlos es tu elección explícita y puede violar los ToS de TradingView y arriesgar restricciones de cuenta. Ambos imprimen una advertencia de ToS/prohibición en stderr en el primer uso. Este proyecto es para investigación/educación personal.

Licencia

MIT — ver LICENSE. No afiliado con TradingView, Inc.; los scripts Pine protegidos/solo por invitación siguen siendo propiedad de sus autores — las herramientas de estudio leen solo la salida renderizada de los indicadores en tu propio gráfico, nunca su código fuente.

Available Tools

6 tools
tv_data_get_barsA
Read-only

Fetch historical OHLCV bars. Cached in Parquet; repeat queries are instant.

Providers: dukascopy (free, deep history to ~2000s, first fetch of a range is slow) and oanda (real broker mid prices, needs OANDA_API_KEY). Bars are UTC, returned as arrays [time_iso, open, high, low, close, volume]. The provider field in the result names the feed - feeds disagree; levels are feed-specific.

NameRequiredDescriptionDefault
endNoISO date/datetime UTC. Default: now.
countNoMax bars returned (tail of range)
startNoISO date/datetime UTC, e.g. 2026-07-01. Default: computed back from `count`.
symbolYesAny alias: EURUSD, OANDA:EURUSD, EUR_USD, eurusd
providerNoauto | dukascopy | oanda. auto prefers OANDA when a key is configured.auto
timeframeNoM1, M5, M15, M30, H1, H4, D1 (aliases like 15m/1h accepted)M15

Output Schema

NameRequiredDescription

No output parameters

TDQS

A4.5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations declare readOnlyHint and openWorldHint, and the description adds substantial context: Parquet caching makes repeat queries instant, first fetch can be slow, bars are UTC, output format is arrays, and feeds disagree with feed-specific levels. This goes beyond the annotation hints without contradicting them.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact, with each sentence serving a purpose: main action, caching, providers, output format, and a caveat. It is front-loaded with the main verb and resource, and no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present, the description still covers key behavioral aspects: caching, provider specifics, timezone, output format, and feed disagreement. For a 6-parameter tool, this is complete enough for an agent to invoke correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema covers 100% of parameters, so the baseline is 3. The description adds meaning to the provider parameter by explaining provider differences (dukascopy free/deep, oanda requires key), and clarifies the output format. This extra context justifies a 4.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb ('Fetch') and resource ('historical OHLCV bars'), and the provider/output details clearly differentiate it from screening, TA, and search tools. The purpose is unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool versus siblings is provided. However, the description implies it is the go-to for historical bar data, and provider selection is covered. Since alternatives are not named, it only achieves implied usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

tv_data_providers_statusA
Read-only

Which OHLCV data providers are usable right now, and why not if not.

NameRequiredDescriptionDefault

No parameters

Output Schema

NameRequiredDescription

No output parameters

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already mark the tool as readOnlyHint=true and openWorldHint=true, so the description adds value by revealing that results are time-sensitive ('right now') and that the tool will explain the cause of unavailability. It does not contradict annotations and provides behavioral context beyond the structured fields.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, tightly worded sentence that immediately communicates purpose and scope. Every word earns its place, and the core question ('which providers are usable') is front-loaded before the explanatory clause.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter, read-only status tool with an output schema and annotations already covering safety, the description is complete. It tells the agent what the tool does, what makes it different from data-fetching tools, and what kind of answer to expect (usable or not, plus reasons).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

This tool has zero parameters and an empty input schema, so there are no parameter semantics for the description to clarify. Per the rubric, a zero-parameter tool earns a baseline of 4; nothing is missing here.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: checking which OHLCV data providers are currently usable, and provides the additional promise of explaining why not if a provider is unavailable. This is specific and easily distinguishes it from sibling tools like tv_data_get_bars or tv_screener_run, which serve different functions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies a real-time availability check but does not explicitly state when to use this tool versus siblings, nor does it mention any exclusions or alternatives. An agent can infer use context, but there is no direct guidance such as 'check this before requesting data' or 'use tv_data_get_bars for historical bars instead.'

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

tv_screener_runA
Read-only

Run a TradingView screener query (unauthenticated scanner, ~3000 fields).

Use for: ranking/filtering instruments by indicator or fundamental values, finding oversold pairs, volume leaders, etc. US-equity quotes are 15-min delayed; forex/crypto are near-realtime. Timeframe-scoped fields take a suffix, e.g. 'RSI|15' for M15 RSI.

NameRequiredDescriptionDefault
limitNoMax rows (1-200)
marketNoScanner market: forex, crypto, america, futures, bond, cfd, coin, ...forex
columnsNoScanner fields to return, e.g. ['name','close','change','RSI','Recommend.All']. Default: name/close/change/volume.
filtersNoFilter triples [field, op, value]; ops: > >= < <= == != between isin. Example: [['RSI','<',30], ['close','>',1.05]]
order_byNoField to sort by (descending)

Output Schema

NameRequiredDescription

No output parameters

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare read-only and open-world behavior, so the bar is lower. The description still adds meaningful context beyond annotations: the scanner is unauthenticated, US-equity quotes are 15-minute delayed, forex/crypto are near-realtime, and timeframe-scoped fields use a suffix like 'RSI|15'. This helps set expectations without contradicting annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact and front-loaded: the core operation comes first, followed by concrete use cases, then important data-quality caveats. Each sentence contributes distinct value with no redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with zero required parameters, full schema coverage, clear annotations, and an output schema, the description covers the key operational nuances: when to use it, field flexibility, data delay caveats, and field-name formatting. Nothing essential is missing for an agent to invoke it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. The description adds beyond the schema by explaining the timeframe-suffix convention for fields (e.g., 'RSI|15') and signaling the wide field space (~3000 fields), which helps the agent construct valid columns and filters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description opens with a specific verb and resource: 'Run a TradingView screener query'. It further differentiates from siblings by scoping to ranking/filtering instruments, oversold pairs, and volume leaders, which clearly separates it from symbol search, bar retrieval, and TA summary tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides an explicit 'Use for' list covering ranking, filtering, identifying oversold pairs, and volume leaders. It does not name alternatives or state when not to use the tool, but the use cases are clear enough for an agent to select it over siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

tv_setup_doctorA
Read-only

Diagnose this install: check every prerequisite, return exact fixes.

Each check reports {name, ok, detail, optional} and - when broken - a fix holding the exact shell command to run. Run the fixes for anything with ok=false and optional=false, rerun the doctor, and the server is fully operational. Credential checks (OANDA key, TV session cookie) are optional and always require the human - never attempt to obtain credentials.

NameRequiredDescriptionDefault

No parameters

Output Schema

NameRequiredDescription

No output parameters

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With readOnlyHint=true, the annotation already indicates safety, but the description goes well beyond that by disclosing the exact output shape ({name, ok, detail, optional}), the presence of a `fix` field, and the required workflow after running fixes. It also transparently states that credential checks always require a human and must not be attempted automatically. This is rich behavioral disclosure that complements the annotations without contradicting them.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact and front-loaded with the core purpose. Each sentence adds distinct value: first the diagnose-and-fix purpose, then the output contract, then the remediation workflow, and finally the credential-handling caveat. There is no filler or repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter, read-only diagnostic tool, the description covers everything an agent needs: what the tool does, what it returns, how to use the results, and which actions require human involvement. The presence of an output schema reduces the need to document return values further, and the description already summarizes the key output fields.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, so there is nothing for the description to explain about parameter usage. The description instead focuses on the diagnostic workflow and output contract, which is the most relevant semantic content for this tool. The baseline of 4 for no-parameter tools is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a concrete action: 'Diagnose this install: check every prerequisite, return exact fixes.' This clearly identifies the tool as a setup diagnostic, distinguishing it from siblings like tv_screener_run or tv_data_get_bars, which perform different functions. A specific resource ('this install') and expected outcome ('return exact fixes') makes the purpose unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives explicit workflow guidance: run fixes for anything with ok=false and optional=false, rerun the doctor, and the install becomes operational. It also warns that credential checks are optional and require human involvement. It does not explicitly compare against sibling tools, but the usage context is clear enough that an agent would know when to invoke it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

tv_ta_summaryA
Read-only

Technical-analysis summary per symbol: overall/MA/oscillator ratings plus RSI and close.

Ratings are TradingView's precomputed Recommend.* fields mapped to STRONG_BUY..STRONG_SELL. Use for a quick bias read, not as a trade signal.

NameRequiredDescriptionDefault
marketNoScanner market the tickers belong to: forex (default), crypto, america, ...forex
symbolsYesTradingView tickers, e.g. ['OANDA:EURUSD','OANDA:GBPUSD'] (bare 'EURUSD' is auto-prefixed with OANDA:)
timeframeNo1D, M15, H1, H4, W1 ...1D

Output Schema

NameRequiredDescription

No output parameters

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true, so the safety profile is covered. The description adds valuable behavioral context by disclosing that ratings are TradingView's precomputed Recommend.* fields and explaining the mapping to STRONG_BUY..STRONG_SELL.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact and front-loaded: the first sentence states what the tool returns, the second explains the rating source and mapping, and the third gives a clear usage caveat. Every sentence contributes useful information with no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With a complete input schema, an output schema present, and annotations covering read-only behavior, the description adds the remaining essential context: data provenance, rating mapping, and the caution that this is not a trade signal. Nothing critical is missing for an agent to use the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% and each parameter already has a meaningful description, including examples and auto-prefix behavior for symbols. The tool description does not add parameter-specific detail beyond what the schema provides, so the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool produces a technical-analysis summary per symbol, naming the specific components: overall/MA/oscillator ratings plus RSI and close. It also explains the rating values are TradingView Recommend.* fields mapped to STRONG_BUY..STRONG_SELL, which distinguishes this from sibling tools like tv_data_get_bars and tv_screener_run.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says to use it for a quick bias read and not as a trade signal, giving clear context and an exclusion. It does not name a specific alternative tool, but the usage context is still well-defined.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 6 tool updatesv0.1.0
    • First observedtv_data_get_bars
    • First observedtv_data_providers_status
    • First observedtv_screener_run
    • First observedtv_setup_doctor
    • First observedtv_symbol_search
    • First observedtv_ta_summary

TDQS

A4.1/5.0

Scored across 6 tools

Disambiguation4/5

Each tool targets a distinct surface—screening, TA ratings, symbol lookup, install diagnostics, provider health, and OHLCV data—so most are unambiguous. The two diagnostic tools have some overlap around environment/credential health but are separated by install prerequisites versus current data-feed availability.

Naming Consistency3/5

All names share a tv_ prefix and snake_case, but the internal pattern is mixed: action-style names like tv_screener_run and tv_data_get_bars sit beside noun-style names like tv_ta_summary, tv_symbol_search, tv_setup_doctor, and tv_data_providers_status. A consistent verb_noun or noun_verb pattern would make the set more predictable.

Tool Count5/5

Six tools is well-scoped for a TradingView-oriented data server: screening, symbol discovery, technical summaries, historical bars, and health diagnostics each have a home. No tool feels redundant, and the count is neither thin nor bloated.

Completeness4/5

Core workflows are covered: find symbols, screen/filter, get TA reads, and pull OHLCV bars, plus status and diagnostic tools. Minor gaps exist—such as no direct single-symbol quote tool separate from bars/screener and no explicit indicator-value fetch beyond the TA summary—but agents can work around these.

Maintenance

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    C
    maintenance
    Connects AI assistants to TradingView Desktop for chart analysis, Pine Script development, and workflow automation via Chrome DevTools Protocol.
    85 npm
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables AI agents to interact with TradingView Desktop via Chrome DevTools Protocol for automated morning briefs, chart analysis, Pine script development, and trading workflows.
    85 npm
    -
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables AI agents to read and control TradingView Desktop charts in real time, supporting chart analysis, Pine Script development, alerts, replay practice, and multi-pane automation.
    85 npm
    MIT