AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
MCP unreviewed MIT Self-run

Tradingview Mcp

mcp-atilaahmettaner-tradingview-mcp · by atilaahmettaner

TradingView MCP server — real-time market data, technical analysis, screeners & backtesting for Claude, ChatGPT, Cursor & any MCP client. Stocks, crypto, forex & futures across global exchanges. Hosted or self-host.

— No reviews yet
0 installs
41 views
0.0% view→install

Install

$ agentstack add mcp-atilaahmettaner-tradingview-mcp

Open-source listing, not yet scanned by AgentStack. Follow the source repository for install instructions.

Security review

⚠ Flagged

1 finding(s); flagged for manual review. · v0.1.0 How review works →

  • • Prompt-injection patterns
  • • Secret / credential exfiltration
  • • Dangerous shell & filesystem operations
  • • Untrusted network calls
  • • Known-malicious package signatures
  • high Pipes remote content directly into a shell (remote code execution).

What it can access

  • ● Network access Used
  • ✓ Filesystem access No
  • ✓ Shell / process execution No
  • ✓ Environment & secrets No
  • ✓ Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Reliability & compatibility

— Not yet reviewed
0 installs to date
— no reviews yet
● 2mo ago

Declared compatibility

Claude CodeClaude DesktopCursorWindsurf

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Tradingview Mcp? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

TradingView MCP Market Data & Technical Analysis for AI Assistants

TradingView MCP server — real-time market data, technical indicators, screeners, and backtesting for Claude, ChatGPT, Cursor, Copilot, and any MCP client. Stocks, crypto, forex & futures across global exchanges. Backtesting + live sentiment + Yahoo Finance + 30+ technical-analysis tools — the most complete TradingView MCP toolkit, all in one server.

> [!NOTE] > Independent open-source project — not affiliated with, endorsed by, or associated with TradingView Inc. "TradingView" is a trademark of its respective owner; this project consumes third-party market data and is not a TradingView product.

> [!NOTE] > Does it need — or risk — your TradingView account? No. This server does not log into, scrape, or automate a TradingView session, and it requires no TradingView account or API key. Market data is fetched server-side from public endpoints, so there is no account of yours in the loop and no browser/UI automation. (This is different from MCP servers that drive the TradingView Desktop app via Chrome DevTools.) You are responsible for ensuring your own use complies with the terms of any data source you point it at.

> [!IMPORTANT] > Not financial advice. Nothing produced by this software is investment, financial, legal, tax, or accounting advice. tradingview-mcp is an informational and educational analysis tool. Its outputs, including indicators, scores, signals, "trade setups", entries, stop losses, and targets, are computed from third party market data and are not recommendations to buy, sell, or hold any asset. It does not execute trades, manage money, or guarantee any result. Trading and investing carry a substantial risk of loss, and you can lose some or all of your capital. Always do your own research and consult a licensed professional before making any financial decision. You are solely responsible for your own decisions and for complying with the laws and regulations that apply to you. Market data may be delayed, inaccurate, or incomplete, and is provided without warranty.

> [!TIP] > Prefer zero setup? Use the hosted version. pro.cryptosieve.com serves all 30+ tools as one connector URL for Claude.ai, ChatGPT, Copilot, and Cursor — no uv, pandas, or Python to wrangle. From $9/mo (Pro) or $29/mo (Pro+ — higher limits), with a 3-day free trial. Self-hosting stays free forever; hosted is just for folks who'd rather skip the ops. (Full self-host vs hosted comparison in Quick Start below.)

[](https://opensource.org/licenses/MIT) [](https://www.python.org/downloads/) [](https://modelcontextprotocol.com/) [](https://openclaw.ai) [](https://github.com/atilaahmettaner/tradingview-mcp/releases) [](https://pypi.org/project/tradingview-mcp-server/) [](https://github.com/sponsors/atilaahmettaner)

> ⭐ If this tool improves your workflow, please star the repo and consider sponsoring — it keeps the project alive and growing!


🎥 Framework Demo

https://github-production-user-asset-6210df.s3.amazonaws.com/67838093/478689497-4a605d98-43e8-49a6-8d3a-559315f6c01d.mp4


🆕 What's New

Stability & Strategy Expansion (May 2026)

  • 9 backtest strategies (up from 6) — added rsi_pullback, keltner_breakout, and triple_ema, covering trend-pullback, ATR-normalized breakout, and SMA200-filtered EMA cross edges. compare_strategies now ranks the full 9.
  • Resilience layer — automatic retry + 60-second TTL cache on the TradingView screener provider, eliminating transient "Expecting value" errors on combined_analysis and multi_timeframe_analysis. (PR #32 — merged)
  • Financial news service rebuild — replaces deprecated Reuters RSS endpoints with Yahoo Finance, MarketWatch, and CNBC. Fixes the long-standing count: 0 bug on financial_news. (PR #33 — merged)
  • TA throttle — caps concurrent tradingview_ta calls (default 4) + min 0.8s spacing between starts. Prevents parallel bursts of combined_analysis / multi_timeframe_analysis from hitting TradingView's empty-body rate-limit cliff. Tunable via env vars. (PR #34 — merged)
  • Walk-forward backtesting (walk_forward_backtest_strategy) — train/test split with overfitting verdict (ROBUST / MODERATE / WEAK / OVERFITTED).
  • Hourly (1h) timeframe support across backtest_strategy, compare_strategies, and walk_forward_backtest_strategy.
  • Full trade log + equity curve outputs (include_trade_log=True, include_equity_curve=True).

🏗️ Architecture


✨ Why tradingview-mcp?

| Feature | tradingview-mcp | Traditional Setups | Bloomberg Terminal | |---------|-------------------|--------------------|--------------------| | Setup Time | 5 minutes | Hours (Docker, Conda...) | Weeks (Contracts) | | Cost | Free & Open Source | Variable | $30k+/year | | Backtesting | ✅ 9 strategies + Walk-forward + Sharpe | ❌ Manual scripting | ✅ Proprietary | | Live Sentiment | ✅ Reddit + RSS news | ❌ Separate setup | ✅ Terminal | | Market Data | ✅ Live / Real-Time | Historical / Delayed | Live | | API Keys | None required | Multiple (OpenAI, etc.) | N/A |


🚀 Quick Start (5 Minutes)

Two ways to run it — the same 30+ tools either way:

| | 🧑‍💻 Self-host (this repo) | ☁️ Hosted — pro.cryptosieve.com | |---|---|---| | Price | Free forever (MIT) | $9/mo Pro · $29/mo Pro+ · 3-day trial | | Time to first call | ~5 minutes (Python + uv) | ~60 seconds (paste one URL) | | Updates & ops | You run and update it | Managed — always on the latest | | Runs on | Your machine or VPS | Hosted, streamed from the edge | | Limits | Your hardware | 2,500/mo · 60/min (Pro) → 10,000/mo · 150/min (Pro+) | | Best for | Tinkerers, forkers, full control | Folks who'd rather skip the ops |

> ☁️ Zero setup: paste one connector URL into Claude.ai, ChatGPT, Copilot, or Cursor → start a 3-day free trial. Everything below is for self-hosting.

Install via pip

pip install tradingview-mcp-server

Claude Desktop Config (claude_desktop_config.json)

> Note: On macOS, GUI apps like Claude Desktop may not have ~/.local/bin in their PATH. Use the full path to uvx to avoid "command not found" errors.

{
  "mcpServers": {
    "tradingview": {
      "command": "/Users/YOUR_USERNAME/.local/bin/uvx",
      "args": ["--from", "tradingview-mcp-server", "tradingview-mcp"]
    }
  }
}

On Linux, replace /Users/YOUR_USERNAME with /home/YOUR_USERNAME. On Windows, use %USERPROFILE%\.local\bin\uvx.exe.

Codex Plugin Config

This repository also includes mcp-only Codex plugin metadata:

  • .codex-plugin/plugin.json
  • .codex-mcp.json

The plugin uses the same PyPI package entrypoint:

{
  "mcpServers": {
    "tradingview": {
      "command": "uvx",
      "args": ["--from", "tradingview-mcp-server", "tradingview-mcp"]
    }
  }
}

After installing or enabling the Codex plugin, restart Codex so the MCP server is loaded in the next session. Depending on your Codex version, codex mcp list may show registered MCP servers, but tool availability should be verified in a fresh Codex session.

Or run from source

git clone https://github.com/atilaahmettaner/tradingview-mcp
cd tradingview-mcp
uv run tradingview-mcp

🛠️ Troubleshooting

🪟 Windows: MCP error -32001: Request timed out on first launch

Symptom — you see this in the Claude Desktop logs shortly after adding the config:

[tradingview] Server started and connected successfully
[tradingview] Message from client: initialize ...
[60 seconds later]
[tradingview] notifications/cancelled — reason: "MCP error -32001: Request timed out"

Why it happens: on Windows with Python 3.14, uvx downloads tradingview-mcp-server, creates a fresh virtualenv, and installs dependencies the first time it runs. Because pandas has no prebuilt wheel for Python 3.14 yet, pip falls back to a source build — which typically exceeds Claude Desktop's 60-second MCP initialization timeout.

Fix — pin to Python 3.13 (has prebuilt pandas wheels):

{
  "mcpServers": {
    "tradingview": {
      "command": "uvx",
      "args": ["--python", "3.13", "--from", "tradingview-mcp-server", "tradingview-mcp"]
    }
  }
}

On macOS use the full path to uvx (see the note in Quick Start). On Windows uvx is typically %USERPROFILE%\.local\bin\uvx.exe.

Alternative — pre-install once, then let Claude Desktop reuse the cache:

# Run in a terminal before launching Claude Desktop
uv tool install --python 3.13 tradingview-mcp-server

After the install finishes, start Claude Desktop with the normal config and the server will come up instantly (cache is already warm).

> Credit: @wyh4444 for the original report in #24.


⚠️ Error Envelope Format

Tools that have adopted the structured error format return either their normal payload or an error envelope:

{"error": {"code": "ALL_BATCHES_FAILED", "message": "All 5 batches failed; first error: JSONDecodeError(...)", "batches_attempted": 5, "batches_failed": 5, "first_error": "..."}}

Why: the previous [] / {"error": "Analysis failed: ..."} strings made it impossible to distinguish "no matches today" from "upstream rate-limit cliff." The new envelope is programmatically branchable by code.

Currently adopted by: top_gainers, top_losers, rating_filter, volume_breakout_scanner, smart_volume_scanner. More tools will follow in subsequent PRs.

Detecting an error:

result = volume_breakout_scanner(exchange="KUCOIN")
if isinstance(result, dict) and "error" in result:
    code = result["error"]["code"]
    if code == "ALL_BATCHES_FAILED":
        # Wait + retry, raise alert, fall back to single-batch call, etc.
        ...
else:
    for row in result:
        ...

Stable codes are defined in [core/errors.py](src/tradingview_mcp/core/errors.py).


📱 Use via Telegram, WhatsApp & More (OpenClaw)

Connect this server to Telegram, WhatsApp, Discord and 20+ messaging platforms using OpenClaw — a self-hosted AI gateway. Tested & verified on Hetzner VPS (Ubuntu 24.04).

How It Works

> OpenClaw routes Telegram messages to an AI agent. The agent uses trading.py — a thin Python wrapper — to call tradingview-mcp functions and return formatted results. No MCP protocol needed between OpenClaw and the server; it's a direct Python import.

Telegram → OpenClaw agent (AI model) → trading.py (bash) → tradingview-mcp → Yahoo Finance

Quick Setup

# 1. Install UV and tradingview-mcp
curl -LsSf https://astral.sh/uv/install.sh | sh && source ~/.bashrc
uv tool install tradingview-mcp-server

# 2. Configure OpenClaw channels
cat > ~/.openclaw/openclaw.json  ⚠️ **Important:** Prefix must match your provider. `google/...` needs a Google API key. `openrouter/...` needs an OpenRouter key.

### ⚠️ Common Mistakes

| Symptom | Cause | Fix |
|---------|-------|-----|
| `Unrecognized keys: mcpServers` | `mcpServers` not supported in this version | Remove from config, use bash wrapper |
| `No API key for provider "google"` | Used `google/model` but only have OpenRouter key | Use `openrouter/google/model` instead |
| `which agent?` loop | `acp.defaultAgent` not set | `openclaw config set acp.defaultAgent main` |
| Gateway won't start | `gateway.mode` missing | `openclaw config set gateway.mode local` |

### Test Your Bot

Once running, send your Telegram bot:

market snapshot backtest RSI strategy for AAPL, 1 year compare all strategies for BTC-USD


👉 **[Full OpenClaw Setup Guide →](OPENCLAW.md)**

---

Unlike basic screeners, this framework deploys **specialized AI agents** that debate findings in real-time:

1. **🛠️ Technical Analyst** — Bollinger Bands (±3 proprietary rating), RSI, MACD
2. **🌊 Sentiment & Momentum Analyst** — Reddit community sentiment + price momentum
3. **🛡️ Risk Manager** — Volatility, drawdown risk, mean-reversion signals

*Output: `STRONG BUY` / `BUY` / `HOLD` / `SELL` / `STRONG SELL` with confidence score*

---

## 🔧 All 30+ MCP Tools

### 📊 Backtesting Engine

| Tool | Description |
|------|-------------|
| `backtest_strategy` | Backtest 1 of 9 strategies with institutional metrics (Sharpe, Calmar, Expectancy). Supports `1d` and `1h` timeframes; optional full trade log + equity curve. |
| `compare_strategies` | Run all 9 strategies on the same symbol and rank by performance. |
| `walk_forward_backtest_strategy` | Train/test split walk-forward validation with overfitting verdict (ROBUST / MODERATE / WEAK / OVERFITTED). |

**9 Strategies to Test:**
- `rsi` — RSI oversold/overbought mean reversion
- `bollinger` — Bollinger Band mean reversion
- `macd` — MACD golden/death cross
- `ema_cross` — EMA 20/50 Golden/Death Cross
- `supertrend` — ATR-based Supertrend trend following 🔥
- `donchian` — Donchian Channel breakout (Turtle Trader style)
- `rsi_pullback` — Dip-buy in confirmed uptrend (SMA50>SMA200 + RSI 🆕 strategies require `period='1y'` or `'2y'` so the SMA200 trend filter can complete its warmup.

**Metrics you get:** Win Rate, Total Return, Sharpe Ratio, Calmar Ratio, Max Drawdown, Profit Factor, Expectancy, Best/Worst Trade, vs Buy-and-Hold, with **realistic commission + slippage simulation**.

Example prompt: "Compare all 9 strategies on MSFT for 2 years" → #1 tripleema: +15.1% | Sharpe: 0.0 | WR: 100% → #2 keltnerbreakout: +14.3% | Sharpe: 4.7 | WR: 40% → #3 bollinger: +12.2% | Sharpe: 4.1 | WR: 64% → Buy & Hold: -2.1%


---

### 💰 Yahoo Finance — Real-Time Prices *(New in v0.6.0)*

| Tool | Description |
|------|-------------|
| `yahoo_price` | Real-time quote: price, change %, 52w high/low, market state |
| `market_snapshot` | Global overview: S&P500, NASDAQ, VIX, BTC, ETH, EUR/USD, SPY, GLD |

**Supports:** Stocks (AAPL, TSLA, NVDA), Crypto (BTC-USD, ETH-USD, SOL-USD), ETFs (SPY, QQQ, GLD), Indices (^GSPC, ^DJI, ^IXIC, ^VIX), FX (EURUSD=X), Turkish (THYAO.IS, SASA.IS)

---

### 🧠 AI Sentiment & Intelligence

| Tool | Description |
|------|-------------|
| `market_sentiment` | Reddit sentiment across finance communities (bullish/bearish score, top posts) |
| `financial_news` | Live RSS headlines from Yahoo Finance, MarketWatch, CNBC, CoinDesk, CoinTelegraph |
| `combined_analysis` | **Power Tool**: TradingView technicals + Reddit sentiment + live news → confluence decision. Now backed by retry + 60s cache for resilience against transient screener errors. |

---

### 📈 Technical Analysis Core

| Tool | Description |
|------|-------------|
| `get_technical_analysis` | Full TA: RSI, MACD, Bollinger, 23 indicators with BUY/SELL/HOLD |
| `get_multiple_analysis` | Bulk TA for multiple symbols at once |
| `get_bollinger_band_analysis` | Proprietary ±3 BB rating system |
| `get_stock_decision` | 3-layer decision engine (ranking + trade setup + quality score) |
| `screen_stocks` | Multi-exchange screener with 20+ filter criteria |
| `scan_by_signal` | Scan by signal type (oversold, trending, breakout...) |
| `get_candlestick_patterns` | 15 candlestick pattern detector |
| `get_multi_timeframe_analysis` | Weekly→Daily→4H→1H→15m alignment analysis |

---

### 🌍 Multi-Exchange Support

| Exchange | Tools |
|----------|-------|
| **Binance** | Crypto screener, all pairs |
| **KuCoin / Bybit+** | Crypto screener |
| **NASDAQ / NYSE** | US stocks (AAPL, TSLA, NVDA...) |
| *

…

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [atilaahmettaner](https://github.com/atilaahmettaner)
- **Source:** [atilaahmettaner/tradingview-mcp](https://github.com/atilaahmettaner/tradingview-mcp)
- **License:** MIT
- **Homepage:** https://pro.cryptosieve.com

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.