Skip to main content
Glama
Tradingview Chart MCP

Tradingview Chart MCP

by ertugrul59

MCPサーバー - TradingViewチャート画像スクレーパー

この MCP サーバーは、ティッカーと間隔に基づいて TradingView チャート画像を取得するためのツールを提供します。

設定

  1. 仮想環境の作成:

    # Navigate to the project directory
    cd tradingview-chart-mcp
    # Create the venv (use python3 if python is not linked)
    python3 -m venv .venv
  2. 仮想環境をアクティブ化します:

    • macOS/Linux:

      source .venv/bin/activate
    • Windows (Git Bash/WSL):

      source .venv/Scripts/activate
    • Windows (コマンドプロンプト):

      .venv\\Scripts\\activate.bat
    • Windows (PowerShell):

      .venv\\Scripts\\Activate.ps1

      (注: PowerShell 実行ポリシーを調整する必要がある場合があります: Set-ExecutionPolicy RemoteSigned -Scope CurrentUser )

    ターミナルプロンプトに(.venv)内にいることが示されるはずです。

  3. 依存関係をインストールします(venv内):

    pip install -r requirements.txt
  4. 環境を構成する (ローカルテスト用):

    • .env.exampleを.envにコピーします。

    • .envファイルにTRADINGVIEW_SESSION_IDとTRADINGVIEW_SESSION_ID_SIGNを入力してください。これらは、TradingViewにログイン後、ブラウザのCookieから取得できます。

    • この.envファイルは、ローカル テストのためにサーバーを直接実行するとき (例: python main.py ) に使用されます。

    • ローカル実行に必要な場合は、 .env内のオプションのスクレーパー設定 ( MCP_SCRAPER_HEADLESSなど) を調整します。

  5. ChromeDriver を確認する: chromedriverがインストールされており、システムの PATH でアクセスできることを確認するか、パスの指定が許可されている場合はtview-scraper.pyを適切に構成します。

Related MCP server: tradingview-chart-mcp

サーバーの実行

仮想環境がアクティブ化されていることを確認します ( source .venv/bin/activateまたは同等のもの)。

python main.py

仮想環境の無効化

完了したら、環境を非アクティブ化できます。

deactivate

使用法

サーバーが実行される(アクティブ化された venv 内)と、 TradingView Chart Imageサーバー名をターゲットにして、MCP クライアントを使用してサーバーと対話できるようになります。

利用可能なツール:

  • get_tradingview_chart_image(ticker: str, interval: str) : TradingView チャートの直接画像 URL を取得します。

プロンプトの例:

  • 「NASDAQ:AAPLの15分チャートを取得する」

  • 「BYBIT:BTCUSDT.Pの日足チャートを見せてください」

  • 「60時間枠のCOINBASE:ETHUSDのTradingViewチャート画像を取得」

🔌 MCP クライアント (Claude Desktop / Cursor) での使用

このサーバーは、構成を提供する 2 つの方法をサポートしています。

  1. .envファイル経由 (ローカル テスト用): python main.py直接実行すると、サーバーはプロジェクト ディレクトリ内の.envファイルから資格情報と設定を読み込みます。

  2. クライアント環境変数経由(統合に推奨): MCPクライアント(Claude/Cursorなど)で実行する場合は、必要な環境変数を直接挿入するようにクライアントを設定する必要があります。これらの環境変数は、 .envファイル内の値を上書きします。

クロードデスクトップ

  1. Claude Desktop 構成ファイルを開きます。

    • Windows: %APPDATA%\\Claude\\claude_desktop_config.json

    • macOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json

  2. mcpServersオブジェクト内に以下のコードを追加またはマージします。env envに認証情報を入力してください。

    {
      "mcpServers": {
        "tradingview-chart-mcp": {
          "command": "/absolute/path/to/your/tradingview-chart-mcp/.venv/bin/python3",
          "args": ["/absolute/path/to/your/tradingview-chart-mcp/main.py"],
          "env": {
            "TRADINGVIEW_SESSION_ID": "YOUR_SESSION_ID_HERE",
            "TRADINGVIEW_SESSION_ID_SIGN": "YOUR_SESSION_ID_SIGN_HERE"
            // Optional: Add MCP_SCRAPER_* variables here too if needed
            // "MCP_SCRAPER_HEADLESS": "False"
          }
        }
        // ... other servers if any ...
      }
    }
  3. プレースホルダー パス ( command 、 args ) を実際の絶対パスに置き換えます。

  4. YOUR_SESSION_ID_HEREとYOUR_SESSION_ID_SIGN_HERE実際の TradingView の資格情報に置き換えます。

  5. Claude Desktop を再起動します。

カーソル

  1. Settings -> Cursor Settings -> MCP -> Edit User MCP Config (~/.cursor/mcp.json)に移動します。

  2. mcpServersオブジェクト内に以下のコードを追加またはマージします。env envに認証情報を入力してください。

    {
      "mcpServers": {
        "tradingview-chart-mcp": {
          "command": "/absolute/path/to/your/tradingview-chart-mcp/.venv/bin/python3",
          "args": ["/absolute/path/to/your/tradingview-chart-mcp/main.py"],
          "env": {
            "TRADINGVIEW_SESSION_ID": "YOUR_SESSION_ID_HERE",
            "TRADINGVIEW_SESSION_ID_SIGN": "YOUR_SESSION_ID_SIGN_HERE"
            // Optional: Add MCP_SCRAPER_* variables here too if needed
            // "MCP_SCRAPER_HEADLESS": "False"
          }
        }
        // ... other servers if any ...
      }
    }
  3. プレースホルダー パス ( command 、 args ) を実際の絶対パスに置き換えます。

  4. YOUR_SESSION_ID_HEREとYOUR_SESSION_ID_SIGN_HERE実際の TradingView の資格情報に置き換えます。

  5. カーソルを再起動します。

Tool Schema Changelog

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

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      B
      maintenance
      Enables users to fetch TradingView chart images for specified tickers and intervals through MCP tools, returning snapshot URLs or base64 image data. It supports browser pooling for concurrent performance, configurable intervals, TradingView authentication, and performance statistics.
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables users to fetch chart snapshots for any ticker and timeframe through Selenium, with browser pooling to support efficient concurrent requests. It provides performance statistics and configurable authentication for use with MCP clients.
      -