Tradingview Chart MCP
Tradingview Chart MCP
README
MCP Server - TradingView Chart Image Scraper
This MCP server provides tools to fetch TradingView chart images based on ticker and interval.
Setup
-
Create Virtual Environment:
# Navigate to the project directory cd tradingview-chart-mcp # Create the venv (use python3 if python is not linked) python3 -m venv .venv -
Activate Virtual Environment:
- macOS/Linux:
source .venv/bin/activate - Windows (Git Bash/WSL):
source .venv/Scripts/activate - Windows (Command Prompt):
.venv\\Scripts\\activate.bat - Windows (PowerShell):
(Note: You might need to adjust PowerShell execution policy:.venv\\Scripts\\Activate.ps1Set-ExecutionPolicy RemoteSigned -Scope CurrentUser)
Your terminal prompt should now indicate you are in the
(.venv). - macOS/Linux:
-
Install Dependencies (inside venv):
pip install -r requirements.txt -
Configure Environment (for Local Testing):
- Copy
.env.exampleto.env. - Fill in your
TRADINGVIEW_SESSION_IDandTRADINGVIEW_SESSION_ID_SIGNin the.envfile. You can obtain these from your browser's cookies after logging into TradingView. - This
.envfile is used when running the server directly (e.g.,python main.py) for local testing. - Adjust optional scraper settings (
MCP_SCRAPER_HEADLESS, etc.) in.envif needed for local runs.
- Copy
-
Ensure ChromeDriver: Make sure
chromedriveris installed and accessible in your system's PATH, or configure thetview-scraper.pyaccordingly if it allows specifying a path.
Running the Server
Ensure your virtual environment is activated (source .venv/bin/activate or equivalent).
python main.py
Deactivating the Virtual Environment
When you are finished, you can deactivate the environment:
deactivate
Usage
Once the server is running (within the activated venv), you can interact with it using an MCP client, targeting the TradingView Chart Image server name.
Available Tools:
get_tradingview_chart_image(ticker: str, interval: str): Fetches the direct image URL for a TradingView chart.
Example Prompts:
- "Get the 15 minute chart for NASDAQ:AAPL"
- "Show me the daily chart for BYBIT:BTCUSDT.P"
- "Fetch TradingView chart image for COINBASE:ETHUSD on the 60 timeframe"
🔌 Using with MCP Clients (Claude Desktop / Cursor)
This server supports two ways of providing configuration:
- Via
.envfile (for local testing): When runningpython main.pydirectly, the server will load credentials and settings from a.envfile in the project directory. - Via Client Environment Variables (Recommended for Integration): When run by an MCP client (like Claude/Cursor), you should configure the client to inject the required environment variables directly. These will override any values found in a
.envfile.
Claude Desktop
-
Open your Claude Desktop configuration file:
- Windows:
%APPDATA%\\Claude\\claude_desktop_config.json - macOS:
~/Library/Application\ Support/Claude/claude_desktop_config.json
- Windows:
-
Add or merge the following within the
mcpServersobject. Provide your credentials in theenvblock:{ "mcpServers": { "tradingview-chart-mcp": { "command": "/absolute/path/to/your/tradingview-chart-mcp/.venv/bin/python3", "args": ["/absolute/path/to/your/tradingview-chart-mcp/main.py"], "env": { "TRADINGVIEW_SESSION_ID": "YOUR_SESSION_ID_HERE", "TRADINGVIEW_SESSION_ID_SIGN": "YOUR_SESSION_ID_SIGN_HERE" // Optional: Add MCP_SCRAPER_* variables here too if needed // "MCP_SCRAPER_HEADLESS": "False" } } // ... other servers if any ... } } -
Replace the placeholder paths (
command,args) with your actual absolute paths. -
Replace
YOUR_SESSION_ID_HEREandYOUR_SESSION_ID_SIGN_HEREwith your actual TradingView credentials. -
Restart Claude Desktop.
Cursor
-
Go to:
Settings -> Cursor Settings -> MCP -> Edit User MCP Config (~/.cursor/mcp.json). -
Add or merge the following within the
mcpServersobject. Provide your credentials in theenvblock:{ "mcpServers": { "tradingview-chart-mcp": { "command": "/absolute/path/to/your/tradingview-chart-mcp/.venv/bin/python3", "args": ["/absolute/path/to/your/tradingview-chart-mcp/main.py"], "env": { "TRADINGVIEW_SESSION_ID": "YOUR_SESSION_ID_HERE", "TRADINGVIEW_SESSION_ID_SIGN": "YOUR_SESSION_ID_SIGN_HERE" // Optional: Add MCP_SCRAPER_* variables here too if needed // "MCP_SCRAPER_HEADLESS": "False" } } // ... other servers if any ... } } -
Replace the placeholder paths (
command,args) with your actual absolute paths. -
Replace
YOUR_SESSION_ID_HEREandYOUR_SESSION_ID_SIGN_HEREwith your actual TradingView credentials. -
Restart Cursor.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.