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 Bridge
作为 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 脚本仍归其作者所有——研究工具只读取你自己图表上指标的渲染输出,绝不读取其源代码。
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 Servers
- FlicenseNot gradedqualityCmaintenanceConnects AI assistants to TradingView Desktop for chart analysis, Pine Script development, and workflow automation via Chrome DevTools Protocol.553
- FlicenseNot gradedqualityCmaintenanceConnects AI assistants to TradingView Desktop via Chrome DevTools Protocol for chart analysis, Pine Script development, and workflow automation.553
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to control and read data from TradingView Desktop, including morning briefs, chart analysis, Pine Script development, and replay mode.553
- 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.553
Related MCP Connectors
LuxAlgo Library — the encyclopedia of trading & technical analysis for AI agents. Free, keyless.
Real-time market data, screeners, technical analysis & backtesting for stocks, crypto and forex.
Real SEC, 13F, insider, congress & macro data your AI agent can cite. Hosted MCP, 24 tools.
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/Miha21222/tradingview-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server