Skip to main content
Glama
tradingview-mcp-review

tradingview-mcp-review

by F-e-u-e-r

tradingview-mcp-review

一个仅用于审核的衍生产品,源自 tradesdontlie/tradingview-mcp:提供 9 个 MCP 工具,用于在 127.0.0.1:9222 上通过 Chrome DevTools 协议,对照实时 TradingView 桌面图表审核交易记录。

这不是通用桥接器。上游项目暴露了 84 个工具,包括 Pine Script 编辑、警报、自选列表、回放交易、UI 自动化、任意 JS 评估、进程控制和自动更新。此版本在代码层面移除了所有这些功能,只保留交易记录审核所需的内容:导航到交易发生时的图表位置、读取价格上下文、标记入场/出场点位、截图。

与 TradingView Inc. 或 Anthropic, PBC 无关联,未经其认可或授权。以编程方式与 TradingView 交互可能违反 TradingView 的服务条款——您需自行确保使用方式合规。上游项目的免责声明在此完全适用。

安全边界(按设计)

  • 仅限本地主机。 CDP 端点硬绑定到 127.0.0.1:9222——无环境变量或配置覆盖。

  • 无高权限原语。 无自动更新、无进程启动/终止、无任意 JS 评估、无 Pine 编辑器、无警报/自选列表/回放/订单功能。已在源代码层面删除(文件已移除),不仅仅是取消注册。

  • 无任意输入。 无调用者控制的文件路径(截图保存到 generated/screenshots/,使用程序生成的名称),时间周期为枚举类型,代码长度有限制。

  • 布局更改被视为可能持久化。 更改代码/时间周期可能弄脏已保存的 TradingView 布局(如果布局自动保存开启,则会持久化)。请在专用的草稿布局上操作。

  • 仅本地健康检查。 移除了上游 GitHub 更新检查;服务器除本地调试端口外不发出任何网络请求。

  • CI 强制检查。 tests/tool_surface.test.js 断言工具列表恰好等于 7 个工具的允许列表,并且命名的高级上游能力不存在,因此上游合并无法静默地重新引入它们。

Related MCP server: TradingView MCP Jackson

7 个工具

工具

审核中的用途

tv_health_check

验证本地 CDP 连接和当前图表

chart_get_state

读取代码 / 时间周期 / 指标

chart_set_symbol

切换到交易的工具

chart_set_timeframe

切换到交易的分辨率(枚举)

chart_set_visible_range

跳转/缩放到交易的时间窗口(翻页到更早的历史)

data_get_ohlcv

价格上下文。传递 from+to 以获取特定窗口(审核历史交易时需要);省略两者则获取最新 K 线

capture_screenshot

截图保存到 generated/screenshots/(固定路径)

图表注释(draw_shape / draw_clear)未包含在此版本中。安全地移除注释需要证明哪些绘图是由本次会话创建的;在 TradingView 布局切换过程中,无法可靠地建立所有权,而无法证明所有权的清除操作会删除用户自己的绘图。该功能将在拥有可证明的合约后返回,而不是附带警告。

预期架构:您的交易记录是真相来源 → 分析在本地进行 → TradingView 调试实例仅提供视觉上下文。

设置

要求:TradingView Desktop(含您的订阅)、Node.js 18+。

git clone https://github.com/F-e-u-e-r/tradingview-mcp-review.git
cd tradingview-mcp-review
npm ci --ignore-scripts

自行启动 TradingView Desktop 并开启调试端口(服务器故意无法为您执行此操作):

./scripts/launch_tv_debug_mac.sh          # macOS
# or manually, any platform:
/path/to/TradingView --remote-debugging-port=9222

仅在审核会话期间启用调试端口——当它开启时,任何本地进程都可以控制该 TradingView 实例。完成后正常关闭并重新启动。请使用 TradingView 桌面版,不要使用带有远程调试的 Chrome 标签页(那会暴露您的整个浏览器配置文件)。

添加到您的 MCP 客户端配置(例如项目中的 .mcp.json):

{
  "mcpServers": {
    "tradingview-review": {
      "command": "node",
      "args": ["/path/to/tradingview-mcp-review/src/server.js"]
    }
  }
}

门控

npm run lint   # eslint no-undef guard (catches unfinished refactors)
npm test       # tool-surface allowlist/denylist gate + sanitization + unit tests (all offline)

来源

从经过安全审查的提交点分叉自上游仓库;此后每一项更改均在 UPSTREAM.md 中列出,该文件也定义了拉取上游更新时的重新审查流程。许可证:MIT(参见 LICENSE,版权归上游作者所有)。

Available Tools

7 tools
capture_screenshotA

Take a screenshot of the TradingView chart. Saves to the fixed generated/screenshots/ directory with a program-generated name and returns the path. No path or name input is accepted.

Inputs: region, wait_for_render.

chart_get_stateA

Get current chart state (symbol, timeframe, chart type, indicators)

Inputs: no named parameters.

chart_set_symbolC

Change the chart symbol

Inputs: symbol (required).

chart_set_timeframeC

Change the chart timeframe/resolution

Inputs: timeframe (required).

chart_set_visible_rangeA

Zoom the chart to a specific date range (unix timestamps in seconds). Pages in older history as needed, so this also serves as jump-to-date for reviewing a past trade: pass a window around the trade time.

Inputs: to (required), from (required).

data_get_ohlcvA

Get OHLCV bar data from the chart. TWO MODES: pass from+to (unix seconds) to get bars from THAT window — required when reviewing a past trade, because without it you get the newest bars regardless of where the chart is navigated. Omit both for the newest count bars. A window with no loaded bars is refused rather than answered with the latest data; call chart_set_visible_range for that window first. Defaults to summary=true (compact stats + last 5 bars).

Inputs: to, from, count, summary.

tv_health_checkA

Check the local CDP connection (127.0.0.1:9222) to TradingView Desktop and return current chart state. Local-only: performs no external network requests.

Inputs: no named parameters.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 7 tools

    Disambiguation5/5

    Each tool targets a distinct action: health check, state retrieval, setting symbol/timeframe/visible range, getting OHLCV data, and screenshots. No functional overlap.

    Naming Consistency3/5

    Naming mixes prefixes: 'tv_' for health check, 'chart_' for state and settings, 'data_' for OHLCV, and no prefix for screenshot. While still readable, the pattern is inconsistent.

    Tool Count5/5

    Seven tools are well-scoped for chart review and navigation, fitting the recommended 3-15 range. Each tool serves a clear purpose without redundancy.

    Completeness4/5

    Core trade review workflows are covered (navigate to date, get historical OHLCV, capture screenshot). A minor gap is the absence of a tool to change chart type (e.g., candlestick to line), which could be useful but is not critical.

    Maintenance

    ActivityNo data
    ResponsivenessSyncing

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      A type-safe MCP server that enables AI agents to control TradingView Desktop via Chrome DevTools Protocol, allowing chart state reading, symbol/timeframe changes, and OHLCV data fetching.
      11
      1
      MIT
    • F
      license
      B
      quality
      D
      maintenance
      A TradingView-style market research and charting MCP server that provides tools for market data, indicators, watchlists, and local HTML chart rendering without scraping TradingView.
      9
      -