기술 블로그

← 모든 글

· XingAI Invest AI

MCP Phased Rollout: From Dashboard to Autonomous Trading

UI는 한국어입니다. 글 본문은 아직 영어 또는 중국어만 있습니다.

The Temptation of Building Everything at Once

When you design an AI investment platform, the dream architecture looks like this:

Five MCP servers, full data coverage, automated execution. Ship it.

Don't.

Building all five at once is a trap. Each server has different risk profiles, different data source challenges, and different regulatory implications. The Broker MCP alone could sink the project if you get it wrong.

The Phased Approach

We're rolling out MCP servers in order of value delivered vs risk introduced:

Phase 1: Wrap What You Already Have

Financial MCP and News MCP don't introduce new risk — they wrap existing data sources (yfinance, Finnhub) behind a standard MCP interface.

Why bother wrapping? Two reasons:

  1. Swappable providers. When yfinance breaks (it will), swapping to Polygon or Alpha Vantage is a server config change, not a code rewrite.
  2. AI-native access. MCP tools can be called directly by Gemini/OpenAI via function calling. The AI can ask for data it needs instead of receiving a fixed bundle.

Risk: Low. If the MCP server crashes, fall back to direct API calls. No user data involved.

Phase 2: Add Context the AI Actually Needs

Calendar MCP gives the AI temporal awareness. "AAPL earnings in 2 days" changes a HOLD into a "wait for the event." "FOMC tomorrow" changes risk calculations. Without calendar context, the AI is blind to scheduled catalysts.

Portfolio MCP (read-only) gives the AI position awareness. "You already have 30% in tech" prevents the AI from recommending more AAPL. This requires connecting to a broker API for read access, which introduces:

  • Credential management (secure storage of broker API keys)
  • Data privacy (user holdings are sensitive)
  • Sync reliability (partial fills, corporate actions, dividends)

We explicitly limit Phase 2 Portfolio MCP to read-only. No orders, no modifications. Just "tell me what I hold."

Risk: Medium. User financial data requires proper security, but no money moves.

Phase 3: The Dangerous Part

Broker MCP is where real money enters the system. An AI bug doesn't just show wrong data — it loses real dollars.

We're breaking Phase 3 into four sub-stages:

Stage A: Just Log It (No Broker Connection)

The system logs every decision it would make: "BUY NVDA, 50 shares, confidence 78%." No broker connection. We track hypothetical P&L against actual market prices.

Goal: Build a track record. If the AI's decisions would have lost money over 2 months, we know before anyone's account is affected.

Stage B: Paper Trading (Simulated Fills)

Connect to Alpaca's paper trading API. Real market data, simulated fills, zero risk. This catches execution bugs: did the order actually submit? Did the fill price make sense? Did the position sizing calculate correctly?

Goal: Validate the full pipeline end-to-end without real money.

Stage C: Live with User Confirmation

Real orders through a real broker, but every trade requires explicit user approval:

  1. AI produces a decision with rationale
  2. User sees the recommendation in the dashboard
  3. User clicks "Execute" or dismisses
  4. Order submitted only after confirmation

Goal: Real execution with human oversight. The AI suggests, the human decides.

Stage D: Autonomous (Maybe Never)

Fully automated execution within guardrails. This stage may never ship — many users prefer the confirmation model. If it does, it requires:

  • Per-trade position limit (max 5% of portfolio)
  • Daily loss limit (-2% triggers shutdown)
  • Trade frequency cap (max 10/day)
  • Kill switch in the Monitor UI
  • No margin trading
  • Market hours only

Why Alpaca First

BrokerWhy / Why not
AlpacaClean REST API, free paper trading, no account minimum, excellent docs. Best for starting.
Interactive BrokersPowerful but complex API. Global markets. Better for advanced users.
Schwab/TDLargest US retail base, but API is in transition post-merger. Wait for stability.

Start with Alpaca for paper trading and initial live execution. Add IBKR as a second option for power users.

The Non-Negotiable Safety Checklist

Before any live trade:

  • 3+ months of logged decision accuracy data
  • Paper trading validates order submission and fill handling
  • Per-trade position limit enforced server-side (not just UI)
  • Daily loss limit with automatic shutdown
  • Complete audit log (every decision, order, fill, cancellation)
  • Kill switch accessible from Monitor UI
  • No margin trading enabled
  • User confirmation required for every trade (Stage C)

Timeline

PhaseStartDurationPrerequisite
Phase 1 (Financial + News MCP)With V2~2 weeksV2 pipeline working
Phase 2 (Calendar + Portfolio MCP)V2 + 1 month~3 weeksPhase 1 stable
Phase 3A (Decision logging)V2 + 2 months1–2 monthsPhase 2 stable
Phase 3B (Paper trading)V2 + 4 months1–2 months3A shows positive returns
Phase 3C (Live + confirmation)V2 + 6 monthsOngoing3B validates execution
Phase 3D (Autonomous)TBDTBD3C proves reliable over months

Full technical details in ADR-003: MCP Phased Rollout.