This MCP server provides tools to fetch TradingView chart images based on ticker and interval, allowing you to easily integrate TradingView charts into your applications or workflows.
# Navigate to the project directory
cd tradingview-chart-mcp
# Create the venv
python3 -m venv .venv
macOS/Linux:
source .venv/bin/activate
Windows (Git Bash/WSL):
source .venv/Scripts/activate
Windows (Command Prompt):
.venv\Scripts\activate.bat
Windows (PowerShell):
.venv\Scripts\Activate.ps1
You may need to adjust PowerShell execution policy: Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
pip install -r requirements.txt
.env.example
to .env
TRADINGVIEW_SESSION_ID
TRADINGVIEW_SESSION_ID_SIGN
You can obtain these values from your browser's cookies after logging into TradingView.
Ensure chromedriver
is installed and accessible in your system's PATH.
With your virtual environment activated:
python main.py
When finished, deactivate the environment:
deactivate
The server provides the following tool:
get_tradingview_chart_image(ticker: str, interval: str)
: Fetches the direct image URL for a TradingView chartOpen your 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 (~/.cursor/mcp.json)
For automatic installation with Claude Desktop:
npx -y @smithery/cli install @ertugrul59/tradingview-chart-mcp --client claude
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 determines how chart images are captured:
True
(default): Uses keyboard shortcuts to capture chart images directly as base64 data URLsFalse
: Uses traditional screenshot links, then converts to image URLsBenefits of using the save shortcut include faster capture, more reliable operation, and offline functionality once the chart is loaded.
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 > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.