Skip to main content
Glama
Miha21222

tradingview-mcp

by Miha21222

tradingview-mcp

MCP server giving AI agents a TradingView-centric trading toolkit: screener queries, historical FX data, and — as milestones land — SMC/ICT pattern scanning, chart rendering with markup, backtesting, Pine tooling, and a bundle of companion Agent Skills.

Not affiliated with TradingView, Inc. "TradingView", "Pine Script" and "Lightweight Charts" are trademarks of TradingView, Inc.

Status

M0-M5 complete: server boots with public/data defaults; opt-in toolsets for SMC scanning, chart rendering, backtesting, FX Replay journal sync, TradingView-account data (session), Pine compile, Desktop CDP (screenshots, navigation, drawing on the live chart, reading the user's own indicators — plot values and Pine-drawn FVG/OB zones), and declarative strategies. Ships a tv CLI (every tool = a subcommand emitting JSON), 10 companion skills, and a validated Claude Code plugin manifest. Open items: M1's trust gate still awaits the owner's real hand-labeled SMC setups; webhook receiver, MCP Apps, and the sandboxed Python strategy escape hatch are deferred. Roadmap: docs/PLAN.md.

Related MCP server: TradingView MCP Bridge

Install as a Claude Code plugin

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

The install prompts for optional credentials (OANDA practice key, TradingView sessionid) and operator settings (TV_TOOLSETS, TV_READ_ONLY, ...) — nothing is required for the default public,data surface, which works with zero TradingView account. Requires uv on PATH.

Quick start

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

The opt-in chart toolset renders via headless Chromium; run uv run playwright install chromium once if you enable it. Enable opt-in toolsets via TV_TOOLSETS=default,scan,chart,backtest,journal.

Claude Code: the repo's .mcp.json registers the server automatically when you trust the project.

Configuration (env vars)

Var

Default

Meaning

TV_TOOLSETS

default (= public,data)

Comma list; all enables everything. Opt-ins: scan (SMC scanning), chart (PNG rendering), backtest, journal, pine (compile/typecheck), strategy (declarative YAML specs), session (TV-account data, ToS risk), desktop (CDP to TradingView Desktop, ToS risk)

TV_READ_ONLY

off

1 = write-capable tools never register (wins over everything)

TV_CACHE_DIR

~/.tvmcp/cache

Parquet OHLCV cache

TV_CHART_DIR

~/.tvmcp/charts

Rendered PNG output (managed, collision-safe filenames)

TV_JOURNAL_DIR

~/.tvmcp/journal

FX Replay CSV watch-folder for tv_journal_scan / tv_journal_parse

TV_STRATEGY_DIR

~/.tvmcp/strategies

YAML strategy specs for tv_strategy_list / tv_strategy_run

TV_SESSIONID

Your TradingView sessionid cookie gates the opt-in session toolset (ToS risk; see below). Live fetch works: the cookie is exchanged for a websocket JWT and fed to tvdatafeed-enhanced

TV_CDP_URL

http://127.0.0.1:9222

CDP address of TradingView Desktop for the opt-in desktop toolset (launch via scripts/start-tv-desktop.ps1, which defaults to port 9223 — set this var to match; another CDP app may own 9222)

TV_MAX_BARS

5000

Hard cap on bars per response

OANDA_API_KEY

Free practice-account key enables the OANDA provider

OANDA_ENV

practice

practice or live

Run uv run tv tv_setup_doctor to check every prerequisite - each broken check returns the exact fix command.

TradingView Terms of Service

The default toolsets use no TradingView account: the public toolset talks to TradingView's public scanner endpoint, and market data comes from Dukascopy/OANDA. TradingView's ToS prohibits automated data collection and non-display use of its data; the optional session and desktop toolsets (off by default) interact with your own TradingView account/desktop app at your own risk — enabling them is your explicit choice and may violate TradingView's ToS and risk account restrictions. Both print a ToS/ban warning to stderr on first use. This project is for personal research/education.

License

MIT — see LICENSE. Not affiliated with TradingView, Inc.; protected/invite-only Pine scripts remain their authors' property — the study tools read only the rendered output of indicators on your own chart, never their source.

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.

ParametersJSON Schema
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

ParametersJSON 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.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON 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.

ParametersJSON Schema
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

ParametersJSON 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.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON 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.

ParametersJSON Schema
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

ParametersJSON 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

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Connects AI assistants to TradingView Desktop for chart analysis, Pine Script development, and workflow automation via Chrome DevTools Protocol.
    99 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.
    99 npm
    -