Skip to main content
Glama
README.md
# pinetop

MCP server for **TradingView Desktop** — control charts, Pine Script, indicators, and backtesting via CDP (Chrome DevTools Protocol).

```bash
pip install pinetop
```

## Quick Start

```bash
# 1. Launch TradingView with CDP flags
pinetop-launch

# 2. Register with Hermes
hermes mcp add pinetop --command pinetop

# 3. Use it (in a new session after /reset)
```

## Tools (14)

| Category | Tools |
|----------|-------|
| Chart Control | `tv_get_state`, `tv_set_symbol`, `tv_set_timeframe`, `tv_get_ohlcv`, `tv_get_quote`, `tv_get_studies`, `tv_get_symbol_info`, `tv_screenshot` |
| Pine Script | `tv_pine_open`, `tv_pine_get_source`, `tv_pine_compile`, `tv_pine_get_errors` |
| Strategy Tester | `tv_open_strategy_tester`, `tv_get_strategy_results` |

## Architecture

```
Hermes ↔ MCP stdio ↔ pinetop (FastMCP) ↔ CDP WebSocket ↔ TradingView Desktop
                                              ↓
                            window.TradingViewApi.activeChart()
```

## Requirements

- TradingView Desktop 3.3.x (standalone, NOT Microsoft Store)
- Python 3.11+
- `websocket-client`

## License

MIT

## Links

- **GitHub:** https://github.com/jsarmiento-dev/pinetop
- **Issues:** https://github.com/jsarmiento-dev/pinetop/issues