
ali-rajabpour/tradingview-mcp
Browser automationこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
Playwright を使用して、トランザクションビュー チャートのスナップショットを高速、安全、カスタマイズ可能なブラウザの自動化で実現する、軽量な Python MCP サーバー.
概要
TradingView チャートのスナップショットを取得するためのモデルコンテキストプロトコル(MCP)サーバー。 持続的なセッションとクッキーベースの認証で効率的なブラウザの自動化のためにPlaywrightを使用します。 : これは、TradeView が JavaScript/Canvas でクライアント側をチャート表示するので、Playwright を使用します。 チャートイメージには純粋なHTTP APIはありません。 これは、最も軽量な作業ソリューションです (~150MB RAM と ~500MB の Selenium). - 🪶 : ヘッドレスモード(〜150MB〜500MB、セレニウム付き)でプレイライト - REST : 永続ブラウザリユース、チャートごとの3-5秒 - 🔐 : ベースの認証 - セッション: チャートの寸法、間隔、テーマの設定 - ☑ : MCP対応クライアント(Claude Desktopなど)と連携 - 複数のリクエストを横断するブラウザのインスタンスを再利用する - Python 3.10以上 - 取引ビューアカウント(無料または有料) - 取引ビューセッションクッキー 2. - ブラウザでTradeViewにログイン - 開発者ツールを開くために押す - タブ(Chrome)またはタブ(Firefox)に移動 - に移動 > [[https://www.]に移動します
概要(AI 翻訳)
lightweight* モデルコンテキストプロトコル(MCP)サーバーで、TradeViewチャートのスナップショットを取得します。 持続的なセッションとクッキーベースの認証で効率的なブラウザの自動化のためにPlaywrightを使用します。
**注記: TradingView は JavaScript/Canvas でクライアント側をチャートに表示するので、Playwright を使用します。 チャートイメージには純粋なHTTP APIはありません。 これは、最も軽量な作業ソリューションです (~150MB RAM と ~500MB の Selenium).
✨ 機能
- 🪶 ライト級選手: ヘッドレスモードでプレイライト(150MB~500MB)
- OST Fast: 永続的なブラウザの再利用、チャートごとの3-5秒
- 🔐Secure:クッキーによるセッションベースの認証
- カスタマイズ可能**: チャートの寸法、間隔、テーマの設定
- ◀MCP対応:MCP対応クライアント(デスクトップなど)と連携
- 閉じる 複数のリクエスト間でブラウザインスタンスを再利用
受託者
- Python 3.10以上
- 取引口座(無料または有料)
- TradingViewセッションクッキー
コンテンツの表
- インストール
- クイックスタート
- 使用法
- 構成
- 利用可能なツール
- シンボル形式
- トラブルシューティング
- パフォーマンス
- 貢献
OST インストール
##1.
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
TradingView MCP Server 📈
A lightweight Model Context Protocol (MCP) server for fetching TradingView chart snapshots. Uses Playwright for efficient browser automation with persistent sessions and cookie-based authentication.
Note: This uses Playwright because TradingView renders charts client-side with JavaScript/Canvas. There is no pure HTTP API for chart images. This is the lightest possible working solution (~150MB RAM vs ~500MB with Selenium).
✨ Features
- 🪶 Lightweight: Playwright in headless mode (~150MB vs ~500MB with Selenium)
- 🚀 Fast: Persistent browser reuse, 3-5 seconds per chart
- 🔐 Secure: Session-based authentication via cookies
- 🎨 Customizable: Configure chart dimensions, intervals, and themes
- 🔧 MCP Compatible: Works with any MCP-enabled client (Claude Desktop, etc.)
- ♻️ Efficient: Reuses browser instances across multiple requests
📋 Prerequisites
- Python 3.10 or higher
- A TradingView account (free or paid)
- TradingView session cookies
Table of Contents
- Installation
- Quick Start
- Usage
- Configuration
- Available Tools
- Symbol Format
- Troubleshooting
- Performance
- Contributing
🚀 Installation
1. Clone the repository
git clone https://github.com/yourusername/tradingview-mcp.git
cd tradingview-mcp
2. Create a virtual environment
# Windows
python -m venv venv
.\venv\Scripts\activate
# Linux/Mac
python3 -m venv venv
source venv/bin/activate
3. Install dependencies
pip install -r requirements.txt
# Install Playwright browsers (one-time setup, ~150MB download)
python -m playwright install chromium
4. Configure credentials
-
Copy
.env.exampleto.env:# Windows copy .env.example .env # Linux/Mac cp .env.example .env -
Get your TradingView session cookies:
- Log into TradingView in your browser
- Press F12 to open Developer Tools
- Go to Application tab (Chrome) or Storage tab (Firefox)
- Navigate to Cookies >
https://www.tradingview.com - Find and copy these two cookie values:
sessionid→ Copy the entire valuesessionid_sign→ Copy the entire value
⚠️ Important: Copy the full values including any special characters (slashes, equals signs, etc.). Don’t add quotes or extra spaces.
-
Edit
.envand paste your values:TRADINGVIEW_SESSION_ID=your_actual_session_id_here TRADINGVIEW_SESSION_ID_SIGN=your_actual_session_id_sign_hereExample (with fake values):
TRADINGVIEW_SESSION_ID=47zlhkbl2weohrhmjgufeg1o24droaod TRADINGVIEW_SESSION_ID_SIGN=v3:6S2OD9ta349/yqN0RdCeK3UKxTl/tJr4AOoPRUa0Crk=
5. Test your setup (Optional but recommended)
インストール
This server does not publish a one-line install command.
Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →設定
{
"mcpServers": {
"tradingview": {
"command": "python",
"args": ["C:\\path\\to\\tradingview-mcp\\src\\tradingview_mcp\\server.py"],
"cwd": "C:\\path\\to\\tradingview-mcp"
}
}
}