tradingview-mcp
tradingview-mcp
为 AI 智能体提供以 TradingView 为核心的交易工具包的 MCP 服务器:筛选器查询、历史外汇数据,以及——随着里程碑落地——SMC/ICT 形态扫描、带标记的图表渲染、回测、Pine 工具,以及一整套配套的 Agent Skills。
与 TradingView, Inc. 无关联。"TradingView"、"Pine Script" 和 "Lightweight Charts" 是 TradingView, Inc. 的商标。
状态
M0-M5 已完成:服务器以 public/data 默认值启动;可选工具集包括 SMC 扫描、图表渲染、回测、FX Replay 日志同步、TradingView 账户数据(session)、Pine 编译、Desktop CDP(截图、导航、在实时图表上绘制、读取用户自己的指标——绘图值和 Pine 绘制的 FVG/OB 区域),以及声明式策略。附带一个 tv CLI(每个工具 = 一个输出 JSON 的子命令)、10 个配套技能,以及一个经过验证的 Claude Code 插件清单。未完成事项:M1 的信任门仍在等待所有者真实的手工标注 SMC 设置;webhook 接收器、MCP Apps 和沙箱化 Python 策略逃生通道被推迟。路线图:docs/PLAN.md。
Related MCP server: TradingView MCP Jackson
作为 Claude Code 插件安装
/plugin marketplace add Miha21222/tradingview-mcp
/plugin install tradingview-mcp@tradingview-mcp-marketplace安装时会提示输入可选凭据(OANDA 练习密钥、TradingView sessionid)和操作员设置(TV_TOOLSETS、TV_READ_ONLY 等)——默认的 public,data 界面不需要任何内容,无需 TradingView 账户即可使用。需要 PATH 上有 uv。
快速开始
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可选的 chart 工具集通过无头 Chromium 渲染;如果启用,请运行一次 uv run playwright install chromium。通过 TV_TOOLSETS=default,scan,chart,backtest,journal 启用可选工具集。
Claude Code:当你信任该项目时,仓库的 .mcp.json 会自动注册服务器。
配置(环境变量)
变量 | 默认值 | 含义 |
|
| 逗号分隔列表; |
| off |
|
|
| Parquet OHLCV 缓存 |
|
| 渲染的 PNG 输出(受管理、防冲突的文件名) |
|
| 用于 |
|
| 用于 |
| — | 你的 TradingView |
|
| 可选 |
|
| 每次响应的 K 线数量硬上限 |
| — | 免费的练习账户密钥可启用 OANDA 提供商 |
|
|
|
运行 uv run tv tv_setup_doctor 检查所有先决条件——每个失败的检查都会返回确切的修复命令。
TradingView 服务条款
默认工具集不使用 TradingView 账户:public 工具集与 TradingView 的公共筛选器端点通信,市场数据来自 Dukascopy/OANDA。TradingView 的 ToS 禁止自动数据收集和非展示性使用其数据;可选的 session 和 desktop 工具集(默认关闭)与你自己的 TradingView 账户/桌面应用交互,风险自负——启用它们是你的明确选择,可能违反 TradingView 的 ToS 并面临账户限制风险。两者在首次使用时都会向 stderr 打印 ToS/封禁警告。本项目仅用于个人研究/教育。
许可证
MIT——见 LICENSE。与 TradingView, Inc. 无关联;受保护/仅限邀请的 Pine 脚本仍归其作者所有——研究工具只读取你自己图表上指标的渲染输出,绝不读取其源代码。
Available Tools
6 toolstv_data_get_barsARead-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.
Inputs: symbol (required), end, count, start, +2 more. Returns: object
tv_data_providers_statusARead-only
Which OHLCV data providers are usable right now, and why not if not.
Inputs: no named parameters. Returns: object
tv_screener_runARead-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.
Inputs: limit, market, columns, filters, +1 more. Returns: object
tv_setup_doctorARead-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.
Inputs: no named parameters. Returns: object
tv_symbol_searchARead-only
Search TradingView's symbol directory. Returns exchange-qualified tickers with descriptions and types.
Inputs: text (required), limit. Returns: object
tv_ta_summaryARead-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.
Inputs: symbols (required), market, timeframe. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
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.
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.
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.
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
Related MCP Connectors
Evidence-gated quant research for TradingView Pine Script strategies, run from your AI client.
Live stock quotes, a stock screener, crypto prices and FX rates as agent tools.
> TradingMCP puts a market analyst inside your AI assistant. Paste one URL into Claude, ChatGPT, Cursor, VS Code or any MCP client and ask in plain language: screen for breakouts, run a multi-timeframe analysis, backtest a strategy with walk-forward validation, scan for smart-money and volume signals, or get a one-prompt morning market brief. In clients that support MCP Apps, price charts and the Markets panel are drawn right in the chat. > 40+ tools covering crypto (real-time), stocks, ETFs, FX, futures and commodities across major global exchanges. > Hosted, nothing to install: Pro $9/month (2,500 tool calls) or Pro+ $29/month (10,000). Paid upfront with a 14-day money-back guarantee; your API key arrives right after checkout. > Built on the open-source tradingview-mcp core (MIT, ~5k GitHub stars): self-host it free, or use the hosted version with zero ops. > For research and education, not financial advice. Not affiliated with TradingView
Live crypto + IDX stock market intelligence for AI agents — 19 tools, no API key.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceConnects AI assistants to TradingView Desktop for chart analysis, Pine Script development, and workflow automation via Chrome DevTools Protocol.-
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to control and read data from TradingView Desktop, including morning briefs, chart analysis, Pine Script development, and replay mode.88 npm-
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with TradingView Desktop via Chrome DevTools Protocol for automated morning briefs, chart analysis, Pine script development, and trading workflows.88 npm-
- AlicenseNot gradedqualityCmaintenanceEnables 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.1MIT