M2

mikeh-22/tradingview-mcp

API development

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

6 stars 6 forks 품질 62 트렌드 14

MCP server for TradingView

개요

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. 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. TradingView's web app communicates with its backend over a private REST API and a proprietary WebSocket protocol. This server: 1. using a headless Chromium browser (via Playwright) to replicate the normal login flow and obtain valid session cookies. 2. those cookies to disk so re-authentication only happens when the session expires (~25 days). 3.

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" ] } } }