tv-history
This server provides historical market data analysis, raw OHLCV bars, and candlestick charts for financial assets, powered by tvDatafeed with local CSV caching and automatic refresh.
Asset Analysis (
asset_analysis): Returns a comprehensive market analysis for a given asset and timeframe at a specified timestamp (defaults to UTC now). Includes OHLCV data, ATR, market structure, trend state, actionable levels, bar signals, weekly context, weekly VWAP, and session data. Optionally include raw technical indicators (RSI, MACD, SMA200, EMA9/20/50, Bollinger Bands, ADX, momentum change).Raw Bar Data (
asset_bars): Fetches historical OHLCV bars (oldest-first) with bar completion status. Control output withcount(1-1000) orsessions(number of trading dates).Candlestick Charts (
asset_chart): Generates a PNG candlestick chart with volume and metadata. Chart range can be set by calendardays(1-365) or tradingsessions.
Key features:
Accepts assets in
EXCHANGE:SYMBOL(preferred) orSYMBOL:EXCHANGEformat.Supports
1h,4h,1D,1Wtimeframes.All tools accept an optional ISO-8601
timestampfor historical analysis.Data is cached locally in timeframe-specific CSV files after downloading from tvDatafeed, with automatic refresh for new data.
Structured error handling for all tools.
Provides access to historical trading data from TradingView, enabling asset analysis, OHLCV bar retrieval, and candlestick chart generation.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@tv-historyFetch the 1h OHLCV bars for BITSTAMP:BTCUSD"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
tv-history MCP
Standalone historical asset-analysis MCP server backed by tvDatafeed and local timeframe-specific CSV files.
Assets are loaded dynamically. TradingView-style EXCHANGE:SYMBOL is preferred,
for example RUS:MX1!. The existing SYMBOL:EXCHANGE format remains accepted
for backward compatibility. A valid request triggers an initial tvDatafeed
download when no local history exists for that asset and timeframe.
Install and run
cd C:\_tools\202607_tradingview_mcp\tv_history
uv sync
uv run tv-history-mcpHTTP transport:
uv run tv-history-mcp streamable-http --host 127.0.0.1 --port 8010
#or for Tailscale IP
uv run tv-history-mcp streamable-http --host 0.0.0.0 --port 8010 The MCP endpoint is http://127.0.0.1:8010/mcp.
Codex registration for the HTTP server:
codex mcp add tv-history --url http://127.0.0.1:8010/mcpOr let Codex launch the stdio server:
codex mcp add tv-history -- C:\_tools\202607_tradingview_mcp\tv_history\.venv\Scripts\python.exe -m tv_history.serverRelated MCP server: 0xarchive-mcp
Tool
asset_analysis(
asset="BITSTAMP:BTCUSD",
timeframe="1h",
timestamp="2026-07-01T12:00:00Z"
)When timestamp is omitted, price_data may contain the latest received
non-final bar. Its is_bar_complete status uses the configured exchange delay;
all derived analysis continues to use finalized bars only.
The compact execution response is the only response format and is returned by
default. The response_version parameter may be omitted. Use
include_indicators=true when raw indicators are needed.
asset_analysis(
asset="BITSTAMP:BTCUSD",
timeframe="4h",
timestamp="2026-07-01T12:00:00Z",
include_indicators=true
)asset_bars(
asset="ICEEUR:BRN1!",
timeframe="1h",
timestamp="2026-03-23T00:00:00Z",
sessions=4
)asset_bars returns OHLCV bars oldest-first. It includes an opened latest bar by
default and marks each bar with is_bar_complete. Use count (1–1000) or sessions;
when both are supplied, sessions wins.
asset_chart(
asset="BITSTAMP:BTCUSD",
timeframe="4h",
timestamp="2026-07-01T12:00:00Z",
days="10"
)asset_chart returns a PNG candlestick chart with red/green bodies, wicks, and
volume, plus a compact metadata block describing the asset and chart range.
Use sessions instead of days to request a fixed number of trading dates;
sessions wins when both are supplied. All tool errors use the same structured
error object and are marked as MCP errors.
Supported timeframes are 1h, 4h, 1D, and 1W. Each timeframe is fetched
directly from tvDatafeed and stored independently as 1h.csv, 4h.csv,
1D.csv, or 1W.csv. Analysis and charts read the requested timeframe file;
they do not construct higher-timeframe bars from 1h.csv.
An empty timeframe store requests up to 5,000 bars. A subsequent request refreshes only when its timestamp is later than the latest stored timestamp for that timeframe. The refresh size is the estimated number of missing bars plus 10 overlapping bars, capped at 5,000. New and old rows are merged by timestamp, with fresh provider values winning.
Provider failures are retried five times with a five-second wait between attempts. Attempts 1–3 use the original request capped at 5,000 bars, attempt 4 caps it at 4,000, and attempt 5 caps it at 2,000.
Every triggered provider download is appended to data/download_control.csv.
The control rows contain asset, timeframe, requested_at, bars_requested,
status (success or failure), and the UTC input_timestamp. Existing rows
from the older schema are preserved with a blank timeframe because it cannot be
inferred reliably. Requests already covered by local data do not trigger a
download and are not logged.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that streams K-line (candlestick) data from decentralized exchanges (DEXs) to power your AI agents and workflows.14MIT
- AlicenseAqualityFmaintenanceMCP server for querying historical and real-time crypto market data across Hyperliquid, Hyperliquid HIP-3, and Lighter.xyz - orderbooks, trades, candles, funding, open interest, liquidations, and data quality metrics.10068910MIT
- Flicense-qualityDmaintenancePython-based MCP server that provides real-time and historical cryptocurrency data from 100+ exchanges via CCXT, with tools for tickers, OHLCV, markets, and order books.1
- FlicenseAqualityCmaintenanceAn MCP server providing Model-usable tools to fetch real-time quotes, historical price charts, fundamental datasets, SEC filings, economic/earnings calendars, option chains, and corporate bond data from TradingView.21
Related MCP Connectors
MCP server exposing the Backtest360 engine API as tools for AI agents.
Twelve Data MCP: real-time & historical market data (stocks, crypto, forex, etc).
Open-source MCP server for Zerodha Kite Connect. Portfolio, market data, backtesting, alerts.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/yar822/tv_history_mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server