Skip to main content

External MCP Server & Tool Reference

PTView exposes its market data, indicators, chart navigation, drawing automation, and notification capabilities to external AI agents (such as VS Code Copilot, Cursor, Claude Desktop, and Antigravity) over the Model Context Protocol (MCP).


1. Connection Modes​

PTView provides two ways to connect external MCP clients:

TransportEntry PointTool CountAuthenticationBest For
Embedded HTTP MCP Serverhttp://127.0.0.1:47821/mcp71 toolsBearer Token (Authorization: Bearer <token>)VS Code Copilot, Cursor, Antigravity, HTTP JSON-RPC clients
Out-of-Process Stdio ServerPTView.Mcp.exe65 toolsLocal Named Pipe IPC to running PTView.DesktopClaude Desktop & stdio-only MCP hosts
Additional Embedded Tools

The 6 additional tools available exclusively via the Embedded HTTP MCP Server (and in-app AI Copilot) are workspace_get_session_snapshot, chart_get_overlay_state, chart_set_overlay_visibility, accounts_list, accounts_get_active, and accounts_switch_active.


2. Setting Up the Embedded HTTP MCP Server​

  1. Open AI Settings in PTView and switch to the MCP (AI agent) tab.
  2. Check Enable HTTP MCP Server (Enabled).
  3. Verify or customize the listening Port (valid range: 1024–65535, default: 47821) and Bearer Auth Token (auto-generated 32-character hex GUID by default).
  4. Click Save — McpHttpServerService starts immediately on http://127.0.0.1:<port>/mcp/.
  5. Copy the generated JSON snippet from the dialog into your MCP client configuration (e.g., .vscode/mcp.json or Cursor MCP config):
{
"servers": {
"ptview": {
"type": "http",
"url": "http://127.0.0.1:47821/mcp",
"headers": {
"Authorization": "Bearer <your-auth-token>"
}
}
}
}

HTTP Endpoints & JSON-RPC Methods​

All requests must include Authorization: Bearer <your-auth-token>:

  • GET /mcp/: Returns server health (status, server, version, port, toolsCount).
  • POST /mcp/: JSON-RPC 2.0 (protocolVersion: "2024-11-05") supporting initialize, notifications/initialized, ping, tools/list, and tools/call.

3. Setting Up the Stdio MCP Server (PTView.Mcp)​

For stdio-based MCP clients (such as Claude Desktop), point the client to PTView.Mcp.exe while PTView.Desktop is running:

{
"mcpServers": {
"ptview": {
"command": "C:\\Path\\To\\PTView.Mcp.exe",
"args": []
}
}
}
Keep Desktop Workstation Running

PTView.Mcp.exe communicates with the live workstation UI over a local Named Pipe (GuiBridgeClient). Always keep PTView.Desktop running before invoking tools.


4. Naming Convention (<domain>_<action>)​

Every tool follows a consistent underscore-namespaced snake_case schema (<domain>_<action>, matching ^[a-zA-Z0-9_-]{1,64}$) across 8 domains so it works without warnings in VS Code, Cursor, Claude Desktop, OpenAI, and Gemini:

  • draws_* (27) — Chart annotations, lines, zones, Fibonacci tools, and lock/visibility state
  • indicators_* (10) — Built-in & custom plugin indicators and buffer inspection
  • chart_* (13) — Viewport zoom, scroll, price scale, overlays, and timeframe switching
  • market_* (8) — Exchange instruments, tickers, OHLCV candles, order book, funding, OI, sentiment
  • intel_* (7) — Fear & Greed Index, global market stats, volatility, coin fundamentals, news, web search
  • workspace_* (2) — Open chart tabs/sessions and snapshots
  • accounts_* (3) — AI provider account inspection and switching
  • notify_* (1) — Status bar and Telegram alert delivery
Backward-Compatible Naming

For backward compatibility, both the Embedded HTTP MCP Server, Stdio MCP Server, and in-app AI Copilot still accept legacy dot-separated (draws.horizontal_line) and double-underscore (draws__horizontal_line) names when invoked and resolve them automatically to <domain>_<action>.


5. Complete 71-Tool Reference​

5.1 Drawing Automation (draws_* — 27 tools)​

Tool NameModeDescription
draws_listRead-onlyList all drawing objects currently placed on the target chart
draws_horizontal_lineUI MutationDraw a horizontal price level line (main chart or sub-indicator pane)
draws_vertical_lineUI MutationDraw a vertical timestamp marker line
draws_trend_lineUI MutationDraw a trend line between two (time, price) anchors
draws_rayUI MutationDraw a ray extending infinitely from start anchor through end anchor
draws_extended_lineUI MutationDraw a line extending infinitely in both directions through two anchors
draws_trend_angleUI MutationDraw a trend line displaying slope in visual degrees
draws_rectangle_zoneUI MutationDraw a shaded rectangle zone (Order Block, FVG, Supply/Demand)
draws_text_annotationUI MutationPlace a text callout at a (time, price) coordinate
draws_emoji_markerUI MutationPlace an emoji signal marker (e.g. 🎯, 🚀, ⚠️) on the chart
draws_fib_retracementUI MutationDraw a 2-point Fibonacci retracement with configurable levels/colors
draws_fib_extensionUI MutationDraw a 3-point trend-based Fibonacci extension
draws_fib_time_zonesUI MutationDraw vertical Fibonacci time cycle lines
draws_fib_fanUI MutationDraw a Fibonacci speed resistance fan
draws_fib_channelUI MutationDraw a 3-point parallel Fibonacci channel
draws_ellipseUI MutationDraw an ellipse/circle defined by bounding box anchors
draws_triangleUI MutationDraw a closed 3-vertex triangle
draws_arrowUI MutationDraw a directional arrow from start to end anchor
draws_measurementUI MutationDraw a price/time ruler showing delta, percentage, and bar count
draws_modifyUI MutationModify coordinates, style, text, targetIndicatorId, or lock state of an existing drawing
draws_removeUI MutationRemove a specific drawing by ID
draws_clearUI MutationClear drawings (aiOnly=true preserves user drawings)
draws_lock_allUI MutationLock all drawings and enable global Lock All rail state
draws_unlock_allUI MutationUnlock all drawings and disable global Lock All rail state
draws_set_lock_stateUI MutationSet global drawings lock state explicitly
draws_hide_allUI MutationHide all drawings on the chart
draws_show_allUI MutationShow all drawings on the chart

5.2 Technical Indicators (indicators_* — 10 tools)​

Tool NameModeDescription
indicators_list_availableRead-onlyList all built-in and loaded custom plugin indicators with parameter schemas
indicators_addUI MutationAttach a built-in indicator (SMA, EMA, VWMA, RSI, MACD, BANDS, ATR, SUPERTREND, STOCHASTIC, OBV)
indicators_add_customUI MutationAttach a loaded custom plugin indicator
indicators_modifyUI MutationUpdate parameters, colors, widths, line styles, levels, fills, or visibility of an existing indicator
indicators_removeUI MutationRemove an indicator by ID
indicators_clearUI MutationClear indicators (aiOnly=true preserves user indicators)
indicators_get_chartRead-onlyList indicators currently attached to the chart tab
indicators_list_sessionRead-onlyList indicators registered for a specific session ID
indicators_get_valueRead-onlyRead the latest or shifted (shift=0,1,...) calculated value of an indicator buffer
indicators_get_buffer_rangeRead-onlyRetrieve a historical slice of calculated indicator buffer values

5.3 Chart Navigation & Viewport (chart_* — 13 tools)​

Tool NameModeDescription
chart_get_zoom_stateRead-onlyGet candle width, visible candle count, and visible time/price range
chart_zoom_inUI MutationZoom in (enlarge candles)
chart_zoom_outUI MutationZoom out (fit more candles)
chart_reset_zoomUI MutationReset zoom and pan to default live view
chart_set_zoomUI MutationSet exact candleWidth (2.0–50.0) or zoomFactor
chart_zoom_to_rangeUI MutationFit viewport to visibleCandles or [startTime, endTime]
chart_zoom_to_areaUI MutationZoom into a 2D time and price bounding box
chart_set_price_scaleUI MutationSet manual vertical price bounds or toggle auto-scale
chart_reset_price_scaleUI MutationRestore automatic vertical price scaling
chart_scrollUI MutationPan viewport by delta candles, to timestamp, or to start/end
chart_switch_timeframeUI MutationSwitch chart timeframe (1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 12h, 1d, 1w)
chart_get_overlay_stateRead-onlyGet visibility states of chart overlays (HTTP / AI Copilot only)
chart_set_overlay_visibilityUI MutationConfigure chart overlay visibility (HTTP / AI Copilot only)

5.4 Market Data (market_* — 8 tools)​

Tool NameModeDescription
market_get_instrumentsRead-onlySearch tradable instruments and contract specs in PTView's catalog cache
market_get_tickerRead-onlyGet latest price, bid/ask, 24h high/low, and volume
market_get_candlesRead-onlyGet recent OHLCV candles for a symbol and timeframe
market_get_candles_from_timeRead-onlyGet up to 300 historical OHLCV candles ending at an ISO 8601 endTime
market_get_funding_rateRead-onlyGet current and predicted perpetual swap funding rate
market_get_open_interestRead-onlyGet current open interest (contracts and coin amount)
market_get_sentiment_ratiosRead-onlyGet Long/Short account ratio and Taker buy/sell volume ratios
market_get_order_bookRead-onlyGet Level 2 order book depth, spread, and liquidity metrics

5.5 Market Intelligence (intel_* — 7 tools)​

Tool NameModeDescription
intel_get_fear_greed_indexRead-onlyGet Crypto Fear & Greed Index history (1–30 days)
intel_get_global_overviewRead-onlyGet total market cap, 24h volume, BTC.D, and ETH.D
intel_get_volatility_metricsRead-onlyCalculate Historical Volatility (HV %), ATR, and 24h range %
intel_get_coin_fundamentalsRead-onlyGet coin rank, market cap, supply, and profile stats
intel_get_crypto_newsRead-onlyFetch latest crypto news headlines and sentiment tags
intel_get_news_article_contentRead-onlyCrawl and extract full readable text from a news URL
intel_search_webRead-onlyPerform an external web search for macro or project catalysts

5.6 Workspace, Accounts & Notifications (workspace_*, accounts_*, notify_* — 6 tools)​

Tool NameModeDescription
workspace_list_sessionsRead-onlyList all open chart tabs (sessionId, exchange, symbol, timeframe, active state)
workspace_get_session_snapshotRead-onlyGet combined session, attached indicators, and viewport zoom snapshot (HTTP / AI Copilot only)
accounts_listRead-onlyList configured AI provider profiles (HTTP / AI Copilot only)
accounts_get_activeRead-onlyGet the currently active AI provider profile (HTTP / AI Copilot only)
accounts_switch_activeState MutationSwitch active AI provider profile by name or ID (HTTP / AI Copilot only)
notify_sendNotificationDispatch status bar and HTML-formatted Telegram Bot alerts