Skip to main content

DeerFlow Integration

Connect DeerFlow research agents to b1e55ed’s MCP tool surface. DeerFlow orchestrates multi-step research workflows; b1e55ed provides regime awareness, signal provenance, and position context.

Prerequisites

  • Python 3.11+
  • b1e55ed running (python -m b1e55ed.server or deployed instance)
  • DeerFlow installed (setup guide)

Quick Start — Direct Mode

Direct mode runs b1e55ed’s MCP server as a DeerFlow subprocess.
# 1. Install b1e55ed
pip install -e .

# 2. Copy the DeerFlow extension config
cp integrations/deerflow/extensions_config.json \
   $DEERFLOW_HOME/extensions/b1e55ed.json

# 3. Start DeerFlow — it spawns b1e55ed MCP automatically
deerflow start
DeerFlow will launch python -m b1e55ed.mcp and discover all available tools via the MCP tools/list handshake.

Gateway Mode

For teams or remote deployments, run the b1e55ed MCP Gateway and point DeerFlow at it over HTTP.
# 1. Start the gateway
cd gateway
pip install -r requirements.txt
# Edit config.yaml — set b1e55ed_url, generate API keys
uvicorn gateway.main:app --host 0.0.0.0 --port 7338

# 2. Configure DeerFlow
export B1E55ED_API_KEY="analyst-key-change-me"
# Use the "gateway" mode from extensions_config.json
The gateway adds role-based access control, audit logging, and a signal approval workflow. See gateway/README.md for details.

Available MCP Tools

ToolDescriptionMin Role
get_brain_statusCurrent brain state, regime, and confidenceanalyst
get_recent_signalsLatest signals with optional filtersanalyst
get_regime_statusActive regime with transition historyanalyst
get_top_signalsHighest-conviction signals by scoreanalyst
get_regime_historyHistorical regime transitionsanalyst
get_signals_bulk_exportBulk signal export (CSV/JSON)analyst
get_open_positionsCurrent open positions with PnLpm
get_signal_attributionKarma attribution for a signalpm
b1e55ed_provenance_checkVerify signal provenance chainrisk
submit_research_signalSubmit a new research signal (queued if non-admin)admin*
emit_producer_signalEmit a raw producer signaladmin
*Non-admin roles can call submit_research_signal through the gateway, but it queues for admin approval instead of forwarding directly.

Skill Pack

DeerFlow’s skill system can import b1e55ed tools as a skill pack. The extension config at integrations/deerflow/extensions_config.json exposes both direct and gateway modes. A typical DeerFlow research workflow:
  1. Scoutget_regime_status to understand market context
  2. Gatherget_recent_signals + get_top_signals for current alpha
  3. Verifyb1e55ed_provenance_check on interesting signals
  4. Report — DeerFlow synthesises findings with regime context

Signal Provenance

Every signal in b1e55ed carries a provenance chain. DeerFlow agents should call b1e55ed_provenance_check before acting on any signal to verify:
  • Producer identity and registration status
  • Karma score of the originating producer
  • Chain of custody from raw data to synthesised signal
This prevents DeerFlow from acting on unverified or low-quality signals.

MCP Protocol

b1e55ed speaks JSON-RPC 2.0 over the MCP transport:
{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "get_regime_status",
    "arguments": {}
  },
  "id": 1
}
POST to /mcp/call (direct or gateway).

Troubleshooting

DeerFlow can’t discover tools

  • Direct mode: Ensure python -m b1e55ed.mcp runs without errors. Check that the database exists at the configured B1E55ED_DB path.
  • Gateway mode: Verify the gateway is running (curl http://localhost:7338/health).

401 Unauthorized

  • Check X-API-Key header matches a key in gateway/config.yaml.

Tool call returns “Role X cannot call Y”

  • The user’s role doesn’t include that tool. See the role table above or ask an admin to upgrade the key’s role in config.yaml.

Signal queued instead of executed

  • Non-admin submit_research_signal calls are queued by design. An admin must approve via POST /approve/{signal_id}.

Gateway health shows b1e55ed unreachable

  • Check b1e55ed_url in config.yaml points to the running instance.
  • If using a token, verify b1e55ed_token is correct.

Audit log location

  • All requests are logged to gateway/data/audit.jsonl.
  • Each entry includes timestamp, user, tool, redacted params, and status.