M2

mikeh-22/tradingview-mcp

API development

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

6 stars 6 forks 品質 62 トレンド 6

TradingViewのMCPサーバー

概要

AIアシスタントがTradeViewとやり取りするモデルコンテキストプロトコル(MCP)サーバー — リアルタイムの引用符、履歴OHLCVデータ、スクリーナー、アラート、ウォッチリスト、ニュース、チャートレイアウト、パインスクリプトなど。 Claude Desktop、Cursor、またはMCP互換クライアントに接続し、自然言語を使用してTradeViewとやり取りします。 このプロジェクトでは、TradeView の内部、ドキュメントされていない web API を使用します。 取引ビューが承認または承認されていない。 API エンドポイントは予告なく変更される場合があります。 TradingViewの利用規約に従って使用してください。 トレーディング ビューのWebアプリは、プライベートREST APIと独自のWebSocketプロトコルを介してバックエンドと通信します。 このサーバ: 1。 通常のログインフローを複製し、有効なセッションクッキーを得るために、ヘッドレスクロムブラウザ(Playwright経由)を使用して。 2。 セッションが期限切れ(〜25日)にのみ再認証が行われるため、ディスクへのクッキー。 3.

概要(AI 翻訳)

AIアシスタントがTradeViewとやり取りするモデルコンテキストプロトコル(MCP)サーバー — リアルタイムの引用符、履歴OHLCVデータ、スクリーナー、アラート、ウォッチリスト、ニュース、チャートレイアウト、パインスクリプトなど。 Claude Desktop、Cursor、またはMCP互換クライアントに接続し、自然言語を使用してTradeViewとやり取りします。

免責事項: このプロジェクトでは、TradeView の内部、ドキュメントされていない web API を使用します。 取引ビューが承認または承認されていない。 API エンドポイントは予告なく変更される場合があります。 TradingViewの利用規約に従って使用してください。

お問い合わせ

使い方

トレーディング ビューのWebアプリは、プライベートREST APIと独自のWebSocketプロトコルを介してバックエンドと通信します。 このサーバ:

1。Authenticatesは、通常のログインフローを再計算し、有効なセッションクッキーを取得するために、ヘッドレスクロムブラウザ(Playwright経由)を使用して。 2。Persists セッションが期限切れ(〜25日)にのみ、ディスクへのクッキーが再認証されます。 3。 MCPツールは、TradeViewの内部エンドポイントに認証されたHTTPリクエストを作成すること、および履歴OHLCVデータのWebSocket接続を調べます。

お問い合わせ

##特徴

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

tradingview-mcp

A Model Context Protocol (MCP) server that lets AI assistants interact with TradingView — real-time quotes, historical OHLCV data, screener, alerts, watchlists, news, chart layouts, Pine scripts, and more. Connect it to Claude Desktop, Cursor, or any MCP-compatible client and interact with TradingView using natural language.

Disclaimer: This project uses TradingView’s internal, undocumented web API. It is not affiliated with or endorsed by TradingView. API endpoints may change without notice. Use in accordance with TradingView’s Terms of Service.


How It Works

TradingView’s web app communicates with its backend over a private REST API and a proprietary WebSocket protocol. This server:

  1. Authenticates using a headless Chromium browser (via Playwright) to replicate the normal login flow and obtain valid session cookies.
  2. Persists those cookies to disk so re-authentication only happens when the session expires (~25 days).
  3. Exposes MCP tools that make authenticated HTTP requests to TradingView’s internal endpoints, plus a WebSocket connection for historical OHLCV data.
MCP Client (Claude, Cursor…)
        │  MCP protocol (stdio)
        ▼
  tradingview-mcp
        │  HTTPS + session cookies        WebSocket (OHLCV)
        ▼                                        ▼
  tradingview.com REST API       prodata.tradingview.com

Features

  • Market Data — real-time quotes and detailed symbol info (P/E, EPS, beta, sector, 52-week range, etc.)
  • Historical Data — OHLCV candles via TradingView’s WebSocket protocol
  • Screener — filter stocks, crypto, and forex by price, fundamentals, and technicals
  • Alerts — list and inspect price alerts
  • Watchlists — list, create, rename, add/remove symbols, and delete watchlists
  • News & Ideas — latest headlines per symbol, community ideas search, trending ideas
  • Chart Layouts — list and inspect saved chart layouts
  • Pine Scripts — list and retrieve source code for saved indicators and strategies
  • Account — account details
  • Session persistence — logs in once via headless browser, reuses cookies for subsequent runs

Installation

No Node.js required. Uses the published multi-platform image (linux/amd64 + linux/arm64).

1. Authenticate once

docker run --rm \
  -v tradingview-mcp-session:/data \
  -e [email protected] \
  -e TV_PASSWORD=yourpassword \
  -e TV_SESSION_FILE=/data/.tv_session.json \
  mikeh1975/tradingview-mcp:login

This runs a headless Chromium browser, logs into TradingView, and saves the session cookies to a named Docker volume. You only need to redo this when the session expires (~25 days).

2. Configure Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

GitHub で README 全文を見る

インストール

docker run --rm -i -v tradingview-mcp-session:/data -e TV_SESSION_FILE=/data/.tv_session.json mikeh1975/tradingview-mcp:latest
MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "tradingview": { "command": "docker", "args": [ "run", "--rm", "-i", "-v", "tradingview-mcp-session:/data", "-e", "TV_SESSION_FILE=/data/.tv_session.json", "mikeh1975/tradingview-mcp:latest" ] } } }