This MCP server provides tools to fetch TradingView chart images based on ticker and interval.
-
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.ps1
Set-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.
Ensure your virtual environment is activated (source .venv/bin/activate or equivalent).
python main.pyWhen you are finished, you can deactivate the environment: