Unofficial MCP server and CLI for TradingView's market screener API — stocks, forex, crypto & ETFs.
AI-powered investment research for patient, systematic investors.
Two modes, one package: Use as an MCP server with Claude, or as a standalone CLI tool that pipes to jq, csvtool, or any Unix workflow.
TradingView MCP Server
Table of Contents
- Demo
- Features
- Installation
- CLI Usage
- Configuration
- MCP Tools
- Screening Fields
- Pre-built Strategies
- Investor Commands
- Operators
- Development
- Disclaimer
Demo
Features
- Dual mode: MCP + CLI — use as an MCP server with Claude or as a standalone
tradingview-clicommand - 100+ screener fields including Piotroski F-Score, Altman Z-Score, Graham Number, analyst consensus, and dividend growth streaks
- 18 filter operators including
crosses_above/crosses_belowfor golden cross detection - 14 pre-built strategies covering value, growth, quality, GARP, deep value, breakouts, compounders, and macro monitoring
- Symbol discovery — search for TradingView symbols by name, ticker, or description via
search_symbols - Technical analysis — TradingView-style buy/sell/neutral summaries and multi-timeframe TA ranking via
get_ta_summaryandrank_by_ta - Market metadata — discover available screener fields per market via
get_market_metainfo - 9 investor workflow commands — from
/due-diligenceto/macro-dashboard— built on top of the MCP tools - Multi-asset coverage — stocks, ETFs, forex, and crypto with asset-specific field discovery via
list_fields - Smart caching and rate limiting — configurable TTL and requests-per-minute to keep usage responsible
Installation
Option 1: NPM (Recommended)
npm install -g tradingview-mcp-server
Option 2: Clone Repository (includes demo commands)
git clone https://github.com/fiale-plus/tradingview-mcp-server.git
cd tradingview-mcp-server
npm install
# Quick setup — creates project-level MCP config
./local-setup.sh # Linux/Mac
local-setup.bat # Windows
# Restart Claude Code and try: /market-regime or /run-screener
CLI Usage
After installing the package, the tradingview-cli command is available globally:
# List all pre-built screening strategies
tradingview-cli presets
# Screen stocks using a preset
tradingview-cli screen stocks --preset quality_stocks --limit 10
# Or load a strict versioned JSON preset file
tradingview-cli screen stocks --preset-file ./my-preset.json --limit 10
# Screen with custom filters
tradingview-cli screen stocks --filters '[{"field":"price_earnings_ttm","operator":"less","value":15}]'
# Look up specific symbols (indexes, stocks)
tradingview-cli lookup NASDAQ:AAPL TVC:SPX NYSE:MSFT
# Discover available screening fields
tradingview-cli fields --asset-type stock --category fundamental
# Search for a symbol
tradingview-cli search apple --exchange NASDAQ
# Get market metadata
tradingview-cli metainfo america --fields name,close,market_cap_basic
# Technical analysis summary
tradingview-cli ta NASDAQ:AAPL NASDAQ:NVDA
# Rank symbols by TA score
tradingview-cli rank-ta NASDAQ:AAPL NASDAQ:MSFT NASDAQ:NVDA --timeframes 60,1D --weights '{"1D":3}'
Output Formats
# JSON (default) — pipe to jq
tradingview-cli screen stocks --preset value_stocks | jq '.stocks[].name'
# CSV — pipe to file or csvtool
tradingview-cli screen stocks --preset value_stocks -f csv > results.csv
# Table — human-readable terminal output
tradingview-cli screen stocks --preset value_stocks -f table
CLI Commands
Screen Options
Configuration
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json on Mac:
{
"mcpServers": {
"tradingview": {
"command": "npx",
"args": ["-y", "tradingview-mcp-server"]
}
}
}
Claude Code
Create .mcp.json in your project root:
{
"mcpServers": {
"tradingview": {
"command": "npx",
"args": ["-y", "tradingview-mcp-server"]
}
}
}
Enable in .claude/settings.local.json:
{
"enableAllProjectMcpServers": true
}
Environment Variables
Invalid values fail before the MCP server starts. These limits protect TradingView's public endpoints; they do not provide a TradingView quota or guarantee availability.
Upstream limitations
This package is an unofficial client of TradingView's public scanner and symbol-search endpoints. The endpoints are unauthenticated, can change or reject traffic without notice, and may return delayed or incomplete market data. The server does not provide historical data, brokerage execution, alerts, or a TradingView data entitlement.
MCP Tools
The MCP server exposes twelve tools to any compatible MCP client. The Claude Code commands listed later are repository-local workflows built on top of these tools; they are not additional MCP tools.
Filter Structure
All screening tools accept filters in this shape:
{ "field": "return_on_equity", "operator": "greater", "value": 15 }
{ "field": "RSI", "operator": "in_range", "value": [40, 65] }
{ "field": "SMA50", "operator": "crosses_above", "value": "SMA200" }
{ "field": "exchange", "operator": "in_range", "value": ["NASDAQ", "NYSE"] }
Cross-field comparison (second example above) enables golden cross / death cross detection without needing a value on the right-hand side.
Symbol Discovery
Use search_symbols to find exact TradingView identifiers before screening:
// Search for Apple
{ "query": "apple" }
// Narrow by exchange and type
{ "query": "bitcoin", "exchange": "BINANCE", "asset_type": "crypto" }
Returns normalized symbols with exchange, type, and currency.
Market Metainfo
Use get_market_metainfo to discover available fields for a market:
// All fields for US stocks
{ "market": "america" }
// Specific fields only
{ "market": "america", "fields": ["name", "close", "market_cap_basic"] }
// Raw passthrough for debugging
{ "market": "america", "mode": "raw" }
Technical Analysis Summary
Use get_ta_summary for TradingView-style buy/sell/neutral labels:
// Single symbol, default timeframes (60m, 4H, 1D, 1W)
{ "symbols": ["NASDAQ:AAPL"] }
// Multiple symbols with custom timeframes
{ "symbols": ["NASDAQ:AAPL", "NASDAQ:NVDA"], "timeframes": ["60", "240", "1D", "1W"] }
Returns labels (strong_buy, buy, neutral, sell, strong_sell) plus raw scores based on oscillators and moving averages.
TA Ranking
Use rank_by_ta to compare symbols by weighted technical alignment:
// Equal-weight ranking
{ "symbols": ["NASDAQ:AAPL", "NASDAQ:MSFT", "NASDAQ:NVDA"] }
// Weight daily timeframe 3x more
{ "symbols": ["NASDAQ:AAPL", "NASDAQ:MSFT"], "weights": { "1D": 3, "1W": 2 } }
Returns ranked list with per-timeframe breakdown, weighted average score, and structured metadata. See Response metadata and partial results below.
Response metadata and partial results
Screening, lookup, search, market metainfo, and TA/ranking responses include a metadata object:
{
"retrieved_at": "2026-08-16T00:00:00.000Z",
"source": "https://scanner.tradingview.com/global/scan",
"cache_hit": false,
"requested_count": 20,
"returned_count": 18,
"missing_symbols": []
}
retrieved_atis the source-data retrieval time; cache hits preserve it so callers can assess data age.sourceidentifies the public endpoint used.cache_hitdistinguishes an in-memory response from a new upstream request.requested_countandreturned_countdescribe the requested items or limit and rows returned; consultunavailable_symbolsandexcluded_symbolsfor usable TA coverage.missing_symbolslists requested symbols absent from an upstream response. TA responses may also includeunavailable_symbolswhen symbols exist but have no usable score.rank_by_taadditionally returnsexcluded_symbolswithmissing_symbolorunavailable_tareasons. Missing data is never converted into a neutral score.
list_fields, get_preset, and list_presets return their documented collections without this metadata wrapper. Raw metainfo mode preserves the upstream payload under raw rather than normalizing it.
Screening Fields
Use list_fields to browse fields. Pass asset_type to get tailored lists for each asset class.
Stocks (104 fields in the built-in stock catalog)
Valuation
price_earnings_ttm, price_book_fq, price_sales_current, enterprise_value_current, enterprise_value_ebitda_ttm, enterprise_value_to_ebit_ttm, price_earnings_growth_ttm (PEG), ebitda
Profitability & Returns
return_on_equity, return_on_assets, return_on_invested_capital_fq, gross_margin_ttm, operating_margin_ttm, net_margin_ttm, after_tax_margin, pre_tax_margin_ttm, free_cash_flow_margin_ttm
Growth
total_revenue_yoy_growth_ttm, earnings_per_share_diluted_yoy_growth_ttm, revenue_per_share_ttm, total_revenue, net_income, earnings_per_share_diluted_ttm
Balance Sheet
debt_to_equity, total_debt, total_assets, current_ratio, free_cash_flow_ttm, free_cash_flow_fq
Dividends
dividend_yield_recent, dividends_yield_current, dividend_payout_ratio_ttm, continuous_dividend_payout_years, dps_yoy_growth_ttm
Composite Scores (unique differentiators)
Analyst Data
Recommend.All (composite −1 to +1), analyst_recommendations_buy, analyst_recommendations_sell, analyst_recommendations_neutral, price_target_average, price_target_high, price_target_low
Technical
RSI, SMA50, SMA200, EMA10, VWAP, ATR, ADX, Volatility.M, beta_1_year, beta_3_year, beta_5_year, Recommend.MA, Recommend.Other
Performance & Price Levels
close, change, volume, average_volume_90d_calc, average_volume_30d_calc, relative_volume_10d_calc, Perf.5D, Perf.W, Perf.1M, Perf.3M, Perf.6M, Perf.Y, Perf.YTD, Perf.3Y, Perf.5Y, Perf.10Y, Perf.All, price_52_week_high, price_52_week_low, all_time_high, all_time_low, High.All
Metadata
sector, industry, exchange, market, is_primary, indexes, fundamental_currency_code, earnings_release_next_trading_date_fq
ETFs
expense_ratio, shares_outstanding, dividends_yield_current, close, volume, Perf.W through Perf.Y, RSI, ATR
Crypto
close, change, volume, market_cap_basic, RSI, ATR, Volatility.M, Perf.W through Perf.Y
Forex
close, change, volume, RSI, ATR, ADX, Volatility.D, SMA50, SMA200, Perf.W through Perf.3M
Pre-built Strategies
Retrieve any preset with get_preset or browse all with list_presets.
Versioned preset files
The CLI also accepts a strict, portable JSON preset:
tradingview-cli screen stocks --preset-file ./presets/quality.json --limit 20
The file must use schemaVersion: 1, include non-empty name and description, and define exactly one of filters or symbols. Optional keys are markets, sort_by, sort_order, limit (1–200), and columns; unknown keys, invalid operators, and invalid value shapes are rejected. --preset and --preset-file cannot be combined. Files are limited to 1 MiB. The CLI prints the file basename and SHA-256 to stderr after a successful load.
{
"schemaVersion": 1,
"name": "Quality with a tighter range",
"description": "A reproducible quality screen",
"filters": [
{ "field": "return_on_equity", "operator": "greater", "value": 15 }
],
"markets": ["america"],
"sort_by": "market_cap_basic",
"sort_order": "desc",
"limit": 20,
"columns": ["name", "close", "return_on_equity"]
}
Investor Commands
The repository ships with 9 ready-to-use Claude Code commands in .claude/commands/. Clone the repo and run ./local-setup.sh to activate them.
Operators
All screening tools support the following operators in filter conditions:
String fields (sector, exchange, industry, market) use equal for single values and in_range for lists.
Development
npm install # Install dependencies
npm run build # Compile TypeScript to dist/
npm test # Run all tests
npm run test:watch # Run tests in watch mode
npm run dev # Run directly with tsx (no build step)
Run a single test file:
npm test -- fields.test.ts
After making changes, restart Claude to reload the MCP server (no hot-reload).
Adding a New Field
- Add to
STOCK_FIELDSinsrc/tools/fields.tswithname,label,category,type,description - Optionally add to
EXTENDED_COLUMNSinsrc/tools/screen.ts
Adding a New Preset
Add to PRESETS in src/resources/presets.ts with filters, markets, sort_by, sort_order, and optional columns.
Adding a New Tool
- Create implementation in
src/tools/ - Register in
ListToolsRequestSchemahandler insrc/index.ts - Add case in
CallToolRequestSchemahandler
Disclaimer
This is an unofficial tool. It is not affiliated with, endorsed by, or connected to TradingView. It uses TradingView's public scanner API, which may change without notice. No authentication is required; access level is the same as the TradingView website without login.
Not investment advice. Screening results are for informational and educational purposes only. All investment decisions are your sole responsibility. Past performance does not indicate future results. Consult qualified financial advisors before making investment decisions.
This software is provided "AS IS" under the MIT License, without warranty of any kind.
Links
Smarter screens, not faster trades.
Built with the Model Context Protocol