{"record":{"id":"b4aa1c8f05465162","repo":"HKUDS/Vibe-Trading","slug":"no-mcp-server-configured-for-live-broker-broker-r","errorCode":null,"errorMessage":"no MCP server configured for live broker {broker!r}","messagePattern":"no MCP server configured for live broker (.+?)","errorType":"exception","errorClass":"LiveRunnerUnavailable","httpStatus":503,"severity":"critical","filePath":"agent/src/api/live_routes.py","lineNumber":382,"sourceCode":"    from src.tools.mcp import MCPServerAdapter\n\n    try:\n        from src.config.schema import is_live_broker_entry\n    except Exception:  # pragma: no cover - older schema without URL detection\n        is_live_broker_entry = None  # type: ignore[assignment]\n\n    cfg = load_agent_config()\n    servers = getattr(cfg, \"mcp_servers\", {}) or {}\n    for name, server_cfg in servers.items():\n        is_match = name == broker\n        if not is_match and is_live_broker_entry is not None and broker == \"robinhood\":\n            try:\n                is_match = is_live_broker_entry(name, server_cfg)\n            except Exception:  # pragma: no cover\n                is_match = False\n        if is_match:\n            return MCPServerAdapter(name, server_cfg)\n    raise LiveRunnerUnavailable(f\"no MCP server configured for live broker {broker!r}\")\n\n\ndef _fetch_broker_ceilings(broker: str) -> Optional[Dict[str, Any]]:\n    \"\"\"Best-effort fetch of broker-side account ceilings for the commit re-check.\n\n    Returns ``None`` on any failure so the caller falls back to the proposal's\n    own snapshot — a commit is never blocked on a broker read.\n    \"\"\"\n    h = _host()\n    try:\n        adapter = h._live_broker_adapter(broker)\n    except LiveRunnerUnavailable:\n        return None\n    try:\n        from src.trading.service import runner_tool_name\n\n        account_tool = runner_tool_name(broker, \"account\") or \"get_account\"\n        result = adapter.call_tool(account_tool, {})","sourceCodeStart":364,"sourceCodeEnd":400,"githubUrl":"https://github.com/HKUDS/Vibe-Trading/blob/80ffdda44c5c4db0dd84d70e051cca591cea67df/agent/src/api/live_routes.py#L364-L400","documentation":"`_live_broker_adapter` scans configured MCP servers for one matching the requested live broker via `is_live_broker_entry`; when none matches it raises LiveRunnerUnavailable with the broker name. This is a configuration error — the deployment has no MCP server entry wired to that broker.","triggerScenarios":"Requesting a live operation for broker X (e.g. through `_build_live_runner` or `_fetch_broker_ceilings`) when the MCP server config contains no entry flagged/matching live broker X.","commonSituations":"Broker name casing/mismatch between config and request ('ibkr' vs 'IBKR'), MCP server entry missing after a config migration, live trading enabled without provisioning the broker MCP server, or entry present but `is_live_broker_entry` throwing so it's skipped.","solutions":["Check the MCP server configuration and confirm an entry exists for the requested broker with the exact broker identifier used in the request.","Fix naming mismatches (case, aliases) between the request's broker string and the config entry.","If the entry exists but is skipped, inspect it — malformed metadata makes is_live_broker_entry fail and the entry is silently ignored.","Deploy or restore the missing MCP server config for live trading."],"exampleFix":"# before\nrunner = _build_live_runner(session, broker=\"IBKR\")  # config says broker='ibkr'\n\n# after\nbroker = broker.strip().lower()          # normalize like the config lookup\nassert any(is_live_broker_entry(n, c) for n, c in mcp_servers.items() for _ in [0] if is_live_broker_entry(n, c)), \"no live broker MCP configured\"\nrunner = _build_live_runner(session, broker=broker)","handlingStrategy":"fallback","validationCode":"def has_live_broker_adapter(broker: str) -> bool:\n    try:\n        _live_broker_adapter(broker)\n        return True\n    except LiveRunnerUnavailable:\n        return False","typeGuard":null,"tryCatchPattern":"try: adapter = _live_broker_adapter(broker) except LiveRunnerUnavailable: fallback_to_paper_or_fail_fast(broker)","preventionTips":["Validate broker-to-MCP mapping at app startup and fail fast","Use one canonical broker-id spelling everywhere","Alert when live broker config entries are silently skipped"],"tags":["live-trading","mcp","configuration","broker","unavailable"],"backgroundTag":"missing-service-configuration","analyzedSha":"80ffdda44c5c4db0dd84d70e051cca591cea67df","analyzedAt":"2026-08-28T12:46:38.989Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}