TradingView MCP Serverのロゴ

TradingView MCP Server

コミュニティ
jaipreet15

tradingview mcp that exposes tradingview market data, multi-exchange scanners and ai backtesting engine to AI assistants and tradingview mcp automation tools

公開者jaipreet15
リポジトリtradingview-mcp
言語TypeScript
フォーク
206
スター
150
利用可能なツール
0
通信方式stdio
カテゴリ
ライセンスMIT
リンク
  • ツールをAIワークフローに接続

    TradingView MCP Serverは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 0個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには150件のスターと206件のフォークがあります。

TradingView MCP Server

A production-oriented Model Context Protocol server that exposes TradingView market data, multi-exchange screeners, technical analysis, sentiment, news, and a built-in backtesting engine to AI assistants and automation tools.

Disclaimer: Independent open-source project — not affiliated with TradingView Inc. Outputs are for research and education only, not financial advice.


Table of Contents


Feature Highlights

CapabilityDetails
Multi-exchange screenersCrypto, US equities, EGX, BIST, HKEX, SSE, TWSE, and more via static symbol lists + TradingView scanner API
Technical analysisBollinger ratings, RSI, multi-timeframe alignment, volume breakouts, candle patterns
Backtesting9 strategies with Sharpe, Calmar, walk-forward overfitting detection
Market intelligenceReddit sentiment, RSS financial news, Yahoo Finance quotes
ResilienceRetry/backoff, in-memory + optional distributed cache, structured error envelopes
MCP-native36 tools, stdio transport, works with Claude Desktop, Cursor, Copilot, and other MCP clients

Architecture

Layer responsibilities

  1. MCP router (src/server.ts) — validates inputs, delegates to services, returns JSON payloads.
  2. Services — domain logic with no MCP dependencies; independently testable.
  3. Screener provider — HTTP client with retry, jitter, throttling, and cache integration.
  4. Persistence — optional Redis-backed cache with graceful fallback to in-memory storage.

Workflows

Screener request flow

Combined analysis flow


Project Structure

tradingview-mcp/
├── src/
│   ├── index.ts              # CLI entry point
│   ├── server.ts             # MCP tool registration
│   ├── config/               # Environment validation (Zod)
│   ├── core/                 # Errors, shared types
│   ├── indicators/           # Pure indicator math + metrics
│   ├── persistence/          # Redis connection + cache store
│   ├── services/             # Domain services
│   │   ├── screener/         # TradingView scanner integration
│   │   ├── scanner/          # Volume breakout scanners
│   │   ├── backtest.ts       # Strategy backtesting
│   │   ├── yahoo-finance.ts  # Price quotes + OHLCV
│   │   ├── sentiment.ts      # Reddit analysis
│   │   ├── news.ts           # RSS aggregation
│   │   ├── egx.ts            # Egyptian Exchange tools
│   │   └── futures.ts        # Futures overview tools
│   ├── utils/                # Validators, HTTP, logging
│   └── data/coinlist/        # Per-exchange symbol lists
├── tests/unit/               # Vitest unit tests
├── docs/AUDIT.md             # Pre-migration audit notes
├── .env.example              # Configuration reference
├── package.json
├── tsconfig.json
└── tsup.config.ts

Design decisions:

  • Strict TypeScript — strict, noUnusedLocals, noUncheckedIndexedAccess enabled.
  • Service isolation — MCP layer contains zero business logic.
  • Cache abstraction — Redis is optional; server runs without it.
  • Structured errors — stable ErrorCode strings for programmatic handling.

Installation

Requirements

  • Node.js 18+
  • npm 9+
  • (Optional) Redis 6+ for distributed caching

Setup

bash
git clone https://github.com/your-org/tradingview-mcp.git
cd tradingview-mcp
npm install
npm run build

Claude Desktop

json
{
  "mcpServers": {
    "tradingview": {
      "command": "node",
      "args": ["D:/path/to/tradingview-mcp/dist/index.js"]
    }
  }
}

Cursor / VS Code MCP

Point your MCP configuration at the built dist/index.js binary. Restart the host after changes.

Docker (with Redis)

bash
docker compose up -d

Configuration

Copy .env.example to .env:

VariableDefaultDescription
LOG_LEVELinfoLogging verbosity
REDIS_ENABLEDfalseEnable distributed cache
REDIS_URL—Full Redis connection URL
REDIS_HOST127.0.0.1Redis host when URL not set
REDIS_PORT6379Redis port
REDIS_KEY_PREFIXtradingview-mcp:Key namespace prefix
TRADINGVIEW_MCP_CACHE_TTL60Fresh cache TTL (seconds)
TRADINGVIEW_MCP_STALE_TTL21600Stale fallback TTL (seconds)
TRADINGVIEW_MCP_RETRY_DELAYS1.0,4.0Retry backoff schedule
TRADINGVIEW_MCP_MAX_INFLIGHT2Concurrent TA request cap
PROXY_ENABLEDfalseEnable rotating HTTP proxy

See .env.example for the complete list.


Development

bash
# Watch mode
npm run dev

# Type check
npm run typecheck

# Lint
npm run lint

# Full validation pipeline
npm run validate

Adding a new MCP tool

  1. Implement logic in src/services/.
  2. Register the tool in src/server.ts with Zod parameter schema.
  3. Add unit tests under tests/unit/.
  4. Run npm run validate.

Testing

bash
npm test              # run once
npm run test:watch    # watch mode

Current coverage focuses on:

  • Structured error envelopes
  • Timeframe/exchange validators
  • Cache store behavior

Integration tests against live TradingView/Yahoo APIs are intentionally excluded to keep CI deterministic.


Troubleshooting

Empty screener results vs errors

SymptomMeaningAction
[] empty arrayNo symbols matched filters todayNormal — adjust filters
{"error":{"code":"ALL_BATCHES_FAILED"}}Upstream failureWait and retry; check network
Timeout messagesScanner slow or rate-limitedReduce batch size; enable cache

Redis connection failures

The server degrades gracefully — if Redis is unreachable at startup, in-memory caching is used automatically. Check REDIS_URL, firewall rules, and that Redis accepts connections.

Windows MCP timeout on first launch

Pre-build the project (npm run build) before configuring your MCP host so the server starts instantly:

bash
npm install && npm run build

Node version errors

Requires Node 18+. Verify with node --version.


Contributing

  1. Fork the repository and create a feature branch.
  2. Follow existing TypeScript conventions and strict compiler settings.
  3. Keep MCP handlers thin — put logic in services.
  4. Add tests for non-trivial changes.
  5. Run npm run validate before opening a PR.
  6. Write clear commit messages describing why, not just what.

FAQ

Does this require a TradingView account?
No. The server uses public scanner and chart endpoints. No login or API key is needed.

Can I run without Redis?
Yes. Set REDIS_ENABLED=false (default). Caching uses in-memory storage only.

Which exchanges are supported?
Any exchange with a symbol list in src/data/coinlist/ and a TradingView scanner market mapping in src/utils/validators.ts.

Are backtest results guaranteed?
No. Backtests use historical Yahoo Finance data with simulated costs. Past performance does not predict future results.

How do I handle rate limits?
Tune TRADINGVIEW_MCP_MAX_INFLIGHT, TRADINGVIEW_MCP_MIN_INTERVAL_S, and enable Redis caching to reduce duplicate upstream calls.

Is this financial advice?
No. This software is an informational tool. Consult a licensed professional before making financial decisions.


License

MIT — see LICENSE.

インストール

TypingMind
{
  "mcpServers": {
    "tradingview-mcp": {
      "command": "docker",
      "args": [
        "compose",
        "up",
        "-d"
      ]
    }
  }
}

TradingView MCP ServerのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度TradingView MCP Serverに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

TradingView MCP Serverをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. TradingView MCP ServerのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "tradingview-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "tradingview-mcp-server"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてTradingView MCP ServerのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. TradingView MCP ServerのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
TradingView MCP Serverを使ってこのタスクを手伝ってもらえますか?
TradingView MCP Server
はい、読みました。
TradingView MCP Serverで調べた結果をお伝えします。

よくある質問

TradingView MCP Server MCPサーバーは何に使いますか?

TradingView MCP Serverは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでTradingView MCP Server MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでTradingView MCP Serverを利用できます。

TypingMindでTradingView MCP Server MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。TradingView MCP Serverを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

TradingView MCP Server MCPをTypingMindに接続するにはどうすればよいですか?

TradingView MCP ServerはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでTradingView MCP Server MCPのどのようなツールを利用できますか?

TradingView MCP ServerはMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

TradingView MCP Server MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。TradingView MCP Serverで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇