The TradingView Chart MCP server provides a powerful tool for fetching TradingView chart images with optimized browser pooling technology that delivers 70-80% better performance for concurrent requests. This service allows you to easily retrieve chart snapshots for any ticker and timeframe.
First, create and activate a virtual environment:
# Navigate to the project directory
cd tradingview-chart-mcp
# Create the virtual environment
python3 -m venv .venv
# Activate the virtual environment (macOS/Linux)
source .venv/bin/activate
# Activate the virtual environment (Windows - Git Bash/WSL)
source .venv/Scripts/activate
# Activate the virtual environment (Windows - Command Prompt)
.venv\Scripts\activate.bat
# Activate the virtual environment (Windows - PowerShell)
.venv\Scripts\Activate.ps1
Install dependencies:
pip install -r requirements.txt
Create an environment file by copying the example:
cp .env.example .env
Edit your .env
file to include your TradingView credentials:
TRADINGVIEW_SESSION_ID
: Your TradingView session IDTRADINGVIEW_SESSION_ID_SIGN
: Your TradingView session ID signatureThese credentials can be obtained from your browser cookies after logging into TradingView.
For maximum performance with browser pooling:
python main_optimized.py
Customize server behavior with these options:
# Use HTTP transport with custom port
python main_optimized.py --transport streamable-http --port 8003
# Enable authentication (default for TradingView)
python main_optimized.py --auth
# Adjust concurrency
python main_optimized.py --max-concurrent 6
# Disable browser pooling (fallback to traditional)
python main_optimized.py --disable-pooling
# Debug mode
python main_optimized.py --log-level DEBUG
The server provides these main tools:
Fetches a TradingView chart image for a specific ticker and interval.
Arguments:
ticker
(str): TradingView ticker symbol (e.g., "BYBIT:BTCUSDT.P", "NASDAQ:AAPL")interval
(str): Chart time interval (e.g., '1', '5', '15', '60', '240', 'D', 'W')Returns:
Returns performance metrics about the server.
Example Output:
🚀 OPTIMIZED TRADINGVIEW MCP SERVER PERFORMANCE STATS
• Total Requests: 12
• Average Time: 3.30s
• Performance Improvement: 70.8%
• Browsers in Pool: 4
• Max Concurrent: 4
The server understands natural language chart requests like:
Fine-tune behavior with these settings:
TRADINGVIEW_SESSION_ID
: Your TradingView session ID (required)TRADINGVIEW_SESSION_ID_SIGN
: Your TradingView session ID signature (required)MCP_SCRAPER_HEADLESS
: Run browser in headless mode (default: True
)MCP_SCRAPER_WINDOW_WIDTH
: Browser window width (default: 1920
)MCP_SCRAPER_WINDOW_HEIGHT
: Browser window height (default: 1080
)MCP_SCRAPER_USE_SAVE_SHORTCUT
: Use clipboard image capture (default: True
)MCP_SCRAPER_CHART_PAGE_ID
: Custom chart page ID (optional)The MCP_SCRAPER_USE_SAVE_SHORTCUT
setting controls how images are captured:
True
(default): Captures images directly to clipboard as base64 dataFalse
: Uses traditional screenshot linksEdit your Claude Desktop configuration file:
%APPDATA%\Claude\claude_desktop_config.json
~/Library/Application\ Support/Claude/claude_desktop_config.json
Add the server configuration:
{
"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"
}
}
}
}
Settings -> Cursor Settings -> MCP -> Edit User MCP Config (~/.cursor/mcp.json)
npx -y @smithery/cli install @ertugrul59/tradingview-chart-mcp --client claude
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "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"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"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"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"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"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect