Skip to content

"Vibe-Trading: Your Personal Trading Agent"

chore(trading): clean connector docs and on-ramp mapping

Haozhe Wu1e3bd7a8c06e
diff --git a/README_ar.md b/README_ar.md
index 6c63b6ada..a1a9ca6b5 100644
--- a/README_ar.md
+++ b/README_ar.md
@@ -774,7 +774,7 @@ Vibe-Trading/
├── agent/ # Backend (Python)
│ ├── cli/ # CLI package — interactive TUI + subcommands
│ ├── api_server.py # FastAPI server — runs, sessions, upload, swarm, SSE
-│ ├── mcp_server.py # MCP server — 22 tools for OpenClaw / Claude Desktop
+│ ├── mcp_server.py # MCP server — 35 tools for OpenClaw / Claude Desktop
│ │
│ ├── src/
│ │ ├── agent/ # ReAct agent core
diff --git a/README_ja.md b/README_ja.md
index 32559bfb0..1815618bd 100644
--- a/README_ja.md
+++ b/README_ja.md
@@ -671,7 +671,7 @@ Settings reads は side-effect free です。`GET /settings/llm` と `GET /setti
## 🔌 MCP Plugin
-Vibe-Trading は MCP-compatible client 向けに 22 MCP tools を公開します。stdio subprocess として動作し、server setup は不要です。**22 tools のうち 21 tools は API key なしで動作します**(HK/US/crypto)。LLM key が必要なのは `run_swarm` のみです。
+Vibe-Trading は MCP-compatible client 向けに 35 MCP tools を公開します。stdio subprocess として動作し、server setup は不要です。Core research tools は HK/US/crypto で API key なしに動作し、trading connector tools は選択中の connector profile を使います。LLM key が必要なのは `run_swarm` のみです。
<details>
<summary><b>Claude Desktop</b></summary>
@@ -713,7 +713,7 @@ vibe-trading-mcp --transport sse # SSE for web clients
</details>
-**公開される MCP tools(22):** `list_skills`, `load_skill`, `backtest`, `factor_analysis`, `analyze_options`, `pattern_recognition`, `get_market_data`, `web_search`, `read_url`, `read_document`, `read_file`, `write_file`, `analyze_trade_journal`, `extract_shadow_strategy`, `run_shadow_backtest`, `render_shadow_report`, `scan_shadow_signals`, `list_swarm_presets`, `run_swarm`, `get_swarm_status`, `get_run_result`, `list_runs`.
+**公開される MCP tools(35):** `list_skills`, `load_skill`, `start_research_goal`, `get_research_goal`, `add_goal_evidence`, `update_research_goal_status`, `backtest`, `factor_analysis`, `analyze_options`, `pattern_recognition`, `read_url`, `read_document`, `web_search`, `write_file`, `read_file`, `list_swarm_presets`, `run_swarm`, `get_market_data`, `get_swarm_status`, `get_run_result`, `list_runs`, `reap_stale_runs`, `analyze_trade_journal`, `extract_shadow_strategy`, `run_shadow_backtest`, `render_shadow_report`, `scan_shadow_signals`, `trading_connections`, `trading_select_connection`, `trading_check`, `trading_account`, `trading_positions`, `trading_orders`, `trading_quote`, `trading_history`.
<details>
<summary><b>ClawHub からインストール(1 コマンド)</b></summary>
@@ -771,7 +771,7 @@ Vibe-Trading/
├── agent/ # バックエンド (Python)
│ ├── cli/ # CLI パッケージ — インタラクティブ TUI + サブコマンド
│ ├── api_server.py # FastAPI サーバー — runs、sessions、upload、swarm、SSE
-│ ├── mcp_server.py # MCP サーバー — OpenClaw / Claude Desktop 向け 22 tools
+│ ├── mcp_server.py # MCP サーバー — OpenClaw / Claude Desktop 向け 35 tools
│ │
│ ├── src/
│ │ ├── agent/ # ReAct エージェントコア
diff --git a/README_ko.md b/README_ko.md
index e0ca2537b..3bacabce8 100644
--- a/README_ko.md
+++ b/README_ko.md
@@ -774,7 +774,7 @@ Vibe-Trading/
├── agent/ # Backend (Python)
│ ├── cli/ # CLI package — interactive TUI + subcommands
│ ├── api_server.py # FastAPI server — runs, sessions, upload, swarm, SSE
-│ ├── mcp_server.py # MCP server — 22 tools for OpenClaw / Claude Desktop
+│ ├── mcp_server.py # MCP server — 35 tools for OpenClaw / Claude Desktop
│ │
│ ├── src/
│ │ ├── agent/ # ReAct agent core
diff --git a/README_zh.md b/README_zh.md
index ddfd99565..b74e7d9b8 100644
--- a/README_zh.md
+++ b/README_zh.md
@@ -670,7 +670,7 @@ Settings 读取无副作用:`GET /settings/llm` 和 `GET /settings/data-source
## 🔌 MCP Plugin
-Vibe-Trading 为任何 MCP-compatible client 暴露 22 个 MCP tools。它作为 stdio subprocess 运行,无需 server setup。**22 个工具中有 21 个零 API key 可用**(港/美股/加密)。只有 `run_swarm` 需要 LLM key。
+Vibe-Trading 为任何 MCP-compatible client 暴露 35 个 MCP tools。它作为 stdio subprocess 运行,无需 server setup。核心 research tools 对港股/美股/加密零 API key 可用;trading connector tools 使用当前选择的 connector profile;只有 `run_swarm` 需要 LLM key。
<details>
<summary><b>Claude Desktop</b></summary>
@@ -712,7 +712,7 @@ vibe-trading-mcp --transport sse # SSE for web clients
</details>
-**暴露的 MCP tools(22):** `list_skills`, `load_skill`, `backtest`, `factor_analysis`, `analyze_options`, `pattern_recognition`, `get_market_data`, `web_search`, `read_url`, `read_document`, `read_file`, `write_file`, `analyze_trade_journal`, `extract_shadow_strategy`, `run_shadow_backtest`, `render_shadow_report`, `scan_shadow_signals`, `list_swarm_presets`, `run_swarm`, `get_swarm_status`, `get_run_result`, `list_runs`.
+**暴露的 MCP tools(35):** `list_skills`, `load_skill`, `start_research_goal`, `get_research_goal`, `add_goal_evidence`, `update_research_goal_status`, `backtest`, `factor_analysis`, `analyze_options`, `pattern_recognition`, `read_url`, `read_document`, `web_search`, `write_file`, `read_file`, `list_swarm_presets`, `run_swarm`, `get_market_data`, `get_swarm_status`, `get_run_result`, `list_runs`, `reap_stale_runs`, `analyze_trade_journal`, `extract_shadow_strategy`, `run_shadow_backtest`, `render_shadow_report`, `scan_shadow_signals`, `trading_connections`, `trading_select_connection`, `trading_check`, `trading_account`, `trading_positions`, `trading_orders`, `trading_quote`, `trading_history`.
<details>
<summary><b>从 ClawHub 安装(一条命令)</b></summary>
@@ -770,7 +770,7 @@ Vibe-Trading/
├── agent/ # 后端(Python)
│ ├── cli/ # CLI 包 —— 交互式 TUI + 子命令
│ ├── api_server.py # FastAPI server —— runs、sessions、upload、swarm、SSE
-│ ├── mcp_server.py # MCP server —— 22 个工具,面向 OpenClaw / Claude Desktop
+│ ├── mcp_server.py # MCP server —— 35 个工具,面向 OpenClaw / Claude Desktop
│ │
│ ├── src/
│ │ ├── agent/ # ReAct agent 内核
diff --git a/agent/api_server.py b/agent/api_server.py
index 06e1e595e..e7d79ce7e 100644
--- a/agent/api_server.py
+++ b/agent/api_server.py
@@ -2686,15 +2686,6 @@ def _runner_liveness_state(broker: str) -> RunnerLivenessState:
return RunnerLivenessState(broker=broker, alive=alive, last_tick=tick, last_tick_age_seconds=age)
-def _connector_profile_for_broker(broker: str) -> str:
- """Return the public connector profile id for a live broker key."""
- if broker == "robinhood":
- return "robinhood-live-mcp"
- if broker == "ibkr":
- return "ibkr-live-official-mcp-readonly"
- return f"{broker}-live-mcp"
-
-
@app.get("/live/status", response_model=LiveStatusResponse, dependencies=[Depends(require_auth)])
async def live_status_endpoint(broker: Optional[str] = Query(None, max_length=64)):
"""Return live-channel status: auth, active mandate, runner liveness, halt (C2).
@@ -2751,11 +2742,15 @@ async def live_authorize_endpoint(payload: LiveAuthorizeRequest):
if broker not in set(_known_live_brokers()):
raise HTTPException(status_code=400, detail=f"unknown live broker: {broker}")
+ from src.trading.service import connector_profile_id_for_broker
+
+ connector_profile = connector_profile_id_for_broker(broker)
return {
"broker": broker,
+ "connector_profile": connector_profile,
"oauth_token_present": _oauth_token_present(broker),
"instruction": (
- f"Run `vibe-trading connector authorize {_connector_profile_for_broker(broker)}` "
+ f"Run `vibe-trading connector authorize {connector_profile}` "
"from the device that will hold the broker session. This opens the "
"broker's own OAuth consent flow; Vibe-Trading never holds funds and "
"only relays intent once you authorize."
diff --git a/agent/src/trading/service.py b/agent/src/trading/service.py
index 9d788941e..a1430bb80 100644
--- a/agent/src/trading/service.py
+++ b/agent/src/trading/service.py
@@ -152,6 +152,21 @@ def broker_supports_live_runner(broker: str) -> bool:
return live_runner_profile_for_broker(broker) is not None
+def connector_profile_id_for_broker(broker: str) -> str:
+ """Return the preferred connector profile id for a broker on-ramp."""
+ key = str(broker or "").strip().lower()
+ if not key:
+ raise ValueError("broker must not be blank")
+
+ candidates = [profile for profile in list_profiles() if profile.connector == key and profile.environment == "live"]
+ for profile in candidates:
+ if profile.transport == "remote_mcp":
+ return profile.id
+ if candidates:
+ return candidates[0].id
+ return f"{key}-live-mcp"
+
+
def runner_tool_name(connector: str, operation: str) -> str | None:
"""Map a runner operation to a connector-specific remote MCP tool name."""
if connector == "robinhood":
diff --git a/agent/tests/test_api_live_runtime.py b/agent/tests/test_api_live_runtime.py
index 949605283..3268ae04f 100644
--- a/agent/tests/test_api_live_runtime.py
+++ b/agent/tests/test_api_live_runtime.py
@@ -121,6 +121,7 @@ def test_authorize_onramp_describes_cli_flow(tmp_path: Path, monkeypatch) -> Non
assert response.status_code == 200
body = response.json()
assert body["broker"] == "robinhood"
+ assert body["connector_profile"] == "robinhood-live-mcp"
assert body["oauth_token_present"] is False
# On-ramp must point at the desktop CLI flow and never return a token.
assert "vibe-trading connector authorize robinhood-live-mcp" in body["instruction"]
diff --git a/agent/tests/test_trading_connections.py b/agent/tests/test_trading_connections.py
index aa99290ef..a7c7d50d2 100644
--- a/agent/tests/test_trading_connections.py
+++ b/agent/tests/test_trading_connections.py
@@ -60,6 +60,13 @@ def test_ibkr_official_profile_does_not_advertise_unknown_generic_reads() -> Non
assert "does not support" in result["error"]
+def test_connector_profile_id_for_broker_prefers_live_remote_mcp() -> None:
+ """Broker on-ramps should resolve through the centralized profile registry."""
+ assert service.connector_profile_id_for_broker("robinhood") == "robinhood-live-mcp"
+ assert service.connector_profile_id_for_broker("ibkr") == "ibkr-live-official-mcp-readonly"
+ assert service.connector_profile_id_for_broker("futurebroker") == "futurebroker-live-mcp"
+
+
def test_select_connection_tool_returns_canonical_profile_id(
monkeypatch: pytest.MonkeyPatch, tmp_path
) -> None:
diff --git a/frontend/src/components/chat/RunnerStatus.tsx b/frontend/src/components/chat/RunnerStatus.tsx
index b751ecccd..68ec26045 100644
--- a/frontend/src/components/chat/RunnerStatus.tsx
+++ b/frontend/src/components/chat/RunnerStatus.tsx
@@ -75,14 +75,8 @@ function summarizeLimits(limits: LiveMandateLimits | undefined): string {
return parts.join(" · ");
}
-function fallbackConnectorProfileForBroker(broker: string): string {
- if (broker === "robinhood") return "robinhood-live-mcp";
- if (broker === "ibkr") return "ibkr-live-official-mcp-readonly";
- return `${broker}-live-mcp`;
-}
-
-function fallbackAuthorizeInstruction(broker: string): string {
- return `Run \`vibe-trading connector authorize ${fallbackConnectorProfileForBroker(broker)}\` from the desktop session that will hold the broker connection.`;
+function fallbackAuthorizeInstruction(): string {
+ return "Run `vibe-trading connector list`, choose the broker profile, then run `vibe-trading connector authorize <profile>` from the desktop session that will hold the broker connection.";
}
function BrokerRow({
@@ -103,7 +97,7 @@ function BrokerRow({
const mandate = broker.mandate ?? null;
const countdown = formatCountdown(mandate?.expires_at);
const authorizeInstruction = authorizeHint?.instruction
- ?? (authorizeFailed ? fallbackAuthorizeInstruction(brokerKey) : "Loading connector authorization instructions...");
+ ?? (authorizeFailed ? fallbackAuthorizeInstruction() : "Loading connector authorization instructions...");
const authorizeNote = "The connector channel stays read-only until OAuth succeeds and a mandate is committed.";
useEffect(() => {
diff --git a/frontend/src/lib/api.ts b/frontend/src/lib/api.ts
index 191ceba17..9607d12fa 100644
--- a/frontend/src/lib/api.ts
+++ b/frontend/src/lib/api.ts
@@ -783,6 +783,7 @@ export interface LiveAuthorizeRequest {
export interface LiveAuthorizeResponse {
broker: string;
+ connector_profile: string;
oauth_token_present: boolean;
instruction: string;
note?: string;