This MCP server provides a powerful way to fetch TradingView chart images with optimized browser pooling technology, offering 70-80% better performance for concurrent requests compared to traditional methods.
# Navigate to the project directory
cd tradingview-chart-mcp
# Create the venv
python3 -m venv .venv
# Activate (macOS/Linux)
source .venv/bin/activate
# Activate (Windows - Command Prompt)
.venv\Scripts\activate.bat
# Activate (Windows - PowerShell)
.venv\Scripts\Activate.ps1
pip install -r requirements.txt
Configure environment:
.env.example
to .env
Ensure ChromeDriver is installed and accessible in your system's PATH.
For optimal performance with browser pooling:
python main_optimized.py
Legacy version (simple approach):
python main.py
# Custom port
python main_optimized.py --transport streamable-http --port 8003
# Enable authentication
python main_optimized.py --auth
# Adjust concurrency
python main_optimized.py --max-concurrent 6
# Disable browser pooling
python main_optimized.py --disable-pooling
Fetches a TradingView chart image for a specified 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:
Example usage:
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
Returns detailed 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 can be configured with these environment variables:
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
feature captures chart images directly as base64 data URLs:
# Enable clipboard image capture (DEFAULT)
MCP_SCRAPER_USE_SAVE_SHORTCUT=True
# Disable and use traditional screenshot links
MCP_SCRAPER_USE_SAVE_SHORTCUT=False
Edit the Claude Desktop configuration file:
%APPDATA%\Claude\claude_desktop_config.json
~/Library/Application\ Support/Claude/claude_desktop_config.json
Add the following to the mcpServers
object:
{
"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
npx -y @smithery/cli install @ertugrul59/tradingview-chart-mcp --client claude
If you encounter issues with the optimized version:
python main_optimized.py --disable-pooling
python main.py
python main_optimized.py --log-level DEBUG
When finished, deactivate your virtual environment:
deactivate
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