tradingview-mcp-py
Provides trading analysis tools powered by TradingView's Screener API, including technical indicators, candlestick patterns, multi-timeframe analysis, and stock screening.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
J-SQUAD TradingView MCP — Python (tradingview-mcp-py)
30 tools · 5 modules — MCP server for stock analysis (TradingView Screener API, Yahoo Finance, IDX/BEI, backtesting, news sentiment, trade math). Lean edition, no CDP — no TradingView Desktop / Chrome required, so it's VPS-compatible.
Built by CenblueOne as part of the J-SQUAD system (IDX trading bot).
🤖 For AI agents / harnesses (Claude Code, Hermes, opencode, Cursor, Grok, etc.): read
AGENTS.md— architecture, how to run/test, tool inventory, and mandatory rules (never upgrademcp, never use"command": "python", etc.).
✨ Highlights
✅ No TradingView Desktop — uses TradingView public Screener API + Yahoo Finance (runs headless on servers/VPS)
✅ IDX-ready —
idx_*tools auto-append.JK(BBRI → BBRI.JK)✅ Graceful degradation — if a library is missing, only that module's tools are disabled
✅ Tested —
pytest13 tests passed (helpers + server import + market_cap mocked)✅ Multi-agent ready — one shared venv across many agents; per-agent config files; stdio (no port conflicts)
Related MCP server: Trading MCP Server
⚠️ Agent / AI Guide — Check FIRST Before Installing / Configuring
Read this section every time an agent (Claude Code, Hermes, opencode, Grok, etc.) wants to install / configure / upgrade this server. This server can be shared by MANY agents on one machine — the most common mistakes come from unnecessary re-installs or using
"command": "python".
Mandatory checklist:
Check whether it's already installed — don't blindly reinstall:
# venv exists? Test-Path "<REPO_DIR>\venv\Scripts\python.exe" # mcp 1.x installed? (MUST be < 2.0.0) & "<REPO_DIR>\venv\Scripts\python.exe" -c "import importlib.metadata as m; print(m.version('mcp'))"If it exists and mcp is
1.x→ STOP, don't install anything.NEVER upgrade / reinstall
mcp. The server uses themcp.server.fastmcp.FastMCPAPI which only exists in mcp 1.x. mcp 2.x completely reworked the API → the server fails to start.requirements.txtalready pinsmcp>=1.2.0,<2.0.0.NEVER use
"command": "python"/"command": "python3". Always point to the venv python with an absolute path — PATH differs per agent (e.g. store-alias on Windows, orpythonpointing to a different interpreter without dependencies). Venv path:<REPO_DIR>\venv\Scripts\python.exeNEVER reinstall / upgrade while another agent is running. The single
venvis shared.pip install/pip upgradein the middle mutates the dependencies used by all agents → other agents break (real case: mcp bumped to 2.x removedFastMCP). Install ONCE viainstall.bat.One venv + one server.py → many separate config files. Each agent has its own MCP config file; paste the same entry (see
mcp-config.example.json) into each file. Don't overwrite another agent's config.Verify after configuring — test 1 tool from EACH agent before using together:
# import must succeed without errors (run from the project folder) cd "<REPO_DIR>" & "<REPO_DIR>\venv\Scripts\python.exe" -c "import server; print('server OK')"Or call a tool directly from each agent's chat (
idx_price BBRI). Don't continue if any agent still errors.
📦 Modules & Tools (30 total)
Technical Analysis — 6 tools (tradingview-ta)
Tool | Description |
| Full TA: RSI, MACD, BB, EMA, ADX, Stoch, CCI |
| TA for many symbols (max 25, rate-limited) |
| Multi-timeframe: 1h + 4h + 1d + 1w alignment |
| Detect 15 candlestick patterns |
| Bollinger Band: position, bandwidth, squeeze |
| Screen stocks by TA signal + RSI filter |
Yahoo Finance — 4 tools (yfinance)
Tool | Description |
| Realtime price (AAPL, BTC-USD, BBRI.JK, ^JKSE) |
| Market cap + 52w high/low + TA context |
| Global snapshot: S&P500, NASDAQ, VIX, IHSG, BTC, ETH, GOLD, OIL, DXY |
| Historical OHLCV (configurable period + interval) |
IDX / BEI — 11 tools
Tool | Description |
| BEI stock price (auto |
| BEI stock TA via TradingView Screener |
| BEI stock MTF |
| IHSG snapshot + top 10 LQ45 + gainers/losers |
| Screen BEI stocks by movement & volume |
| BUY/SELL/HOLD signals for a BEI stock list |
| Backtest strategies on BEI stocks |
| 100pt stock score (trend/momentum/volatility) |
| Morning brief: scan BEI watchlist, rank TA + price |
| TA + Price + Sentiment → STRONG BUY/SELL |
| Live headlines (Yahoo, CNBC, MarketWatch) |
Backtesting — 3 tools (services/backtest_service.py)
Tool | Description |
| 1 strategy, institutional metrics |
| Compare 9 strategies, ranked by total return |
| Walk-forward, overfitting detection |
Trading Utilities & Sentiment — 6 tools
Tool | Description |
| Sentiment from Yahoo News for a symbol |
| Lot size by risk management |
| Risk:Reward ratio from entry/SL/TP |
| Log a trade to the local journal |
| Trade journal history |
| Global trading sessions (WIB / UTC+7) |
🔧 Requirements
Python >= 3.11 (tested on 3.11)
mcp >= 1.2.0, < 2.0.0 (MUST be 1.x — server uses mcp.server.fastmcp.FastMCP)
tradingview-ta >= 3.3.0
yfinance >= 0.2.40
pandas >= 2.0.0
numpy >= 1.24.0
feedparser >= 6.0.0
requests >= 2.31.0Not needed
websocket-client/ Chrome — the CDP module (TradingView Desktop) was removed on 03 Jul 2026.
🚀 Installation
install.bat(Windows) or the manual commands below — run ONCE. After installation, replace every<REPO_DIR>in the config examples with the absolute path where you cloned this repo on your machine.
Windows
install.batLinux / macOS (VPS-compatible)
python3 -m venv venv
venv/bin/pip install -r requirements.txtVerify (all OS)
venv/Scripts/python server.py # Windows
venv/bin/python server.py # Linux/macOS — MCP stdio server, waits for JSON-RPC on stdinNEVER run a bare
pip install mcp/ upgrade mcp.requirements.txtpinsmcp>=1.2.0,<2.0.0— mcp 2.x completely reworked the API and is incompatible.
Quick smoke test (no network)
venv/Scripts/pip install pytest # Windows
venv/bin/pip install pytest # Linux/macOS
venv/Scripts/python -m pytest # Windows → 13 passed
venv/bin/python -m pytest # Linux/macOS → 13 passed🤖 Per-Agent Configuration (Universal — stdio)
IMPORTANT: each agent has its own config file. Don't merge multiple agents into one file, and don't overwrite another agent's config.
Claude Code / Grok
~/.claude.json (global) or .mcp.json (project root) → mcpServers:
{
"mcpServers": {
"tradingview-mcp-py": {
"command": "<REPO_DIR>\\venv\\Scripts\\python.exe",
"args": ["<REPO_DIR>\\server.py"],
"env": {}
}
}
}Hermes Agent
~/.hermes/config.yaml → mcp_servers:
mcp_servers:
tradingview-mcp-py:
command: "<REPO_DIR>\\venv\\Scripts\\python.exe"
args: ["<REPO_DIR>\\server.py"]
type: stdioopencode
opencode.json (project root) → mcp:
{
"mcp": {
"tradingview-mcp-py": {
"type": "local",
"command": ["<REPO_DIR>\\venv\\Scripts\\python.exe", "<REPO_DIR>\\server.py"]
}
}
}Absolute path is MANDATORY for
command(venv python) andargs(server.py). Don't use"command": "python". Ready-to-use example:mcp-config.example.json.
Verify
After registering, call a tool from each agent's chat, e.g.:
get_ta BBRI exchange=IDX screener=indonesia
idx_deep_analysis TLKM
morning_brief_idx👥 Multi-Agent — Several Agents on 1 Machine
Same pattern as other MCP servers in this workspace (yfinance-mcp-final, invezgo-mcp):
Rule | Explanation |
1 venv + 1 server.py → N separate configs | All agents use the same venv & server, but each agent has its own config |
stdio | Each agent spawns its own Python process → no port conflicts, no stdout contention |
Absolute path |
|
mcp pinned to 1.x |
|
Install once | Don't reinstall while another agent is running — it mutates shared dependencies |
Check first | Before installing, run the checklist at the top of this README |
Most common error scenarios:
All tools error "unknown function" / import fails → venv was upgraded to mcp 2.x or system python was used. Check:
venv\Scripts\python -c "import importlib.metadata as m; print(m.version('mcp'))"→ must be1.x."python: can't open file 'server.py'" → use an absolute path, not relative.
Agent A works, agent B errors → usually agent B uses
"command": "python"pointing to a different Python / one without dependencies. Point all agents to the same venv.Yahoo rate limit (429) across 4 agents at once → expected; raise the
requests.Sessionretry inserver.pyor limit polling frequency.
🌐 All AI Clients (Model-Agnostic)
This server uses MCP stdio transport — usable by any AI model / client that supports MCP, not just one vendor:
Client | How to register |
Claude Code / Grok |
|
Claude Desktop | Add the block to |
Hermes Agent |
|
opencode |
|
Cursor / VS Code | Add to |
ChatGPT / others | If the client supports MCP stdio, point it to |
All clients above call the same tools (get_ta, idx_deep_analysis,
morning_brief_idx, etc.). Nothing is hardcoded to a specific model.
Multi-agent golden rule: one shared venv, but separate config per agent + absolute path. Don't merge all agents into a single config file.
💡 Usage Examples
Analyze BBRI:
Analyze BBRI on IDX — TA + sentiment + price→ combined_analysis(symbol="BBRI", exchange="IDX", screener="indonesia")
Morning scan IDX:
Run morning brief for IDX→ morning_brief_idx()
Backtest:
Backtest TLKM with supertrend strategy for 1 year→ idx_backtest(symbol="TLKM", strategy="supertrend", period="1y")
Position sizing:
Balance 10k, risk 1%, SL 50 pips, gold→ position_size(balance=10000, risk_pct=1, sl_pips=50, instrument="gold")
🧩 Module Dependency Map
TA tools → tradingview-ta
YF tools → yfinance
IDX tools → tradingview-ta + yfinance
News/Sentiment → feedparser + yfinance
Backtest → services/backtest_service.py (pandas/numpy)All modules degrade gracefully — missing library → only that module's tools are off.
🧪 Testing
venv\Scripts\pip install pytest
venv\Scripts\python -m pytest # 13 passed (helpers, server import, market_cap mocked)Tests don't need network (mock yfinance / tradingview_ta).
🔗 Part of J-SQUAD
The J-SQUAD IDX bot system:
ARA Hunter — ARA detection
Bandar Hunter — institutional accumulation detection
Signal Aggregator — signal aggregation
KINARA ENGINE — TradingView webhook → Telegram
📄 License
See the LICENSE file — MIT. Free to use, fork, and
develop. For security policy, see SECURITY.md.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Research-only MCP server: your AI as a quant research desk. 90 tools, no trades, no brokers.
> TradingMCP puts a market analyst inside your AI assistant. Paste one URL into Claude, ChatGPT, Cursor, VS Code or any MCP client and ask in plain language: screen for breakouts, run a multi-timeframe analysis, backtest a strategy with walk-forward validation, scan for smart-money and volume signals, or get a one-prompt morning market brief. In clients that support MCP Apps, price charts and the Markets panel are drawn right in the chat. > 40+ tools covering crypto (real-time), stocks, ETFs, FX, futures and commodities across major global exchanges. > Hosted, nothing to install: Pro $9/month (2,500 tool calls) or Pro+ $29/month (10,000). Paid upfront with a 14-day money-back guarantee; your API key arrives right after checkout. > Built on the open-source tradingview-mcp core (MIT, ~5k GitHub stars): self-host it free, or use the hosted version with zero ops. > For research and education, not financial advice. Not affiliated with TradingView
Stock analysis MCP: 38 indicators, 7 optimizers, 8 backtests, US + India sectors.
Production MCP server for US equity and options intelligence: real-time IV radar, Monte Carlo simulation, options pressure, strategy backtesting, AI prediction, pre-trade risk analysis, and automated stock research reports.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceThe most complete AI-powered trading toolkit for Claude and MCP clients, offering backtesting, live sentiment, Yahoo Finance, and 30+ technical analysis tools in one MCP server.MIT
- AlicenseAqualityDmaintenanceA comprehensive MCP server for stock analysis and trading insights, including stock screening, fundamental analysis, insider trading, options analysis, social media research, and news analysis.1075MIT
- FlicenseNot gradedqualityBmaintenanceA comprehensive MCP server that integrates TradingView Desktop automation, screener API, Yahoo Finance, IDX/BEI tools, backtesting, news sentiment, trade math, and market sessions. It enables traders to perform technical analysis, backtest strategies, manage positions, and automate TradingView tasks through natural language.-
- FlicenseBqualityDmaintenanceA TradingView-style market research and charting MCP server that provides tools for market data, indicators, watchlists, and local HTML chart rendering without scraping TradingView.9-