@romaco/mcp
MCP server for romaco-charts. Control your trading chart from Claude, Cursor, or any MCP-compatible AI agent.
README
@romaco/mcp
MCP server for romaco-charts. Control your trading chart from Claude, Cursor, or any MCP-compatible AI agent.
npx @romaco/mcp
Philosophy
Romaco MCP is compression-first. Tools return features and decisions, not raw OHLCV. Every tool's typical output is under 2 KB. Raw payloads (full chart state, snapshots, all-bar indicator series) exist but are gated behind acknowledgeHighTokenCost: true — the agent must consciously opt in and the user must explicitly request raw data.
The rule: the agent never computes, it always queries. An agent reasoning over features cannot hallucinate prices; an agent given a 70 KB raw OHLCV dump will burn its context window before it can finish a thought.
Cost table
| Tool | Default | Gated raw (with acknowledgeHighTokenCost:true) |
|---|---|---|
romaco_analyze_market |
~3–5 KB compressed MarketSummary | — |
romaco_thesis |
<2 KB computed bull/bear debate + verdict + setup | enhanced server-side thesis (Pro) |
romaco_find_levels |
<500 B | — |
romaco_detect_patterns |
<2 KB (trimmed hits) | full hits with anchor points[] |
romaco_setup_chart |
<5 KB (setup log + summary) | — |
romaco_load_candles |
<200 B ack | — |
romaco_calculate_position_size |
<1 KB | — |
romaco_list_templates |
~4.5 KB static catalog | — |
romaco_list_panes |
<1 KB | — |
romaco_get_chart_context |
~1 KB snapshot | ~80 KB full payload |
romaco_get_visible_candles |
<1 KB range summary | ~70 KB raw OHLCV |
romaco_get_indicator_values |
<500 B last/prev/delta/state | ~10 KB per-bar series |
romaco_capture_snapshot |
error (must ack) | 300–800 KB base64 image |
romaco_add_*, romaco_set_*, romaco_clear_*, romaco_go_to_*, romaco_open_paper_position |
<100 B ack messages | — |
30-second start
# 1. Install
npm install -g @romaco/mcp
# 2. Wire it into Claude Code (run from your project root)
cat > .mcp.json <<'EOF'
{ "mcpServers": { "romaco": { "command": "romaco-mcp" } } }
EOF
Then start Claude Code and prompt:
Use
romaco_setup_chartto analyze AAPL daily with thetrend_analysispreset.
That's it. The MCP server fetches yfinance data (with disk cache + cookie/crumb handshake), runs full technical analysis, and returns a compressed MarketSummary (~500 tokens) to Claude. No 429s, no manual auth.
Live chart control (optional)
To let Claude drive a real chart — drawings, indicators, alerts visible in your browser — mount <McpBridge /> next to your TradingTerminal:
import { TradingTerminal, McpBridge, type TradingTerminalRef } from 'romaco-charts/react';
import { useRef } from 'react';
function App() {
const ref = useRef<TradingTerminalRef | null>(null);
return (
<>
<TradingTerminal ref={ref} data={candles} symbol="AAPL" />
<McpBridge chartRef={ref} />
</>
);
}
See examples/pro-volatility-scanner for a complete setup. With <McpBridge /> mounted, the chart-bridge tools (add_indicator, add_drawing, add_alert, capture_snapshot, …) become available.
Data cache
Every successful yfinance fetch is cached to ~/.romaco/cache/ with per-timeframe TTL (1m→1min, 1h→1h, 1d→24h, …). A grid of N widgets requesting the same symbol triggers one upstream fetch. Wipe the cache anytime with rm -rf ~/.romaco/cache, or override the location with ROMACO_CACHE_DIR=/tmp/cache.
What it does
Exposes 20+ MCP tools in two categories:
Headless tools — work without a browser, load data and run analysis server-side:
romaco_setup_chart— one-command setup: load + preset + analyze (recommended first call)romaco_load_candles— fetch OHLCV from Yahoo Finance (free) or pass your own arrayromaco_analyze_market— full technical analysis: trend, S/R levels, RSI/MACD/divergences, volatility, patternsromaco_thesis— computed bull/bear debate → verdict (long/short/stand_aside) + confidence + entry/stop/target setup; stands aside when R/R is poor (won't fake a signal)romaco_find_levels— support/resistance via K-means + Volume Profile (POC/VAH/VAL)romaco_detect_patterns— H&S, double top/bottom, triangles, flagsromaco_calculate_position_size— pure-math risk-based position sizing with R/R + breakeven win-rateromaco_list_templates— catalog of drawing templates (trendline, fib, channels, …)
Chart-bridge tools — control a live Romaco chart in the browser:
romaco_add_indicator— EMA, RSI, MACD, Bollinger, ATR, 29+ indicatorsromaco_add_drawing— trendlines, Fibonacci, horizontal lines, channels, rectanglesromaco_add_alert— price alerts with direction (above/below/cross)romaco_capture_snapshot— PNG/JPEG base64 for vision LLMsromaco_open_paper_position— simulated long/short with SL/TPromaco_get_chart_context— complete chart state as JSONromaco_get_visible_candles— OHLCV in current viewportromaco_set_zoom/romaco_reset_view— zoom controlromaco_clear_drawings— remove all drawingsromaco_list_panes— enumerate main + subpanel panes (e.g. RSI subpanel id)romaco_get_indicator_values— read computed indicator series (by id or name)romaco_go_to_timestamp— scrub viewport to a given timestamp
Install
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"romaco": {
"command": "npx",
"args": ["-y", "@romaco/mcp"]
}
}
}
Restart Claude Desktop.
Claude Code
claude mcp add romaco -- npx -y @romaco/mcp
Or add to your project's .mcp.json:
{
"mcpServers": {
"romaco": {
"command": "npx",
"args": ["-y", "@romaco/mcp"]
}
}
}
Cursor / other MCP clients
Any client that supports stdio MCP servers works. Point it at npx @romaco/mcp.
Usage
Headless analysis (no browser needed)
Load 500 candles of AAPL 1h from yfinance, then analyze the market.
Claude will call:
romaco_load_candles→ fetches from Yahoo Financeromaco_analyze_market→ returns compressed MarketSummary (~500 tokens)romaco_find_levels→ S/R zones, POC, VAH, VAL- Reasons over the features → tells you what it sees
Live chart control (with browser)
Add <McpBridge /> to your chart app:
import { TradingTerminal, McpBridge } from 'romaco-charts/react';
function App() {
const ref = useRef(null);
return (
<>
<TradingTerminal ref={ref} symbol="AAPL" timeframe="1h" datafeed={myDatafeed} />
<McpBridge chartRef={ref} />
</>
);
}
Then from Claude:
Add EMA 20 and RSI 14 to the chart, draw a Fibonacci from the last swing low to swing high,
and capture a snapshot so I can see it.
Data sources
| Source | Auth | Coverage |
|---|---|---|
yfinance |
None (default) | Stocks, ETFs, crypto, FX, indices — delayed data |
raw |
None | Pass your own OHLCV array inline |
Bring your own key (BYOK) — Coming in v1.1: Alpaca, Polygon.io, FMP.
Configuration
| Option | Default | How to set |
|---|---|---|
| WebSocket port | 7399 |
--port 3200 or ROMACO_MCP_PORT=3200 |
ROMACO_TOKEN |
(none → free) | API key from romaco.io — unlocks Pro |
ROMACO_API_URL |
http://localhost:8000 |
ROA-I backend; prod: https://api.romaco.tech |
# Custom port
npx @romaco/mcp --port 3200
# Or via env
ROMACO_MCP_PORT=3200 npx @romaco/mcp
Set the same port in <McpBridge port={3200} />.
Free vs Pro (ROA-I)
This MCP is the free hook. It runs fully standalone — analysis is computed locally and limited by whatever model your agent uses.
| Free | Pro (ROMACO_TOKEN) |
|
|---|---|---|
| Data | yfinance / raw |
same |
| Analysis | computed locally (src/compression) |
delegated to ROA-I in the backend |
| Tools | the tools listed here | + ROA-I's exclusive backend tools (deep math, reasoning agent) |
With a ROMACO_TOKEN set, analysis tools (starting with romaco_analyze_market)
forward the heavy compute to ROA-I at ROMACO_API_URL. No token, or backend
unreachable → it falls back to local compute, so the free path never breaks.
Get a key at romaco.io. See .env.example.
Example prompts
Institutional analysis:
"Load TSLA 4h from yfinance, analyze the market, find key levels, detect any chart patterns, then draw the Fibonacci retracement of the last swing on the chart and add an alert at the 0.618 level."
Conditional automation:
"Load AAPL 15m, run full analysis. If RSI shows bullish divergence and price is near a support level, open a paper long 100 shares with stop loss at the VAL of the Volume Profile."
Pattern scanner:
"Load SPY 1d and detect patterns. For any head & shoulders found, tell me the target price and invalidation level."
Requirements
- Node.js >= 18
- For chart-bridge tools: romaco-charts >= 1.0.0-beta.6 with
<McpBridge />in your app
Links
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。