MCPInstall

tradingview-mcp-assistant

AI-assisted TradingView chart analysis and automation via Chrome DevTools Protocol for Claude Code

Installs
262
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/reason-machines/mcp-skills --skill tradingview-mcp-assistant
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads tradingview-mcp-assistant automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

TradingView MCP Assistant

Skill by ara.so — MCP Skills collection.

Personal AI assistant for 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.

Important: This tool requires a valid TradingView subscription and the Desktop app. It communicates only with your local TradingView instance via CDP (Chrome DevTools Protocol) — no external connections, no data transmission.

What This Skill Enables

  • Pine Script development — write, compile, debug, and iterate on indicators/strategies
  • Chart navigation — change symbols, timeframes, zoom to dates, manage layouts
  • Visual analysis — read indicator values, price levels, and Pine Script drawings
  • Drawing tools — add trend lines, horizontal lines, rectangles, text annotations
  • Alert management — create, list, and delete price alerts
  • Replay mode — step through historical bars for practice trading
  • Multi-pane layouts — set up 2x2, 3x1 grids with different symbols
  • Chart streaming — monitor live data with JSONL output
  • CLI access — every MCP tool available as tv command for scripting

Installation

Prerequisites

  • TradingView Desktop app (paid subscription required)
  • Node.js 18+
  • Claude Code with MCP support
  • macOS, Windows, or Linux

Setup Steps

# 1. Clone and install
git clone https://github.com/tradesdontlie/tradingview-mcp.git
cd tradingview-mcp
npm install

# 2. Optional: Install CLI globally
npm link

Launch TradingView with Debug Mode

TradingView Desktop must run with Chrome DevTools Protocol enabled on port 9222.

macOS:

./scripts/launch_tv_debug_mac.sh

Windows:

scripts\launch_tv_debug.bat

Linux:

./scripts/launch_tv_debug_linux.sh

Or use the MCP tool:

// Claude will execute
tv_launch()

Configure Claude Code

Add to ~/.claude/.mcp.json or project .mcp.json:

{
  "mcpServers": {
    "tradingview": {
      "command": "node",
      "args": ["/absolute/path/to/tradingview-mcp/src/server.js"]
    }
  }
}

Verify Connection

Ask Claude: "Use tv_health_check to verify TradingView is connected"

Key MCP Tools

Chart Reading (Start Here)

// 1. Always start with state to get chart context
const state = await chart_get_state();
// Returns: { symbol: "BTCUSD", timeframe: "5", indicators: [{name, id}], layout: "..." }

// 2. Get current price
const quote = await quote_get();
// Returns: { symbol, close, open, high, low, volume, change, changePercent }

// 3. Read all indicator values (RSI, MACD, BB, etc.)
const values = await data_get_study_values();
// Returns: [{ name: "RSI", plots: [{title: "RSI", value: 54.32}] }]

// 4. Get OHLCV bars (ALWAYS use summary: true first)
const bars = await data_get_ohlcv({ summary: true });
// Returns: { bars: 500, range: "...", high: 45000, low: 42000, avgVolume: 1234 }

Pine Script Data (Custom Indicators)

Read line.new(), label.new(), table.new(), box.new() from Pine Scripts:

// Read horizontal price levels (support/resistance)
const lines = await data_get_pine_lines({ 
  study_filter: "Session Levels" 
});
// Returns: [{ y: 24500, text: "PDH", color: "blue" }]

// Read text labels with prices
const labels = await data_get_pine_labels({ 
  study_filter: "Market Structure" 
});
// Returns: [{ price: 24450, text: "HH", time: "2025-01-15T10:30:00Z" }]

// Read data tables (session stats, analytics)
const tables = await data_get_pine_tables({ 
  study_filter: "Volume Profile" 
});
// Returns: [{ headers: ["Price", "Volume"], rows: [[24500, 1234], ...] }]

// Read price zones/ranges
const boxes = await data_get_pine_boxes({ 
  study_filter: "Supply Demand" 
});
// Returns: [{ high: 24600, low: 24500, text: "Supply Zone" }]

Always use study_filter to target specific indicators — reduces noise and token usage.

Chart Control

// Change symbol
await chart_set_symbol({ symbol: "AAPL" });

// Change timeframe (1, 5, 15, 60, D, W, M)
await chart_set_timeframe({ timeframe: "D" });

// Change chart type
await chart_set_type({ type: "HeikinAshi" }); // Candles, Line, Area, Renko

// Scroll to date
await chart_scroll_to_date({ date: "2025-01-15" });

// Zoom to exact range (unix timestamps)
await chart_set_visible_range({ 
  from: 1705276800, 
  to: 1705363200 
});

// Add indicator (use FULL name)
await chart_manage_indicator({ 
  action: "add", 
  name: "Relative Strength Index" // NOT "RSI"
});

// Remove indicator
await chart_manage_indicator({ 
  action: "remove", 
  indicator_id: "123abc" // from chart_get_state
});

Pine Script Development

// 1. Inject code into Pine Editor
await pine_set_source({ 
  source: `//@version=5
indicator("My RSI", overlay=false)
rsiValue = ta.rsi(close, 14)
plot(rsiValue, "RSI", color=color.blue)
hline(70, "Overbought", color=color.red)
hline(30, "Oversold", color=color.green)`
});

// 2. Compile with auto-detection
const result = await pine_smart_compile();
// Returns: { success: true/false, version_detected: 5, errors: [] }

// 3. Check for errors
if (!result.success) {
  const errors = await pine_get_errors();
  // Returns: [{ line: 4, message: "Undeclared identifier 'foo'" }]
}

// 4. Read console output (log.info)
const logs = await pine_get_console();
// Returns: ["RSI value: 54.32", "Signal: BUY"]

// 5. Save to TradingView cloud
await pine_save({ name: "My Custom RSI" });

// Read current source (WARNING: can be 200KB+ for complex scripts)
const code = await pine_get_source();

// Analyze code structure (get functions, inputs, plots)
const analysis = await pine_analyze_code();
// Returns: { functions: [...], inputs: [...], plots: [...] }

Multi-Pane Layouts

// List all panes
const panes = await pane_list();
// Returns: [{ index: 0, symbol: "BTCUSD", active: true }, ...]

// Change layout (s, 2h, 2v, 2x2, 4, 6, 8)
await pane_set_layout({ layout: "2x2" });

// Set symbol on specific pane
await pane_set_symbol({ pane_index: 0, symbol: "ES1!" });
await pane_set_symbol({ pane_index: 1, symbol: "NQ1!" });
await pane_set_symbol({ pane_index: 2, symbol: "AAPL" });
await pane_set_symbol({ pane_index: 3, symbol: "TSLA" });

// Focus a pane
await pane_focus({ pane_index: 1 });

Drawing Tools

// Draw horizontal line
await draw_shape({
  shape_type: "horizontal_line",
  price: 24500,
  text: "Key Level",
  color: "#FF0000"
});

// Draw trend line
await draw_shape({
  shape_type: "trend_line",
  price1: 24000,
  time1: "2025-01-10T10:00:00Z",
  price2: 24500,
  time2: "2025-01-15T15:00:00Z",
  color: "#00FF00"
});

// Draw rectangle
await draw_shape({
  shape_type: "rectangle",
  price1: 24000,
  time1: "2025-01-10T10:00:00Z",
  price2: 24500,
  time2: "2025-01-15T15:00:00Z",
  fill_color: "#0000FF33"
});

// List all drawings
const drawings = await draw_list();

// Remove specific drawing
await draw_remove({ drawing_id: "abc123" });

// Clear all drawings
await draw_clear();

Alert Management

// List alerts
const alerts = await alert_list();

// Create price alert
await alert_create({
  symbol: "BTCUSD",
  condition: "crossing",
  price: 45000,
  message: "BTC crossed 45k"
});

// Delete alert
await alert_delete({ alert_id: "xyz789" });

Replay Mode

// Start replay at date
await replay_start({ date: "2025-03-01" });

// Step forward (bar-by-bar)
await replay_step({ direction: "forward", bars: 1 });

// Step backward
await replay_step({ direction: "backward", bars: 5 });

// Simulate trade entry
await replay_trade({
  action: "long",
  price: 24500,
  quantity: 1,
  stop_loss: 24400,
  take_profit: 24700
});

// Check replay status
const status = await replay_status();

// Auto-play
await replay_autoplay({ speed: 2 }); // 1-5

// Stop replay
await replay_stop();

Screenshot Capture

// Capture full chart
await capture_screenshot({ region: "chart" });

// Capture specific region
await capture_screenshot({ 
  region: "custom",
  x: 100, y: 100, width: 800, height: 600
});

// Returns: { path: "/tmp/chart_2025-05-16_12-30-45.png" }

CLI Usage

Every MCP tool is also a tv CLI command. All output is JSON.

# Connection
tv status                          # check connection
tv launch                          # start TradingView in debug mode

# Chart reading
tv quote                           # current price
tv ohlcv --summary                 # price summary
tv state                           # full chart state
tv values                          # all indicator values

# Chart control
tv symbol AAPL                     # change symbol
tv timeframe D                     # change timeframe
tv type HeikinAshi                 # change chart type
tv scroll --date 2025-01-15        # jump to date

# Pine Script
tv pine get                        # read source
tv pine compile                    # compile
tv pine errors                     # show errors
tv pine save "My Indicator"        # save to cloud

# Data extraction
tv data lines --filter "Levels"    # read Pine lines
tv data labels --filter "MSB"      # read Pine labels
tv data tables --filter "Profile"  # read Pine tables

# Drawing
tv draw shape --type horizontal_line --price 24500
tv draw list                       # list drawings
tv draw clear                      # clear all

# Layouts
tv pane layout 2x2                 # 4-chart grid
tv pane symbol 0 ES1!              # set pane symbol
tv pane list                       # list all panes

# Streaming (JSONL output, pipe-friendly)
tv stream quote                    # monitor price
tv stream bars                     # bar updates
tv stream values                   # indicator updates
tv stream all                      # all panes
tv stream quote | jq '.close'      # pipe to jq

Common Patterns

Full Chart Analysis Workflow

// 1. Get chart context
const state = await chart_get_state();
const quote = await quote_get();

// 2. Read all indicators
const values = await data_get_study_values();

// 3. Read custom Pine data
const lines = await data_get_pine_lines({ study_filter: "Levels" });
const labels = await data_get_pine_labels({ study_filter: "Structure" });
const tables = await data_get_pine_tables({ study_filter: "Stats" });

// 4. Get price summary
const ohlcv = await data_get_ohlcv({ summary: true });

// 5. Capture screenshot
const screenshot = await capture_screenshot({ region: "chart" });

// 6. Compile analysis
const analysis = `
Chart: ${state.symbol} ${state.timeframe}
Price: ${quote.close} (${quote.changePercent}%)
RSI: ${values.find(v => v.name.includes('RSI'))?.plots[0]?.value}
Key Levels: ${lines.map(l => `${l.text}: ${l.y}`).join(', ')}
Screenshot: ${screenshot.path}
`;

Pine Script Iteration

// User says: "Write a VWAP indicator with bands"

// 1. Generate initial code
const code = `//@version=5
indicator("VWAP Bands", overlay=true)
vwapValue = ta.vwap
stdDev = ta.stdev(close, 20)
upper = vwapValue + stdDev
lower = vwapValue - stdDev
plot(vwapValue, "VWAP", color=color.blue)
plot(upper, "Upper", color=color.red)
plot(lower, "Lower", color=color.green)`;

// 2. Inject and compile
await pine_set_source({ source: code });
const result = await pine_smart_compile();

// 3. Check errors
if (!result.success) {
  const errors = await pine_get_errors();
  // Fix errors, iterate
  // await pine_set_source({ source: fixedCode });
  // await pine_smart_compile();
}

// 4. Test on chart, read console
const logs = await pine_get_console();

// 5. Save when satisfied
await pine_save({ name: "VWAP Bands" });

Multi-Symbol Dashboard

// Set up 4-chart grid with futures
await pane_set_layout({ layout: "2x2" });
await pane_set_symbol({ pane_index: 0, symbol: "ES1!" });  // S&P 500
await pane_set_symbol({ pane_index: 1, symbol: "NQ1!" });  // Nasdaq
await pane_set_symbol({ pane_index: 2, symbol: "YM1!" });  // Dow
await pane_set_symbol({ pane_index: 3, symbol: "RTY1!" }); // Russell

// Stream all panes
// CLI: tv stream all | jq '{es: .panes[0].quote.close, nq: .panes[1].quote.close}'

Automated Level Detection

// Read Pine Script levels from custom indicator
const lines = await data_get_pine_lines({ 
  study_filter: "Supply Demand Zones" 
});

// Create alerts at each level
for (const line of lines) {
  await alert_create({
    symbol: state.symbol,
    condition: "crossing",
    price: line.y,
    message: `Price crossed ${line.text} at ${line.y}`
  });
}

Replay Practice Session

// 1. Start replay at month start
await replay_start({ date: "2025-05-01" });

// 2. Step forward until setup appears
await replay_step({ direction: "forward", bars: 10 });

// 3. Simulate entry
const quote = await quote_get();
await replay_trade({
  action: "long",
  price: quote.close,
  quantity: 1,
  stop_loss: quote.close * 0.98,
  take_profit: quote.close * 1.02
});

// 4. Continue stepping to see outcome
await replay_step({ direction: "forward", bars: 20 });

Troubleshooting

Connection Issues

# Check if TradingView is running with debug port
tv status

# If failed, launch manually
./scripts/launch_tv_debug_mac.sh  # or .bat / _linux.sh

# Verify port 9222 is open
lsof -i :9222  # macOS/Linux
netstat -ano | findstr :9222  # Windows

MCP Tools Not Appearing in Claude

  1. Check ~/.claude/.mcp.json has absolute path
  2. Restart Claude Code completely
  3. Check Claude Code logs: Help → Show Logs
  4. Verify Node.js version: node --version (must be 18+)

Pine Script Compilation Fails

// Always check errors first
const result = await pine_smart_compile();
if (!result.success) {
  const errors = await pine_get_errors();
  console.log(errors);
}

// Common issues:
// - Wrong version (use //@version=5)
// - Undeclared identifiers (check variable names)
// - Invalid function calls (check Pine Script docs)

Indicator Values Empty

// Make sure indicator is visible and loaded
const state = await chart_get_state();
console.log(state.indicators); // check IDs

// Try toggling visibility
await indicator_toggle_visibility({ 
  indicator_id: "abc123", 
  visible: true 
});

// Wait for chart to update, then read values
await new Promise(r => setTimeout(r, 1000));
const values = await data_get_study_values();

Pine Data Returns Empty

// Check if Pine Script is actually drawing
const state = await chart_get_state();
// Look for your indicator in state.indicators

// Use exact study_filter match (case-sensitive)
const lines = await data_get_pine_lines({ 
  study_filter: "Session Levels"  // exact name from state
});

// If still empty, the Pine Script may not be drawing anything
// Check Pine console: tv pine console

Streaming Stops

# Streams poll local CDP connection
# If TradingView crashes or debug port closes, restart:
./scripts/launch_tv_debug_mac.sh
tv stream quote  # restart stream

High Token Usage

// ALWAYS use summary: true for OHLCV first
const bars = await data_get_ohlcv({ summary: true }); // 500B
// NOT: data_get_ohlcv({ bars: 100 }) // 8KB

// Use study_filter to target specific indicators
const lines = await data_get_pine_lines({ 
  study_filter: "Levels"  // reduces from 50+ lines to 5-10
});

// Avoid pine_get_source unless necessary (can be 200KB+)
// Use pine_analyze_code for structure instead

Environment Variables

None required — all communication is local via CDP on port 9222.

Optional CLI customization:

export TV_CDP_PORT=9222  # default
export TV_TIMEOUT=30000  # CDP timeout in ms

Security Considerations

  • No external connections — only localhost CDP (port 9222)
  • No data storage — all data stays on your machine
  • No TradingView server access — requires valid subscription
  • Debug port is local-only — not exposed to network
  • Review TradingView Terms of Use for programmatic access compliance

References

FAQ

What does the tradingview-mcp-assistant skill do?

AI-assisted TradingView chart analysis and automation via Chrome DevTools Protocol for Claude Code

How do I install tradingview-mcp-assistant?

Run npx skills add https://github.com/reason-machines/mcp-skills --skill tradingview-mcp-assistant in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/tradingview-mcp-assistant/ (personal) or .claude/skills/tradingview-mcp-assistant/ (project).

Which AI agents can use tradingview-mcp-assistant?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is tradingview-mcp-assistant safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains tradingview-mcp-assistant?

It is published by reason-machines in reason-machines/mcp-skills. It has 262 recorded installs.

More from reason-machines/mcp-skills

View all →

codebase-memory-mcp-intelligence

reason-machines/mcp-skills

High-performance code intelligence MCP server that indexes codebases into knowledge graphs for structural queries, call traces, and architecture analysis

AI & Agents505 installs

playwright-mcp-server

reason-machines/mcp-skills

Browser automation MCP server using Playwright's accessibility tree for LLM-friendly web interaction

AI & Agents285 installs

lanhu-mcp-collaboration

reason-machines/mcp-skills

Open the skill to read its SKILL.md instructions.

AI & Agents245 installs

chrome-devtools-mcp-automation

reason-machines/mcp-skills

Expert guidance for Chrome DevTools MCP server - browser automation, debugging, and performance analysis for AI agents

AI & Agents239 installs

github-mcp-server

reason-machines/mcp-skills

Open the skill to read its SKILL.md instructions.

AI & Agents237 installs

ableton-live-mcp-control

reason-machines/mcp-skills

Control Ableton Live with AI agents via MCP - create MIDI clips, insert audio, add tracks/devices, analyze signals, automate mixing

AI & Agents236 installs

Popular ai & agents skills

View category →

google-agents-cli-publish

google/agents-cli

This skill should be used when the user wants to "publish an agent", "publish my ADK agent", "register an agent with Gemini", "publish to Gemini" (formerly Gemini Enterprise), or needs guidance on the agents-cli publish gemini command. Also use when the user wants to "manage agents in Agent Registry", "list/update/delete registered agents", or "register an MCP server". Covers ADK vs A2A registration modes, programmatic and interactive usage, flag reference, auto-detection from deployment metadata, Agent Registry fleet management, and troubleshooting. Part of the agents-cli skills suite. Do NOT use for deployment (use google-agents-cli-deploy).

AI & Agents513.9K installs

google-agents-cli-eval

google/agents-cli

This skill should be used when the user wants to "run an evaluation", "evaluate my agent", "evaluate my ADK agent", "write an eval dataset", "analyze eval failures", "compare eval results", "optimize agent", or needs guidance on the Gemini platform eval methodology and the Quality Flywheel. Covers eval metrics, dataset schema, LLM-as-judge scoring, and common failure causes. Applies to any agents-cli project, whatever framework the agent is written in. Do NOT use for agent API code patterns (ADK: use google-agents-cli-adk-code), deployment (use google-agents-cli-deploy), or project scaffolding (use google-agents-cli-scaffold).

AI & Agents513.5K installs

skill-creator

anthropics/skills

Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.

OfficialAI & Agents416.4K installs

codex-pet

prime-skills/runcomfy-agent-skills

Codex Pet generator on RunComfy. Build a Codex-compatible Codex Pet spritesheet.webp + pet.json from a single reference image, drop it into ${CODEXHOME:-$HOME/.codex}/pets/ / and Codex picks it up as a custom Codex Pet next to the 8 built-ins. This skill produces the exact Codex Pet atlas Codex expects (1536x1872 PNG/WebP, 8 cols x 9 rows, 192x208 cells, 9 animation states — idle, running-right, running-left, waving, jumping, failed, waiting, running, review). Calls OpenAI GPT Image 2 edit ONCE via the local RunComfy CLI as runcomfy run openai/gpt-image-2/edit to produce a canonical Codex Pet pose, then assembles all 9 animation rows programmatically with ImageMagick micro-transforms — no Codex Pro, no $imagegen, no OPENAIAPIKEY required, only RUNCOMFYTOKEN. Triggers on "codex pet", "create codex pet", "make codex pet", "hatch codex pet", "/hatch image", "desktop pet codex", "codex pets", "spritesheet.webp", or any explicit ask to build a custom pet for OpenAI Codex.

AI & Agents402.1K installs

full-output-enforcement

leonxlnx/taste-skill

Overrides default LLM truncation behavior. Enforces complete code generation, bans placeholder patterns, and handles token-limit splits cleanly. Apply to any task requiring exhaustive, unabridged output.

AI & Agents401K installs

executing-plans

obra/superpowers

Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available

AI & Agents245.7K installs