TradingView MCP
Optionally uses RapidAPI as a compatible upstream data source for market data when configured with an API key.
Provides market data, historical OHLCV, technical analysis, chart rendering, and optional Supercharts browser automation for screenshots and exports via the TradingView platform.
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., "@TradingView MCPAnalyze AAPL with RSI and MACD indicators"
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.
TradingView MCP
A local-first Model Context Protocol server and loopback REST API for market data, deterministic technical analysis, chart rendering, and optional TradingView Supercharts browser workflows.
The server runs over stdio and starts its local viewer and Playwright browsers only when a tool needs them. High-level history and analysis tools close the managed browser automatically by default.
This is an independent open-source project. It is not affiliated with, sponsored by, or endorsed by TradingView. TradingView and Lightweight Charts are trademarks of TradingView, Inc. Users are responsible for complying with TradingView's terms, account permissions, exchange entitlements, and applicable data licenses.
Features
MCP tools for market discovery, quotes, OHLCV, analysis, and chart state
One-call official TradingView screenshots for an exact symbol, interval, and date range
One-call historical-date context with OHLCV, gaps, changes, volume, exported indicator fields, rolling performance, and technical analysis
Deterministic SMA, EMA, RSI, MACD, Bollinger Bands, ATR, trend, signal, and support/resistance calculations
Local Lightweight Charts viewer with PNG capture
CSV, inline OHLCV, demo data, and optional configured upstream support
Atomic indicator, level, custom-series, price-zone, and marker overlays
Opt-in Playwright workflows for account-authorized TradingView Supercharts navigation, CSV export, indicators, and screenshots
Compact MCP results by default so large OHLCV arrays do not consume model context unnecessarily
Loopback-only HTTP binding, path containment, input validation, credential filtering, and fail-closed browser checks
Related MCP server: TradingView MCP Jackson
Architecture
MCP client -- stdio --+-- deterministic analysis and chart state
+-- on-demand local viewer / PNG capture
+-- optional on-demand TradingView browser
REST client -- loopback HTTP -- local viewer and compatible JSON endpointsThe local viewer is a deterministic rendering surface; it is not a clone of proprietary TradingView charting features. See the compatibility boundary.
Requirements
Node.js 22 or newer
npm
Chromium installed through Playwright when screenshot or browser tools are used
Install from source
git clone https://github.com/moeuu/tradingview-mcp.git
cd tradingview-mcp
npm ci
npx playwright install chromium
npm run buildFor Linux CI or a machine without Chromium system dependencies:
npx playwright install --with-deps chromiumConnect an MCP client
TradingView MCP is client-independent. It uses the standard MCP stdio transport and does not call client-specific APIs. Any MCP client that can launch a local process can use:
node /absolute/path/to/tradingview-mcp/dist/mcp.jsMany desktop and editor clients use this common configuration shape:
{
"mcpServers": {
"tradingview": {
"command": "node",
"args": ["/absolute/path/to/tradingview-mcp/dist/mcp.js"],
"env": {
"MARKET_CHART_PORT": "0",
"MARKET_CHART_DATA_ROOT": "/absolute/path/to/tradingview-mcp/data"
}
}
}
}Adapt the outer configuration keys to your client if needed; the command, arguments, environment, and MCP protocol remain the same. Restart the client after changing its configuration. MARKET_CHART_PORT=0 selects an ephemeral viewer port and avoids a permanently listening service.
See MCP client setup and compatibility for transport behavior, lifecycle, and troubleshooting.
Recommended MCP workflow
Call
market_get_capabilitieswhen provider availability is unclear.Use
tradingview_get_dayfor comprehensive information about a symbol on a specific date.Use
tradingview_capture_periodfor an official Supercharts PNG covering exact calendar dates.Use
tradingview_analyze_symbolfor one-call recent history plus deterministic analysis.Use
tradingview_get_historywhen only recent history is needed.Use
chart_import_csvorchart_set_datafor local/user-provided data.Use
chart_analyze,chart_apply_overlays, andchart_snapshotfor local analysis and visualization.
Example calls:
{
"name": "tradingview_capture_period",
"arguments": {
"symbol": "NASDAQ:AAPL",
"interval": "D",
"from": "2024-01-02",
"to": "2024-03-28"
}
}{
"name": "tradingview_get_day",
"arguments": {
"symbol": "NASDAQ:AAPL",
"date": "2024-01-03",
"interval": "D",
"timezone": "America/New_York"
}
}tradingview_get_day returns an explicit no_session_bar status for weekends, holidays, and unavailable dates rather than silently substituting a nearby session. On a matching date it returns session OHLCV, previous and next bars when loaded, prior-close and open-gap changes, intraday range, rolling 5/20/50/200-period performance, deterministic indicators and signals, and every additional indicator column present in the official TradingView chart export. Set an intraday interval and includeBars:true to receive all exported bars assigned to that date. Day aggregation accepts daily bars and intraday intervals from 9 seconds through 24 hours; shorter seconds intervals could exceed the complete-session safety limit.
High-level TradingView tools close the browser by default. Set includeBars: true only when raw bars are required in the MCP response, and keepBrowserOpen: true only for immediate follow-up browser tools.
The server exposes both high-level and granular tools. Clients that support an enabled_tools allowlist can expose only the tools needed for a given workflow.
Optional TradingView browser workflow
Browser automation is disabled by default. A cookie export is the preferred authentication source because it can contain only the required session cookies. Never paste credential values into MCP arguments, repository files, client configuration, or prompts.
chmod 600 /absolute/path/to/tradingview-cookies.txt
export TRADINGVIEW_BROWSER_ENABLED=true
export TRADINGVIEW_BROWSER_BASE_URL=https://www.tradingview.com
export TRADINGVIEW_BROWSER_COOKIE_FILE=/absolute/path/to/tradingview-cookies.txt
export TRADINGVIEW_BROWSER_AUTH_COOKIE_NAMES=sessionid,sessionid_sign,device_t
export TRADINGVIEW_BROWSER_HEADLESS=true
export TRADINGVIEW_BROWSER_TIMEOUT_MS=120000The authentication file must remain outside the repository, be smaller than 1 MiB, and have owner-only permissions on POSIX systems. The default policy imports only sessionid, sessionid_sign, and device_t from TradingView domains. Local storage is not imported by default. Cookie values, storage values, and authentication file paths are never accepted as MCP tool arguments or returned by MCP or REST responses.
A Playwright storage-state file can be used with TRADINGVIEW_BROWSER_AUTH_STATE when a cookie export is unavailable. The same cookie allowlist applies. Set TRADINGVIEW_BROWSER_AUTH_STORAGE_KEYS only when a verified workflow requires specific local-storage keys; its default is empty.
Supercharts UI availability, selectors, exports, account plans, exchange entitlements, and delayed/live status are controlled by TradingView and can change independently of this project. The automation never attempts an account upgrade or purchase.
See TradingView browser workflows for details and limitations.
Standalone REST API and viewer
The REST API is optional and does not need to run for normal MCP use.
npm run serveIt binds to 127.0.0.1:4317 by default:
curl http://127.0.0.1:4317/api/health
curl 'http://127.0.0.1:4317/api/price/DEMO:MARKET?timeframe=60&range=20'Set a bearer token before enabling a paid/configured upstream or exposing sensitive local chart data to another local process:
export MARKET_CHART_API_TOKEN='replace-with-a-long-random-value'
npm run serveHTTP binding is restricted to loopback addresses. See the REST API reference.
Configuration
Copy .env.example as a reference, but load real values from your shell, process manager, or secret store. The application does not automatically read .env files.
Variable | Default | Purpose |
|
| Loopback bind address only |
|
| REST/viewer port; use |
|
| Contained CSV, export, and capture root |
| unset | Optional REST bearer token |
|
| Enable local viewer PNG capture |
|
| Enable Supercharts browser tools |
|
| Allowed TradingView origin |
| unset | External Playwright storage-state path |
| unset | External cookie-export path |
|
| Cookie-name allowlist; values stay in the external file |
| empty | Opt-in local-storage key allowlist |
|
| Run managed Chromium headlessly |
|
| Browser operation timeout, 5-120 seconds |
| unset | Optional compatible upstream key |
| provider default | Optional compatible upstream host |
Local CSV format
CSV imports must resolve inside MARKET_CHART_DATA_ROOT, contain ascending timestamps, and stay within configured limits.
time,open,high,low,close,volume
2026-01-02T00:00:00Z,100,104,99,103,1200000
2026-01-03T00:00:00Z,103,106,101,105,1350000timestamp or date can replace time; Unix seconds and milliseconds are also accepted.
Security model
No network listener is created by an idle stdio MCP process.
Local HTTP routes bind only to loopback and validate the
Hostheader.Imported files use real-path containment and reject symlink traversal.
Browser authentication is read from one external owner-only file and filtered by domain, cookie name, expiry, size, and optional local-storage key allowlists.
MCP and REST request schemas do not accept cookies, tokens, storage state, or authentication file paths.
Browser operations serialize stateful UI work and reject credential-like tool inputs.
Generated browser artifacts, credentials,
.envfiles, traces, and local market data are ignored by Git.Results are analytical observations, not investment advice or a guarantee of future performance.
Please report vulnerabilities according to SECURITY.md.
Development
npm ci
npx playwright install chromium
npm run checknpm run check runs public-release safety checks, repository-wide English-only text validation, strict TypeScript checking, the full Vitest suite, and the production build.
Contributions are welcome; see CONTRIBUTING.md. By participating, you agree to follow CODE_OF_CONDUCT.md.
License and attribution
The project source is available under the MIT License. The bundled viewer uses TradingView Lightweight Charts under Apache-2.0; required notices are in NOTICE, THIRD_PARTY_LICENSES.md, and licenses/Apache-2.0.txt.
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
- AlicenseAqualityCmaintenanceA type-safe MCP server that enables AI agents to control TradingView Desktop via Chrome DevTools Protocol, allowing chart state reading, symbol/timeframe changes, and OHLCV data fetching.112541MIT
- FlicenseNot gradedqualityCmaintenanceAn MCP server that connects to TradingView Desktop via Chrome DevTools Protocol, enabling chart control, Pine Script development, and a morning brief workflow with AI-driven analysis.254
- FlicenseBqualityCmaintenanceA 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
- AlicenseNot gradedqualityCmaintenanceA local-first MCP server that bridges AI coding agents with MetaTrader 5 for inspection, market data, MQL5 development, compiling, Strategy Tester review, workspace sync, logs, audit trails, demo trading, and carefully gated live trading.MIT
Related MCP Connectors
TradeOS MCP: ticker search, My Agent, chart TA, macro news. npm stdio or HTTP.
Open-source MCP server for Zerodha Kite Connect. Portfolio, market data, backtesting, alerts.
MCP server exposing the Backtest360 engine API as tools for AI agents.
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/moeuu/tradingview-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server