[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-74359":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":19,"compositeScore":20,"rankGlobal":9,"rankLanguage":9,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":22,"topics":25,"createdAt":9,"pushedAt":9,"updatedAt":26,"readmeContent":27,"aiSummary":28,"trendingCount":15,"starSnapshotCount":15,"syncStatus":29,"lastSyncTime":30,"discoverSource":31},74359,"tradingview-mcp","tradesdontlie\u002Ftradingview-mcp","tradesdontlie","AI-assisted TradingView chart analysis — connect Claude Code to your TradingView Desktop for personal workflow automation",null,"JavaScript",3532,1741,65,52,0,110,230,760,330,31.72,"Other",false,"main",true,[],"2026-06-12 02:03:25","# TradingView MCP Bridge\n\nPersonal AI assistant for your TradingView Desktop charts. Connects Claude Code to your locally running TradingView app via Chrome DevTools Protocol for AI-assisted chart analysis, Pine Script development, and workflow automation.\n\n> [!WARNING]\n> **This tool is not affiliated with, endorsed by, or associated with TradingView Inc.** It interacts with your locally running TradingView Desktop application via Chrome DevTools Protocol. Review the [Disclaimer](#disclaimer) before use.\n\n> [!IMPORTANT]\n> **Requires a valid TradingView subscription.** This tool does not bypass or circumvent any TradingView paywall or access control. It reads from and controls the TradingView Desktop app already running on your machine.\n\n> [!NOTE]\n> **All data processing occurs locally on your machine.** No TradingView data is transmitted, stored, or redistributed externally by this tool.\n\n> [!CAUTION]\n> This tool accesses undocumented internal TradingView APIs via the Electron debug interface. These can change or break without notice in any TradingView update. Pin your TradingView Desktop version if stability matters to you.\n\n## How It Works (and why it's safe to run)\n\nThis tool does not connect to TradingView's servers, modify any TradingView files, or intercept any network traffic. It communicates exclusively with your locally running TradingView Desktop instance via Chrome DevTools Protocol (CDP) — a standard debugging interface built into all Chromium\u002FElectron applications by Google, including VS Code, Slack, and Discord.\n\nThe debug port is disabled by default and must be explicitly enabled by you using a standard Chromium flag (`--remote-debugging-port=9222`). Nothing happens without that deliberate step.\n\n## What This Tool Does Not Do\n\n- Connect to TradingView's servers or APIs\n- Store, transmit, or redistribute any market data\n- Work without a valid TradingView subscription and installed Desktop app\n- Bypass any TradingView paywall or access restriction\n- Execute real trades (chart interaction only)\n- Work if TradingView changes their internal Electron structure\n\n## Research Context\n\nThis project explores an open research question: **how can LLM-based agents interact with professional trading interfaces to support human decision-making?**\n\nSpecifically it investigates:\n\n- How structured tool APIs (MCP) can bridge LLMs and stateful desktop financial applications\n- What latency, context, and reliability constraints emerge when an agent operates on live chart data\n- How agents handle ambiguous financial UI state (e.g. interpreting Pine Script output, reading indicator tables)\n- Whether natural language is an effective interface for chart navigation and Pine Script development\n- The failure modes of LLM agents operating in real-time data environments\n\nThis is not a trading bot. It is an interface layer that makes a trading application legible to an LLM agent, allowing researchers and developers to study human-AI collaboration in financial workflows.\n\nSee [RESEARCH.md](RESEARCH.md) for open questions, findings, and related work.\n\n## Prerequisites\n\n- **TradingView Desktop app** (paid subscription required for real-time data)\n- **Node.js 18+**\n- **Claude Code** with MCP support (for MCP tools) or any terminal (for CLI)\n- **macOS, Windows, or Linux**\n\n## What It Does\n\nGives your AI assistant eyes and hands on your own chart:\n\n- **Pine Script development** — write, inject, compile, debug, and iterate on scripts with AI assistance\n- **Chart navigation** — change symbols, timeframes, zoom to dates, add\u002Fremove indicators\n- **Visual analysis** — read your chart's indicator values, price levels, and annotations\n- **Draw on charts** — trend lines, horizontal lines, rectangles, text annotations\n- **Manage alerts** — create, list, and delete price alerts\n- **Replay practice** — step through historical bars, practice entries\u002Fexits\n- **Screenshots** — capture chart state for AI visual analysis\n- **Multi-pane layouts** — set up 2x2, 3x1, etc. grids with different symbols per pane\n- **Monitor your chart** — stream JSONL from your locally running chart for local monitoring scripts\n- **CLI access** — every MCP tool is also a `tv` CLI command, pipe-friendly with JSON output\n- **Launch TradingView** — auto-detect and launch with debug mode from any platform\n\n## Install with Claude Code\n\nPaste this into Claude Code and it will handle the rest:\n\n> Install the TradingView MCP server. Clone https:\u002F\u002Fgithub.com\u002Ftradesdontlie\u002Ftradingview-mcp.git, run npm install, add it to my MCP config at ~\u002F.claude\u002F.mcp.json, and launch TradingView with the debug port. Then verify the connection with tv_health_check.\n\nOr follow the manual steps below.\n\n## Quick Start\n\n### 1. Install\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Ftradesdontlie\u002Ftradingview-mcp.git\ncd tradingview-mcp\nnpm install\n```\n\n### 2. Launch TradingView with CDP\n\nTradingView Desktop must be running with Chrome DevTools Protocol enabled on port 9222.\n\n**Mac:**\n```bash\n.\u002Fscripts\u002Flaunch_tv_debug_mac.sh\n```\n\n**Windows:**\n```bash\nscripts\\launch_tv_debug.bat\n```\n\n**Linux:**\n```bash\n.\u002Fscripts\u002Flaunch_tv_debug_linux.sh\n```\n\n**Or launch manually on any platform:**\n```bash\n\u002Fpath\u002Fto\u002FTradingView --remote-debugging-port=9222\n```\n\n**Or use the MCP tool** (auto-detects your install):\n> \"Use tv_launch to start TradingView in debug mode\"\n\n### 3. Add to Claude Code\n\nAdd to your Claude Code MCP config (`~\u002F.claude\u002F.mcp.json` or project `.mcp.json`):\n\n```json\n{\n  \"mcpServers\": {\n    \"tradingview\": {\n      \"command\": \"node\",\n      \"args\": [\"\u002Fpath\u002Fto\u002Ftradingview-mcp\u002Fsrc\u002Fserver.js\"]\n    }\n  }\n}\n```\n\nReplace `\u002Fpath\u002Fto\u002Ftradingview-mcp` with your actual path.\n\n### 4. Verify\n\nAsk Claude: *\"Use tv_health_check to verify TradingView is connected\"*\n\n## CLI\n\nEvery MCP tool is also accessible as a `tv` CLI command. All output is JSON for piping with `jq`.\n\n```bash\n# Install globally (optional)\nnpm link\n\n# Or run directly\nnode src\u002Fcli\u002Findex.js \u003Ccommand>\n```\n\n### Quick Examples\n\n```bash\ntv status                          # check connection\ntv quote                           # current price\ntv symbol AAPL                     # change symbol\ntv ohlcv --summary                 # price summary\ntv screenshot -r chart             # capture chart\ntv pine compile                    # compile Pine Script\ntv pane layout 2x2                 # 4-chart grid\ntv pane symbol 1 ES1!              # set pane symbol\ntv stream quote | jq '.close'      # monitor price changes\n```\n\n### All Commands\n\n```\ntv status \u002F launch \u002F state \u002F symbol \u002F timeframe \u002F type \u002F info \u002F search\ntv quote \u002F ohlcv \u002F values\ntv data lines\u002Flabels\u002Ftables\u002Fboxes\u002Fstrategy\u002Ftrades\u002Fequity\u002Fdepth\u002Findicator\ntv pine get\u002Fset\u002Fcompile\u002Fanalyze\u002Fcheck\u002Fsave\u002Fnew\u002Fopen\u002Flist\u002Ferrors\u002Fconsole\ntv draw shape\u002Flist\u002Fget\u002Fremove\u002Fclear\ntv alert list\u002Fcreate\u002Fdelete\ntv watchlist get\u002Fadd\ntv indicator add\u002Fremove\u002Ftoggle\u002Fset\u002Fget\ntv layout list\u002Fswitch\ntv pane list\u002Flayout\u002Ffocus\u002Fsymbol\ntv tab list\u002Fnew\u002Fclose\u002Fswitch\ntv replay start\u002Fstep\u002Fstop\u002Fstatus\u002Fautoplay\u002Ftrade\ntv stream quote\u002Fbars\u002Fvalues\u002Flines\u002Flabels\u002Ftables\u002Fall\ntv ui click\u002Fkeyboard\u002Fhover\u002Fscroll\u002Ffind\u002Feval\u002Ftype\u002Fpanel\u002Ffullscreen\u002Fmouse\ntv screenshot \u002F discover \u002F ui-state \u002F range \u002F scroll\n```\n\n## Streaming\n\nThe `tv stream` commands poll your locally running TradingView Desktop instance at regular intervals via Chrome DevTools Protocol on localhost.\n\nNo connection is made to TradingView's servers. All data stays on your machine.\n\n> [!WARNING]\n> Programmatic consumption of TradingView data may conflict with their Terms of Use regardless of the data source. You are solely responsible for ensuring your usage complies.\n\n```bash\ntv stream quote                          # price tick monitoring\ntv stream bars                           # bar-by-bar updates\ntv stream values                         # indicator value monitoring\ntv stream lines --filter \"NY Levels\"     # price level monitoring\ntv stream tables --filter Profiler       # table data monitoring\ntv stream all                            # all panes at once (multi-symbol)\n```\n\n## How Claude Knows Which Tool to Use\n\nClaude reads [`CLAUDE.md`](CLAUDE.md) automatically when working in this project. It contains a complete decision tree:\n\n| You say... | Claude uses... |\n|------------|---------------|\n| \"What's on my chart?\" | `chart_get_state` → `data_get_study_values` → `quote_get` |\n| \"What levels are showing?\" | `data_get_pine_lines` → `data_get_pine_labels` |\n| \"Read the session table\" | `data_get_pine_tables` with `study_filter` |\n| \"Give me a full analysis\" | `quote_get` → `data_get_study_values` → `data_get_pine_lines` → `data_get_pine_labels` → `data_get_pine_tables` → `data_get_ohlcv` (summary) → `capture_screenshot` |\n| \"Switch to AAPL daily\" | `chart_set_symbol` → `chart_set_timeframe` |\n| \"Write a Pine Script for...\" | `pine_set_source` → `pine_smart_compile` → `pine_get_errors` |\n| \"Start replay at March 1st\" | `replay_start` → `replay_step` → `replay_trade` |\n| \"Set up a 4-chart grid\" | `pane_set_layout` → `pane_set_symbol` for each pane |\n| \"Draw a level at 24500\" | `draw_shape` (horizontal_line) |\n| \"Take a screenshot\" | `capture_screenshot` |\n\n## Tool Reference (78 MCP tools)\n\n### Chart Reading\n\n| Tool | When to use | Output size |\n|------|------------|-------------|\n| `chart_get_state` | First call — get symbol, timeframe, all indicator names + IDs | ~500B |\n| `data_get_study_values` | Read current RSI, MACD, BB, EMA values from all indicators | ~500B |\n| `quote_get` | Get latest price, OHLC, volume | ~200B |\n| `data_get_ohlcv` | Get price bars. **Use `summary: true`** for compact stats | 500B (summary) \u002F 8KB (100 bars) |\n\n### Custom Indicator Data (Pine Drawings)\n\nRead `line.new()`, `label.new()`, `table.new()`, `box.new()` output from any visible Pine indicator.\n\n| Tool | When to use | Output size |\n|------|------------|-------------|\n| `data_get_pine_lines` | Read horizontal price levels (support\u002Fresistance, session levels) | ~1-3KB |\n| `data_get_pine_labels` | Read text annotations + prices (\"PDH 24550\", \"Bias Long\") | ~2-5KB |\n| `data_get_pine_tables` | Read data tables (session stats, analytics dashboards) | ~1-4KB |\n| `data_get_pine_boxes` | Read price zones \u002F ranges as {high, low} pairs | ~1-2KB |\n\n**Always use `study_filter`** to target a specific indicator: `study_filter: \"Profiler\"`.\n\n### Chart Control\n\n| Tool | What it does |\n|------|-------------|\n| `chart_set_symbol` | Change ticker (BTCUSD, AAPL, ES1!, NYMEX:CL1!) |\n| `chart_set_timeframe` | Change resolution (1, 5, 15, 60, D, W, M) |\n| `chart_set_type` | Change style (Candles, HeikinAshi, Line, Area, Renko) |\n| `chart_manage_indicator` | Add\u002Fremove indicators. **Use full names**: \"Relative Strength Index\" not \"RSI\" |\n| `chart_scroll_to_date` | Jump to a date (ISO: \"2025-01-15\") |\n| `chart_set_visible_range` | Zoom to exact range (unix timestamps) |\n| `symbol_info` \u002F `symbol_search` | Symbol metadata and search |\n| `indicator_set_inputs` \u002F `indicator_toggle_visibility` | Change indicator settings, show\u002Fhide |\n\n### Multi-Pane Layouts\n\n| Tool | What it does |\n|------|-------------|\n| `pane_list` | List all panes with symbols and active state |\n| `pane_set_layout` | Change grid: `s`, `2h`, `2v`, `2x2`, `4`, `6`, `8` |\n| `pane_focus` | Focus a specific pane by index |\n| `pane_set_symbol` | Set symbol on any pane |\n\n### Tab Management\n\n| Tool | What it does |\n|------|-------------|\n| `tab_list` | List open chart tabs |\n| `tab_new` \u002F `tab_close` | Open\u002Fclose tabs |\n| `tab_switch` | Switch to a tab by index |\n\n### Pine Script Development\n\n| Tool | Step |\n|------|------|\n| `pine_set_source` | 1. Inject code into editor |\n| `pine_smart_compile` | 2. Compile with auto-detection + error check |\n| `pine_get_errors` | 3. Read compilation errors if any |\n| `pine_get_console` | 4. Read log.info() output |\n| `pine_save` | 5. Save to TradingView cloud |\n| `pine_get_source` | Read current script (**warning: can be 200KB+ for complex scripts**) |\n| `pine_new` | Create blank indicator\u002Fstrategy\u002Flibrary |\n| `pine_open` \u002F `pine_list_scripts` | Open or list saved scripts |\n| `pine_analyze` | Offline static analysis (no chart needed) |\n| `pine_check` | Server-side compile check (no chart needed) |\n\n### Replay Mode\n\n| Tool | Step |\n|------|------|\n| `replay_start` | Enter replay at a date |\n| `replay_step` | Advance one bar |\n| `replay_autoplay` | Auto-advance (set speed in ms) |\n| `replay_trade` | Buy\u002Fsell\u002Fclose positions |\n| `replay_status` | Check position, P&L, date |\n| `replay_stop` | Return to realtime |\n\n### Drawing, Alerts, UI Automation\n\n| Tool | What it does |\n|------|-------------|\n| `draw_shape` | Draw horizontal_line, trend_line, rectangle, text |\n| `draw_list` \u002F `draw_remove_one` \u002F `draw_clear` | Manage drawings |\n| `alert_create` \u002F `alert_list` \u002F `alert_delete` | Manage price alerts |\n| `capture_screenshot` | Screenshot (regions: full, chart, strategy_tester) |\n| `batch_run` | Run action across multiple symbols\u002Ftimeframes |\n| `watchlist_get` \u002F `watchlist_add` | Read\u002Fmodify watchlist |\n| `layout_list` \u002F `layout_switch` | Manage saved layouts |\n| `ui_open_panel` \u002F `ui_click` \u002F `ui_evaluate` | UI automation |\n| `tv_launch` \u002F `tv_health_check` \u002F `tv_discover` | Connection management |\n\n## Context Management\n\nTools return compact output by default to minimize context usage. For a typical \"analyze my chart\" workflow, total context is ~5-10KB instead of ~80KB.\n\n| Feature | How it saves context |\n|---------|---------------------|\n| Pine lines | Returns deduplicated price levels only, not every line object |\n| Pine labels | Capped at 50 per study, text+price only |\n| Pine tables | Pre-formatted row strings, no cell metadata |\n| Pine boxes | Deduplicated {high, low} zones only |\n| OHLCV summary mode | Stats + last 5 bars instead of all bars |\n| Indicator inputs | Encrypted\u002Fencoded blobs auto-filtered |\n| `verbose: true` | Pass on any pine tool to get raw data with IDs\u002Fcolors when needed |\n| `study_filter` | Target one indicator instead of scanning all |\n\n## Finding TradingView on Your System\n\nLaunch scripts and `tv_launch` auto-detect TradingView. If auto-detection fails:\n\n| Platform | Common Locations |\n|----------|-----------------|\n| **Mac** | `\u002FApplications\u002FTradingView.app\u002FContents\u002FMacOS\u002FTradingView` |\n| **Windows** | `%LOCALAPPDATA%\\TradingView\\TradingView.exe`, `%PROGRAMFILES%\\WindowsApps\\TradingView*\\TradingView.exe` |\n| **Linux** | `\u002Fopt\u002FTradingView\u002Ftradingview`, `~\u002F.local\u002Fshare\u002FTradingView\u002FTradingView`, `\u002Fsnap\u002Ftradingview\u002Fcurrent\u002Ftradingview` |\n\nThe key flag: `--remote-debugging-port=9222`\n\n## Testing\n\n```bash\n# Requires TradingView running with --remote-debugging-port=9222\nnpm test\n```\n\n29 tests covering: Pine Script static analysis, server-side compilation, and CLI routing.\n\n## Architecture\n\n```\nClaude Code  ←→  MCP Server (stdio)  ←→  CDP (port 9222)  ←→  TradingView Desktop (Electron)\n```\n\n- **Transport**: MCP over stdio (78 tools) + CLI (`tv` command, 30 commands with 66 subcommands)\n- **Connection**: Chrome DevTools Protocol on localhost:9222\n- **Streaming**: Poll-and-diff loop with deduplication, JSONL output to stdout\n- **No dependencies** beyond `@modelcontextprotocol\u002Fsdk` and `chrome-remote-interface`\n\n## Attributions\n\nThis project is not affiliated with, endorsed by, or associated with:\n- **TradingView Inc.** — TradingView is a trademark of TradingView Inc.\n- **Anthropic** — Claude and Claude Code are trademarks of Anthropic, PBC.\n\nThis tool is an independent MCP server that connects to Claude Code via the standard MCP protocol. It does not contain or modify any Anthropic software.\n\n## Disclaimer\n\nThis project is provided **for personal, educational, and research purposes only**.\n\n**How this tool works:** This tool uses the Chrome DevTools Protocol (CDP), a standard debugging interface built into all Chromium-based applications by Google. It does not reverse engineer any proprietary TradingView protocol, connect to TradingView's servers, or bypass any access controls. The debug port must be explicitly enabled by the user via a standard Chromium command-line flag (`--remote-debugging-port=9222`).\n\nBy using this software, you acknowledge and agree that:\n\n1. **You are solely responsible** for ensuring your use of this tool complies with [TradingView's Terms of Use](https:\u002F\u002Fwww.tradingview.com\u002Fpolicies\u002F) and all applicable laws.\n2. TradingView's Terms of Use **restrict automated data collection, scraping, and non-display usage** of their platform and data. This tool uses Chrome DevTools Protocol to programmatically interact with the TradingView Desktop app, which may conflict with those terms.\n3. **You assume all risk** associated with using this tool. The authors are not responsible for any account bans, suspensions, legal actions, or other consequences resulting from its use.\n4. This tool **must not be used** for, including but not limited to:\n   - Redistributing, reselling, or commercially exploiting TradingView's market data\n   - Circumventing TradingView's access controls or subscription restrictions\n   - Performing automated trading or algorithmic decision-making using extracted data\n   - Violating the intellectual property rights of Pine Script indicator authors\n   - Connecting to TradingView's servers or infrastructure (all access is via the locally running Desktop app)\n5. The streaming functionality monitors your locally running TradingView Desktop instance only. It does not connect to TradingView's servers or extract data from TradingView's infrastructure.\n6. Market data accessed through this tool remains subject to exchange and data provider licensing terms. **Do not redistribute, store, or commercially exploit any data obtained through this tool.**\n7. This tool accesses internal, undocumented TradingView application interfaces that may change or break at any time without notice.\n\n**Use at your own risk.** If you are unsure whether your intended use complies with TradingView's terms, do not use this tool.\n\n## License\n\nMIT — see [LICENSE](LICENSE) for details.\n\nThe MIT license applies to the source code of this project only. It does not grant any rights to TradingView's software, data, trademarks, or intellectual property.\n","TradingView MCP Bridge 是一个连接本地运行的 TradingView 桌面应用与 Claude Code 的个人AI助手，用于图表分析、Pine Script开发和工作流自动化。该项目通过Chrome DevTools Protocol与TradingView桌面版进行交互，实现了AI辅助的图表解读功能，并且所有数据处理都在本地完成，确保了用户数据的安全性和隐私性。适用于需要提升交易分析效率，尤其是对Pine Script编写有需求或希望利用AI优化其TradingView使用体验的专业人士及研究者。需要注意的是，该工具要求用户拥有有效的TradingView订阅服务，并且不提供绕过任何付费墙的功能。",2,"2026-06-11 03:49:59","high_star"]