Cloud UB MCP
Benchmarked against: Anthropic — MCP connector / Remote MCP servers Deployment: Cloudflare Workers (TypeScript) Database: Cloudflare D1 (SQLite-compatible) Vector store: Cloudflare Vectorize Storage: Cloudflare R2 (backups)
The Cloud UB MCP server is the fleet's shared knowledge backbone. It runs as a Cloudflare Worker, providing all ships with access to the Universal Brain, Work Order system, Agent Messaging, and Fleet Operations through a single cloud endpoint.
Why cloud?
| Problem (before) | Solution (Cloud UB) |
|---|---|
| Each ship had its own local UB — knowledge fragmented | Single shared UB — all ships read/write the same data |
| SS2 agents couldn't access SS1 knowledge | Cloud endpoint accessible from any ship |
| No cross-ship messaging | Mailbox system in shared D1 database |
| WO data split across local databases | Centralized WO management |
| Backup complexity with multiple local DBs | R2 backup from single source |
Captain decision (2026-03-01): Cloud UB = the only UB. All ships unify on Cloud UB. Local UBs archived.
Architecture
Components
| Component | Technology | Purpose |
|---|---|---|
| Worker | Cloudflare Worker (TypeScript) | API endpoint, request routing, business logic |
| D1 | Cloudflare D1 (SQLite) | Primary database — entries, WOs, messages, agents |
| Vectorize | Cloudflare Vectorize | Vector embeddings for semantic search |
| R2 | Cloudflare R2 | Object storage for backups |
D1 database tables
| Table | Purpose | Key columns |
|---|---|---|
entries | UB knowledge entries | entry_id, title, content, category, tags, source_ship |
work_orders | Work order records | order_id, title, status, assignee, project |
wo_transitions | WO state transition history | order_id, old_status, new_status, changed_by |
agent_messages | Inter-agent mailbox | msg_id, from_agent, to_agent, subject, body |
agent_registry | Agent online/offline status | agent_id, ship, last_seen, current_task |
captain_status | Captain location and status | location, updated_by, updated_at |
Library system
UB entries use a library field for logical partitioning (per KM Library Spec):
| Library | Content type |
|---|---|
specs | Specifications and design documents |
decisions | Captain-approved decision records |
intel | Intelligence and research findings |
incidents | Work incidents and RCA reports |
sessions | Session records and handoffs |
sops | Standard operating procedures |
config | Configuration and scripts |
code | Source code documentation |
media | Media-related content |
trading | Trading-related knowledge |
archive | Archived/deprecated entries |
Tools exposed
The Cloud UB MCP server exposes ~20 tools:
Knowledge management
| Tool | Endpoint | Description |
|---|---|---|
search_brain | POST /brain/search | Hybrid search (FTS5 keyword + Vectorize semantic) |
ingest_fragment | POST /brain/ingest | Ingest text content into UB |
get_entry | GET /brain/entry/{id} | Retrieve entry by ID |
get_recent | GET /brain/recent | List recent entries |
get_stats | GET /brain/stats | UB statistics |
update_entry | PATCH /brain/entry/{id} | Update entry fields |
Work order management
| Tool | Endpoint | Description |
|---|---|---|
create_work_order | POST /wo/create | Create new WO |
list_work_orders | GET /wo/list | Query WOs with filters |
get_work_order_detail | GET /wo/{id} | Full WO details + history |
update_work_order_status | POST /wo/{id}/status | Status transition |
review_work_order | POST /wo/{id}/review | Captain approve/reject |
patch_wo_fields | PATCH /wo/{id} | Update WO fields (RBAC) |
Agent communication
| Tool | Endpoint | Description |
|---|---|---|
send_agent_message | POST /msg/send | Send message to agent mailbox |
check_agent_mailbox | GET /msg/inbox | Check mailbox |
mark_message | POST /msg/mark | Toggle read/unread |
archive_message | POST /msg/archive | Soft-delete message |
Fleet operations
| Tool | Endpoint | Description |
|---|---|---|
agent_heartbeat | POST /agent/heartbeat | Register agent online |
floor_status | GET /floor/status | Factory floor overview |
update_captain_location | POST /captain/location | Update Captain location |
sre_status | GET /sre/status | System health check |
cloud_ub_health | GET /health | Service health endpoint |
Hybrid search
The search_brain tool combines two search methods for best results:
| Method | How it works | Strength |
|---|---|---|
| FTS5 | SQLite full-text search on title + content + tags | Exact keyword matches, tag queries |
| Vectorize | Vector similarity using embeddings | Conceptual/semantic similarity |
| Hybrid | Merged and re-ranked by combined score | Best of both approaches |
Embeddings are generated by Cloudflare's built-in embedding model and stored in Vectorize indexes.
Authentication
The Cloud UB Worker authenticates requests using:
| Method | Purpose |
|---|---|
| API token | Bearer token in Authorization header |
| Ship ID | SP_SHIP_ID header — identifies source ship |
| Agent ID | SP_AGENT_ID header — identifies agent identity |
All entries are automatically tagged with source_ship and ss_agent_id for governance tracking.
WO system v4.0
The Cloud UB implements the full WO v4.0 specification:
- State machine with 8 states and enforced transitions
- Transition gates requiring specific fields (e.g.,
completion_summary+actual_hoursfor review submission) - RBAC — Captain-only actions (approve/reject/cancel), PM actions, assignee actions
- Transition history — full audit trail of every status change
See Work Order API and WO Status Transitions for complete documentation.
Related pages
| Page | Relationship |
|---|---|
| Local UBI MCP | Ship-local complement to Cloud UB |
| MCP Servers Overview | All servers in the fleet |
| UB Governance | Rules governing UB operations |
| Work Order API | WO tool reference |
| Data Residency | Where data lives and backup strategy |