Get the FREE Ultimate OpenClaw Setup Guide →

TradingViewMCPServer

Professional multi-asset trading & Pine Script development MCP server for Claude. Features: 20+ indicators, Pine Script tools (validator, autocomplete, docs, testing), Forex/Stocks/Crypto support

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio lev-corrupted-tradingviewmcpserver python tradingview_mcp/server.py stdio \
  --env ALPHA_VANTAGE_API_KEY="your_key_here"

How to use

TradingViewMCPServer acts as a Claude Desktop integration layer that provides a multi-asset trading assistant with Pine Script development tooling. It exposes a set of MCP endpoints for health monitoring, market data retrieval, technical analysis, and Pine Script development support. Users can query current prices, run technical indicators, fetch volume and market profile data, and validate or convert Pine Script code directly through Claude Desktop. The server is designed to work with Forex, US stocks, and cryptocurrencies, and includes features like automatic retry logic, an LRU cache, and health statistics to ensure reliability in production environments.

How to install

Prerequisites:

  • Python 3.10+ (or Docker as an alternative).
  • Claude Desktop installed.
  • Alpha Vantage API key (free tier supported).

Option A: Standard installation (Python)

  1. Clone the repository: git clone https://github.com/lev-corrupted/TradingViewMCPServer.git cd TradingViewMCPServer
  2. Create and activate a virtual environment: python3 -m venv .venv source .venv/bin/activate # Windows: .venv\Scripts\activate
  3. Install dependencies in editable mode: pip install -e .
  4. Create a configuration file with your API key: echo "ALPHA_VANTAGE_API_KEY=your_key_here" > .env
  5. Run the server locally (example): python tradingview_mcp/server.py stdio

Option B: Docker (recommended for production)

  1. Clone the repo and navigate to it: git clone https://github.com/lev-corrupted/TradingViewMCPServer.git cd TradingViewMCPServer
  2. Create a .env file with your API key: echo "ALPHA_VANTAGE_API_KEY=your_key_here" > .env
  3. Build and run with Docker Compose: docker-compose up -d
  4. Check server logs: docker-compose logs -f

Note: The MCP config for Claude Desktop should point to the Python server script with the appropriate working path, e.g. tradingview_mcp/server.py with the stdio argument.

Additional notes

Tips & caveats:

  • Ensure ALPHA_VANTAGE_API_KEY is set in the environment or in a .env file accessible to the process.
  • For Docker deployments, use docker-compose to manage the container and restart policies.
  • The integration exposes a broad set of tools; rely on health_check and cache statistics to monitor performance in production.
  • When configuring Claude Desktop, provide the absolute path to the python executable and the absolute path to the server script to avoid path resolution issues.
  • If you encounter API rate limit messages, leverage the built-in 70% cache reduction to minimize external calls.

Related MCP Servers

Sponsor this space

Reach thousands of developers