Skip to main content

Local UBI MCP

Benchmarked against: Anthropic — MCP connector (local) Deployment: stdio MCP server (Python) Location: Per-ship — runs locally on SS1, SS2 Codebase: ub/ directory

The Local UBI (Universal Brain Infrastructure) MCP server is the ship-local powerhouse. It runs as a Python stdio process alongside the AI agent, providing access to the local filesystem, dispatch engine, intelligence operations, and a local mirror of UB data. While Cloud UB handles shared fleet data, Local UBI handles everything that requires local system access.


Why local?

CapabilityWhy it needs local access
File operationsRead/write/edit files on the ship's filesystem
Code searchGrep through local codebases
Shell commandsExecute sandboxed commands on the ship
Dispatch engineSpawn background processes for WO execution
MTAAA pipelineRun the 5-node classification pipeline (requires local Python + models)
Intel operationsCall external APIs (Groq, Gemini, DeepSeek) for research
Local UB mirrorFast local search when Cloud UB is unnecessary

Architecture

Components

ComponentTechnologyPurpose
MCP ServerPython stdioTool registration and request handling
Local SQLiteSQLite + FTS5Local UB data (mirror/staging)
Local QdrantQdrant vector DBLocal semantic search
MTAAA PipelineLangGraph (Python)Content classification pipeline
Dispatch WorkerPython subprocessBackground WO execution
LLM ClientsGroq/Gemini/DeepSeek/Mistral/Zhipu SDKsLow-cost model access

Tools exposed (~30 tools)

Knowledge management

ToolDescription
search_brainHybrid search (local Qdrant + FTS5)
search_by_categoryBrowse entries by category
ingest_fragmentFull MTAAA 5-node pipeline ingestion
get_entryRetrieve entry by ID
get_recentList recent entries
get_statsUB statistics

Work order management

ToolDescription
create_work_orderCreate new WO (writes to Cloud UB)
list_work_orders_toolQuery WOs with filters
get_work_order_detailFull WO details + transition history
accept_work_orderAccept a pending WO
update_work_order_statusStatus transition
complete_work_orderSubmit for review with summary
verify_work_orderCaptain approve/reject
get_work_order_formGet blank WO form template

Dispatch engine

ToolDescription
dispatch_work_orderTrigger WO execution via selected engine
check_dispatchCheck dispatch center for pending WOs and results

Dispatch engines available:

EngineCostBest for
ingestFreeBatch file ingestion into UB
groqFreeResearch, analysis, simple tasks
groq-searchFreeWeb search with Groq Compound
gemini~$0.014General tasks, quality-sensitive
gemini-search~$0.014Authoritative search with citations
deepseekCentsAnalysis, reasoning tasks
mistralCentsEuropean model, alternative
zhipuCentsChinese NLP, agent tool-calling
claude~$1–2/runCode editing, file operations

Intelligence operations

ToolDescription
intel_searchSearch any topic, auto-ingest findings to UB
search_webWeb search via Groq/Gemini engines
run_patrolTrigger Intelligence Officer patrol
list_patrol_domainsList configured patrol domains
call_modelCall low-cost LLM for subtasks
list_modelsList available LLM providers and models

Agent communication

ToolDescription
send_agent_messageSend message to agent mailbox
check_agent_mailboxCheck mailbox
mark_messageToggle read/unread
archive_messageSoft-delete message
agent_heartbeatRegister agent as online

File operations

ToolDescription
ubi_read_fileRead file with line numbers
ubi_write_fileWrite file (auto .bak backup)
ubi_edit_fileExact string replacement
ubi_list_directoryList directory contents
ubi_run_commandSandboxed shell execution
ubi_search_codeGrep/rg code search

Fleet operations

ToolDescription
factory_floor_statusWho's doing what — real-time overview
update_captain_locationUpdate Captain's location

MTAAA integration

The Local UBI is the only server that runs the full MTAAA pipeline. When ingest_fragment is called:

The pipeline:

  1. File Detector — identifies input type (text/code/config/media/screenshot)
  2. Content Extractor — extracts content and metadata
  3. Feature Learner — identifies key entities, topics, themes
  4. Schema Matcher — maps to 3D classification (Topic × Type × Lifecycle) using Controlled Vocabulary
  5. Archivist — writes to UB with proper tags and metadata

Cloud UB's ingest_fragment does a simpler direct ingestion without the full pipeline.


Environment variables

VariablePurposeExample
SP_SHIP_IDShip identifierSS1
SP_AGENT_IDAgent identityMac CLI 小克
GROQ_API_KEYGroq API accessgsk_...
GEMINI_API_KEYGemini API accessAIza...
DEEPSEEK_API_KEYDeepSeek API accesssk-...
MISTRAL_API_KEYMistral API access...
ZHIPU_API_KEYZhipu GLM access...
CLOUD_UB_URLCloud UB endpointhttps://cloud-ub.superportia.workers.dev
CLOUD_UB_TOKENCloud UB auth token...

Local vs Cloud UB — when to use which

ScenarioUse
Cross-ship data (WOs, messages, shared knowledge)Cloud UB
File operations on this shipLocal UBI
MTAAA pipeline ingestionLocal UBI
Dispatch engine executionLocal UBI
Intel search / web searchLocal UBI (has API keys)
Quick knowledge searchEither (local is faster for cached data)
Agent heartbeat / floor statusEither (both proxy to Cloud)

PageRelationship
Cloud UB MCPCloud complement to Local UBI
MCP Servers OverviewAll servers in the fleet
File Ingestion (MTAAA)MTAAA pipeline details
MCP Tools OverviewComplete tool catalog
Run CommandShell execution security model