TradingView MCP Server

repository·main·Indexed 25 days ago

https://github.com/atilaahmettaner/tradingview-mcp

A Model Context Protocol (MCP) server providing AI assistants with real-time market data, 30+ technical analysis tools, and financial intelligence. Features include walk-forward backtesting for 9 strategies, sentiment analysis via Marketaux, Yahoo Finance integration, and multi-timeframe analysis. Supports integration with Claude Desktop, Codex, and OpenClaw for messaging platforms like Telegram and WhatsApp.

Tokens
18K
Snippets
35
Records
121
Agent score
88%

What's inside tradingview-mcp

  1. Integrate tradingview-mcp with OpenClaw

    main

    Connect your tradingview-mcp AI Trading Intelligence Framework to communication channels like Telegram, WhatsApp, and Discord using OpenClaw. This allows you to interact with trading tools via plain language messages from any device.

    Prerequisites

    • OpenClaw installed and running (openclaw doctor must return healthy).
    • A running gateway (e.g., Hetzner VPS or local machine).
    • uv installed on the same machine as OpenClaw.
  2. Configure TradingView MCP for Claude Desktop

    main

    To use the TradingView MCP server with Claude Desktop, add the following configuration to your claude_desktop_config.json file.

    Config File Locations:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
    • Linux: ~/.config/Claude/claude_desktop_config.json

    This configuration uses uv to run the server directly from the GitHub repository.

    {
      "mcpServers": {
        "tradingview-mcp": {
          "command": "uv",
          "args": [
            "tool",
            "run",
            "--from",
            "git+https://github.com/atilaahmettaner/tradingview-mcp.git",
            "tradingview-mcp"
          ]
        }
      }
    }
  3. Execute Advanced Trading Strategies

    main

    The server supports complex analysis patterns through natural language:

    • Multi-Timeframe Analysis: Compare performance across different intervals (e.g., 15m, 1h, 1D, 1W) to check for trend alignment.
    • Pattern Recognition: Scan for specific candlestick patterns, such as consecutive bullish or bearish candles.
    • Swing Trading: Find assets in oversold territory using RSI and rating filters.
    • Day Trading: Identify volatile assets with high volume using Bollinger Band scans.
    💬 You: "Find coins showing consecutive bullish candle patterns"
    [Uses: consecutive_candles_scan(pattern_type="bullish", timeframe="1h")]
  4. Setup TradingView MCP for Local Development

    main

    If you want to modify the code or run the server locally, follow these steps:

    1. Clone the repository.
    2. Install dependencies using uv sync.
    3. Configure your MCP client (Claude Desktop or Codex) to point to your local installation.

    Claude Desktop Config (macOS/Linux): Use uv run python and specify the cwd (current working directory) to your local clone path.

    Claude Desktop Config (Windows): It is recommended to use the direct path to the .venv Python executable for better reliability.

    # Clone and setup
    git clone https://github.com/atilaahmettaner/tradingview-mcp.git
    cd tradingview-mcp
    uv sync
    
    # Test the server locally
    uv run python src/tradingview_mcp/server.py
  5. Perform Cross-Exchange and Sentiment Analysis

    main

    Use the server for broader market context:

    • Cross-Exchange Comparison: Compare the price of a single asset across multiple exchanges (e.g., KuCoin vs Binance vs Bybit) to identify arbitrage opportunities or best entry points.
    • Market Sentiment Analysis: Get an overview of market mood by combining gainers, losers, RSI, and breakout data.
    • Sector Rotation: Analyze which categories (e.g., DeFi, Layer 1s, Meme Coins) are currently leading the market.
  6. Optimize Prompts for TradingView MCP

    main

    To get the most accurate and actionable results from the AI assistant, follow these prompting best practices:

    StrategyGood Prompt ExampleAvoid This Example
    Specificity"Find oversold crypto with RSI below 30 on KuCoin""Find good crypto"
    Comparison"Compare Bitcoin 15m vs 1h trends""How is Bitcoin?"
    Context"Show BIST stocks with Bollinger squeeze""Turkish stocks analysis"
  7. Install the UV Package Manager

    main

    UV is required for dependency management. Install it using one of the following methods based on your operating system:

    • macOS (Homebrew): brew install uv
    • macOS/Linux (Direct): Use the curl script.
    • Windows (PowerShell): Use the PowerShell command.

    Verify the installation with uv --version.

  8. Conduct Technical Analysis on Individual Assets

    main

    Request a comprehensive technical analysis for a specific symbol. The server provides data on:

    • Price Action: Current price, 24h change, highs, and lows.
    • Bollinger Bands: Rating (e.g., BUY/SELL), Bandwidth (BBW), and position.
    • Technical Indicators: RSI, MACD, and EMA (50/200).
    • Trading Signal: A summarized recommendation (e.g., BUY, SELL, NEUTRAL).
    💬 You: "Give me a complete technical analysis of Bitcoin"
    [Uses: coin_analysis(symbol="BTCUSDT", exchange="KUCOIN", timeframe="1D")]
  9. Pre-install tradingview-mcp-server to warm cache

    main

    To avoid timeout errors during the initial Claude Desktop startup, run the following command in your terminal to pre-install the server using Python 3.13. This ensures the virtual environment and dependencies are ready before Claude attempts to connect.

    uv tool install --python 3.13 tradingview-mcp-server