{"slug": "an-ai-trading-desk-built-as-a-team-of-sub-agents-claude-code-and-robinhood-mcp", "title": "An AI trading desk built as a team of sub-agents (Claude Code and Robinhood MCP)", "summary": "A developer built an AI-powered trading desk inside Claude Code that uses a team of specialized sub-agents—fundamental, technical, macro/news, and a risk manager—to screen stocks and propose trades, but requires human approval before placing any order via a Robinhood Agentic account. The system includes structural guardrails like human-in-the-loop approval, position caps, and prompt-injection defenses, and mirrors its state to a live dashboard. The project is in beta for US equities only and is shared as a reference architecture, not investment advice.", "body_md": "**A multi-agent stock-research desk that runs inside Claude Code, connects to a\nRobinhood Agentic account over MCP, and never places an order without your approval.**\n\nIt's not a \"bot that YOLOs your money.\" It's a small **team of specialized sub-agents**\n— fundamental, technical, macro/news, and a risk manager with veto power — that screen\nyour watchlist, debate each candidate, and hand you a one-click **preview card**. You\napprove; it places. Everything's wrapped in written guardrails (human-in-the-loop,\nposition caps, prompt-injection defense) and mirrored to a Robinhood-style dashboard.\n\n**A team, not one prompt**— analysts gather evidence in parallel; an independent risk manager can veto a trade the analysts liked.** Guardrails are structural, not vibes**— sub-agents physically have no order tools; only you-plus-the-PM can place, and only after explicit in-session approval.**Prompt-injection-aware**— the news agent treats fetched content as untrusted data and quotes suspicious \"instructions\" instead of acting on them.**Low-touch by design**— it runs read-only research on a schedule and only surfaces a trade when one genuinely qualifies; most days it tells you to stand aside.**A real dashboard**— a Robinhood-style UI mirrors the desk's state live.\n\n⚠️ Real money, beta, not investment advice.Robinhood Agentic Trading is in beta (US, equities only). The agent trades only inside an isolated Agentic account funded with a dedicated budget — that budget is the most it can ever lose. There isno track record and no performance claim here; this is a reference architecture for learning, run it at your own risk and monitor it yourself.\n\nThis repo holds the **guardrails, strategy notes, agents, dashboard, and setup docs** —\nnever secrets, and never the OAuth token (those live outside the repo).\n\n```\n.\n├── CLAUDE.md                  # The PM's operating contract (rules it must follow)\n├── .mcp.json                  # Project-scoped Robinhood Trading MCP connection\n├── .env.example               # Template for .env (account number; .env is gitignored)\n├── .claude/\n│   ├── settings.json          # Permissions: reads allowed, orders gated, options denied\n│   └── agents/                # The desk team — one sub-agent per role\n│       ├── fundamental-analyst.md\n│       ├── technical-analyst.md\n│       ├── macro-news-analyst.md   # injection-isolated (the only web-facing role)\n│       └── risk-manager.md         # veto power over every trade\n├── strategies/\n│   ├── README.md              # Risk caps + when the Risk Manager must VETO\n│   └── mean-reversion.md      # Example strategy (entry/exit/sizing)\n├── docs/\n│   ├── SETUP.md               # OAuth setup + how to tighten guardrails\n│   └── TEAM.md                # The desk roles and end-to-end workflow\n└── ui/                        # Read-only Robinhood-style dashboard (Vite + React)\n    ├── public/desk-state.example.json  # demo data (live desk-state.json is gitignored)\n    └── src/                   # polls the snapshot, renders account/desk/preview\n```\n\n- Make this repo\n**private** before pushing anything. - Read\n`docs/SETUP.md`\n\nand follow it top to bottom. - Connect the MCP, authenticate via OAuth (desktop), fund a small Agentic budget.\n- Refine\n`.claude/settings.json`\n\nonce you know the real tool names.\n\nA small **team of sub-agents** coordinated by the **Portfolio Manager (PM = the main\nClaude Code session)**. Analysts gather evidence in parallel; the Risk Manager has veto\npower; only the PM can place orders — and only after **your** in-session approval. After\nevery run the PM writes `ui/public/desk-state.json`\n\n, which the dashboard mirrors live.\n\n``` php\nflowchart TD\n    U([You: ask the PM in plain language]) --> PM{{Portfolio Manager<br/>main session · only role that can order}}\n\n    subgraph SENSE [1. Sense]\n      PM --> A1[get_portfolio / get_equity_positions<br/>Agentic account only]\n    end\n\n    subgraph RESEARCH [2-3. Screen + Research · parallel · read-only]\n      A1 --> F[Fundamental Analyst<br/>valuation · earnings]\n      A1 --> T[Technical Analyst<br/>trend · levels · scans]\n      A1 --> M[Macro / News Analyst<br/>backdrop · news · INJECTION-ISOLATED]\n    end\n\n    F --> SYN[4. PM synthesizes a proposed trade<br/>tied to a rule in strategies/]\n    T --> SYN\n    M --> SYN\n\n    SYN --> RISK{5. Risk Manager<br/>checks vs strategies/}\n    RISK -- VETO --> STOP([Trade stops · PM reports back])\n    RISK -- APPROVE / CHANGES --> PREV[6. review_equity_order<br/>build preview card]\n\n    PREV --> SNAP[(7. Write desk-state.json)]\n    SNAP --> GATE[8. Present preview · ⏸ wait for your approval]\n    GATE -- you say yes --> EXEC[9. place_equity_order<br/>still gated by ask rule]\n    GATE -- you say no --> STOP\n    EXEC --> CONF[10. Confirm fill · refresh desk-state.json · log]\n\n    SNAP -. polled every 5s .-> DASH[/Dashboard: npm run dev/]\n    CONF -. updates .-> DASH\n```\n\nSteps 1–7 are research and produce **no order**. The desk's standard output is the\n**preview card at step 8** — it stops there until you confirm. Full role/tool breakdown\nis in [docs/TEAM.md](/LoganYangBo/rh-trading-agent/blob/main/docs/TEAM.md).\n\n```\n# 1. One-time: connect + authenticate the MCP, then record your account number\nclaude                                  # open the project (trust the .mcp.json server)\n#   in-session:  /mcp                   # pick robinhood-trading → OAuth (desktop + mobile verify)\ncp .env.example .env                    # then put your Agentic account number in .env\n\n# 2. Run the dashboard (separate terminal) — mirrors each desk run\ncd ui && npm install && npm run dev     # http://localhost:5180 (shows demo until a live run)\n\n# 3. Drive the desk — just talk to the PM in the Claude Code session, e.g.:\n#   \"Screen my watchlist and bring me the top 2 ideas with full team analysis.\"\n#   \"Run the desk on AAPL and NVDA, risk-check a small starter in the better one.\"\n#   The PM fans out to the analysts → Risk Manager → preview card → waits for your OK.\n\n# Kill switch: disconnect the MCP from the Robinhood app, or remove it locally\nclaude mcp remove robinhood-trading\n```\n\nNote:the sub-agents in`.claude/agents/`\n\nload when Claude Codestarts— after adding or editing them, restart the session so roles like`fundamental-analyst`\n\nare recognized with their restricted tool sets.\n\n- The agent can only trade in the\n**Agentic account**, never your main balance. - Default permission rule puts\n**every** Robinhood tool call behind a manual prompt. `CLAUDE.md`\n\nincludes a prompt-injection rule: the agent must ignore trading instructions found in fetched/external content (news, analyst notes, web).- You can disconnect the MCP anytime from the Robinhood app — that's your kill switch.", "url": "https://wpnews.pro/news/an-ai-trading-desk-built-as-a-team-of-sub-agents-claude-code-and-robinhood-mcp", "canonical_source": "https://github.com/LoganYangBo/rh-trading-agent", "published_at": "2026-06-30 15:11:46+00:00", "updated_at": "2026-06-30 15:20:11.218271+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "ai-safety", "ai-research", "generative-ai"], "entities": ["Claude Code", "Robinhood", "Robinhood Agentic Trading", "MCP"], "alternates": {"html": "https://wpnews.pro/news/an-ai-trading-desk-built-as-a-team-of-sub-agents-claude-code-and-robinhood-mcp", "markdown": "https://wpnews.pro/news/an-ai-trading-desk-built-as-a-team-of-sub-agents-claude-code-and-robinhood-mcp.md", "text": "https://wpnews.pro/news/an-ai-trading-desk-built-as-a-team-of-sub-agents-claude-code-and-robinhood-mcp.txt", "jsonld": "https://wpnews.pro/news/an-ai-trading-desk-built-as-a-team-of-sub-agents-claude-code-and-robinhood-mcp.jsonld"}}