ruflo/src/ruvocal/docs/adr/ADR-033-RUVECTOR-RUFLO-MCP-INTEGRATION.md
Status: Accepted Date: 2026-03-04 Context: chat-ui-mcp MCP Bridge
The MCP bridge initially shipped with 3 built-in tools (search, web_research, system_guide). Users want access to the full ruvector (10 tools) and ruflo (205+ tools) ecosystems from within the HF Chat UI without running separate MCP servers.
| Backend | Tools | Categories |
|---|---|---|
| ruvector | 10 | Intelligence (hooks_stats, hooks_route, hooks_remember, hooks_recall, hooks_init, hooks_pretrain, hooks_build_agents, hooks_verify, hooks_doctor, hooks_export) |
| ruflo | 205+ | Agent (7), Swarm (4), Memory (7), Config (6), Hooks (40+), Task (6), Session (5), Hive-mind (9), Workflow (9), Analyze (4), Progress (4), AIDefence (6), AgentDB (14+) |
Integrate ruvector and ruflo as stdio MCP child processes spawned by the bridge, with tool calls proxied through the existing /mcp HTTP endpoint.
┌─────────────────────────────────────────────────┐
│ HF Chat UI (browser) │
│ MCP_SERVERS: http://mcp-bridge:3001/mcp │
└─────────────────┬───────────────────────────────┘
│ JSON-RPC 2.0 over HTTP
▼
┌─────────────────────────────────────────────────┐
│ MCP Bridge (Express) │
│ │
│ ┌──────────────────┐ ┌─────────────────────┐ │
│ │ Built-in Tools │ │ StdioMcpClient │ │
│ │ • search │ │ ┌───────────────┐ │ │
│ │ • web_research │ │ │ ruvector (10) │ │ │
│ │ • system_guide │ │ └───────────────┘ │ │
│ └──────────────────┘ │ ┌───────────────┐ │ │
│ │ │ ruflo (205+) │ │ │
│ │ └───────────────┘ │ │
│ └─────────────────────┘ │
└─────────────────────────────────────────────────┘
▲ stdin/stdout (JSON-RPC) ▲
│ │
npx ruvector mcp start npx ruflo mcp start
Namespaced tool names: External tools are prefixed with {backend}__ (e.g., ruvector__hooks_route, ruflo__agent_spawn) to avoid name collisions with built-in tools.
Lazy startup: Backends initialize after Express starts listening, so the bridge is immediately available for health checks. If a backend fails to start, built-in tools still work.
Environment toggle: Each backend can be disabled via ENABLE_RUVECTOR=false or ENABLE_RUFLO=false for deployments that don't need all tools.
Graceful shutdown: SIGTERM/SIGINT handlers kill child processes cleanly.
Timeout protection: Each tool call has a 30s timeout. Backend initialization has a 15s timeout.
A reusable client class that:
tools/list on initializationtools/call request
→ name starts with "{backend}__"?
→ YES: strip prefix, route to StdioMcpClient.callTool()
→ NO: route to built-in executeTool()
# In docker-compose.yml or .env
ENABLE_RUVECTOR=true # default: true
ENABLE_RUFLO=true # default: true
/mcp endpoint — no client-side config changes needed