tradingview-mcp
Fetches OHLCV candle data for NSE/BSE symbols from TradingView's WebSocket, providing a single MCP tool to test intraday/live data before upgrading to the paid Kite Connect API.
README
tradingview-mcp
A minimal MCP server that fetches OHLCV candles for NSE/BSE symbols from TradingView's chart WebSocket. For testing live/intraday data before moving to the paid Kite feed. Protocol reverse-engineered in PROTOCOL.md.
What it does
- One tool:
get_ohlcv(symbol, resolution, bars)→ bars as[unix_time, open, high, low, close, volume], oldest first. symbol:NSE:RELIANCE,NSE:NIFTY,BSE:SENSEX, …resolution:15/60/D/W/1Mor aliases15m/hourly/daily/weekly.- Indicators are NOT fetched — compute EMA/ATR/RSI yourself (the swing engine already does).
- Data quality depends on login (see below). Logged in with a free account, many NSE symbols stream real-time; anonymous guest is delayed/EOD.
First-time login (recommended)
A logged-in session gives better/real-time data. Run this once — the password
is used only to obtain a token and is never stored; only the token +
sessionid land in .tv_session.json (gitignored, chmod 600). The client and MCP
pick it up automatically.
TV_USERNAME='you@example.com' TV_PASSWORD='...' python3 tv_auth.py
If TradingView ever throws a CAPTCHA/2FA (it didn't in testing), grab the
auth_token from a logged-in browser (devtools → WS → set_auth_token) and drop
it into .tv_session.json as {"auth_token":"..."}. Without any session file the
client falls back to the guest token automatically.
Files
tv_client.py— the WebSocket client (also runnable:python3 tv_client.py NSE:RELIANCE D 10)tv_auth.py— one-time login → saves the session token (.tv_session.json)server.py— the stdio MCP server (no external SDK; retries on TV rate-limits)requirements.txt—websocket-client,requests(login only)
Install / run
pip install -r requirements.txt
python3 tv_client.py NSE:RELIANCE 15 5 # quick sanity check
Connect to Claude Code
claude mcp add tradingview -- python3 /home/neh/StockWealth/tradingview-mcp/server.py
Restart the session so the tool loads, then ask for e.g. NSE:HFCL daily candles.
Honest caveats
- Unofficial + against TradingView's ToS; the protocol/tokens change without notice, so this WILL break eventually. Testing tool only.
- A logged-in free account streams real-time on many NSE symbols (verified); anonymous guest is delayed. Some symbols/exchanges still require a paid data plan regardless.
- TradingView rate-limits rapid reconnects; the server retries with backoff. Don't hammer it.
- The intended production path is the Kite Connect API (~₹500/mo) — official, stable, real-time. This MCP exists only to test the intraday-data workflow first.
Recommended Servers
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.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.