TradingView MCP Server

TradingView MCP Server

Pulls Binance spot candle data, computes technical indicators (RSI, MACD, EMAs), and evaluates user-defined bias and risk rules without needing a TradingView session.

Category
Visit Server

README

tradingview-mcp

An MCP server for the crypto chart-analysis workflow described in config/rules.json: it pulls candles, computes the indicators you care about, and evaluates your bias and risk rules against them.

Design note: why this does not attach to TradingView

The setup guide this started from drove the TradingView desktop app over the Chrome DevTools Protocol (--remote-debugging-port=9222). That approach hands the server full control of a browser session you are logged into — it can read your account, not just your charts.

Nothing in rules.json needs it. Binance spot pairs, 1W/1D/4H candles, RSI, MACD, EMAs and volume are all available from public endpoints with no authentication. So this server reads public market data, holds no credentials, and never touches a logged-in session.

The one thing the CDP approach would buy you is data this cannot reach: your saved layouts and drawings, paid indicators, and exchange feeds you subscribe to. If you need those, that is the tradeoff to reopen deliberately.

Install

npm install
npm test          # 46 unit + integration tests, no network required
npm run smoke     # live end-to-end check against the real API

Register it with Claude Code by merging config/mcp-entry.json into ~/.claude.json, replacing <HOME> with your home directory:

{
  "mcpServers": {
    "tradingview": { "command": "node", "args": ["<HOME>/tradingview-mcp/src/server.js"] }
  }
}

If mcpServers already exists, add the tradingview key to it rather than replacing the object.

Point the server at a different rules file with TRADINGVIEW_MCP_RULES=/path/to/rules.json.

Tools

Tool What it does
tv_health_check Config + data source reachability. Reports ready: false rather than failing.
get_rules The loaded rules.json, including resolved defaults.
get_price Latest traded price.
get_candles Raw OHLCV, oldest first.
get_indicators RSI, MACD, trend EMA, 200 EMA, volume, market structure.
get_bias Bias for one symbol/timeframe, with every condition shown.
scan_watchlist Bias across the whole watchlist and all timeframes.
get_macro_snapshot Current CRYPTOCAP TOTAL / TOTAL3 / BTC.D.
check_risk Position size and R:R from your risk rules.

How bias is decided

bias_criteria in rules.json is prose — useful for a human and for the model, but not machine-parseable. The numeric thresholds that actually drive get_bias live in bias_engine, so the two are kept deliberately in sync.

A symbol is bullish only when all three hold: price above the trend EMA, daily RSI inside the bull band, and market structure showing higher highs and higher lows. Bearish is the mirror. Anything else is neutral.

get_bias always returns the individual condition results alongside the label, so you can see why — and if an input is unavailable (for example a 200 EMA on a pair without 200 bars of history) it returns unknown with the reason rather than a number it cannot support.

Two deliberate consequences worth knowing:

  • RSI above 70 is not bullish. Your band tops out at 70, so a vertical melt-up reads as neutral, not as a long signal.
  • The RSI gate always comes from the daily, even when judging the 4H, because rules.json specifies the RSI condition "on daily".

The EMA period

Your original rules had a contradiction: all three bias_criteria referenced a 500 EMA, while indicators_i_care_about listed only the 50 and 200. I set bias_engine.trend_ema_period to 50, matching your indicator list — a 500 EMA on the weekly would need roughly a decade of candles, which most of these pairs do not have.

If you meant 500, it is a one-line change in config/rules.json, and the unknown path means you will get an honest "not enough history" rather than a silently wrong answer.

Data sources and their limits

Binance public REST for spot pairs; CoinGecko /global for the CRYPTOCAP aggregates.

The CRYPTOCAP entries are current values only — free market-cap history is not available, so get_indicators and get_bias refuse them rather than inventing a series. scan_watchlist skips them and lists them under skipped_macro. TOTAL3 is derived as TOTAL x (1 - BTC.D - ETH.D).

Binance geo-blocks some regions. If tv_health_check reports unreachable from a network you expect to work, that is the first thing to check.

Testing

npm test runs entirely offline: the indicator math is verified against Wilder's published RSI reference values, and the MCP layer is driven by a real client over an in-memory transport with a stubbed data source.

npm run smoke is the part that needs real network — it launches the server over stdio the way a client does and calls the live API.

Not financial advice

This reports what your own rules say about public data. It does not decide anything for you, and the no_trades_during windows in rules.json are surfaced as reminders, not enforced — nothing here checks an economic calendar.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured