feat(mother): MCP infra — hive_nodes registry, hardened wrapper/builder, idempotent setup #161
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feature/mother-mcp-infra"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Mother-node MCP infrastructure, with a review/hardening pass on top of the initial draft.
Adds
mother_schema.sqlupdates,node-register-mcp,setup-mother.sh,colibri-mcp-ssh,build-colibri.sh,MOTHER-SETUP.md— all underpackaging/mother/(committed + idempotent, deployed viasetup-mother.sh, not hand-authored on osa).Review pass (this branch's hardening)
usb_nodes→hive_nodes+node_typecolumn. A node is any host that joined the hive (live-usb/disk/vps/mother), not only a USB boot.node_type TEXT(live-usb|disk|vps|mother|unknown) is first-class. The schema migrates an existing osa DB in place —ALTER TABLE/ALTER SEQUENCEguarded byto_regclass, plusADD COLUMN IF NOT EXISTS— data preserved, fully idempotent; FKs/trigger/indexes follow.node-register-mcp: safepsql -v+:'var'UPSERT intohive_nodes, validatednode_type. AddedON_ERROR_STOP=1(psql otherwise exits 0 on a SQL error → false success) and folds stderr into the result so failures are reported.colibri-mcp-ssh: forced-command wrapper now allowlists (""→ stdio MCP,"tools"→ discovery, else reject) and quotes safely.build-colibri.sh: branch allowlist (main + semver tags + env override) closes the arbitrary-branchbuild.rsRCE;featuresregex + positional-array cargo args close flag injection; now fast-forwards a branch checkout to origin so it builds current code.setup-mother.sh: apply schema before granting on its tables (fresh installs failed otherwise); pipe the schema via stdin (postgres needn't read the repo checkout); locatepg_hbaviaSHOW hba_file(was hardcoded) and prepend the peer rule (pg_hba is first-match); grants targethive_nodes.Validation
prettier +
sh -ngreen here. Schema migration/UPSERT and the SSH/MCP path to be exercised on osa (no local postgres server in this env). Build colibri 0.12 on FreeBSD from currentmainbefore installing (binaries built earlier were Linux).Companion (separate, clawdie-iso)
4 iso docs still say
mother_hive.usb_nodes(SETUP-USB-TO-MOTHER.md,USB-MOTHER-MCP-CONNECTION.md,DOME-GEOMETRY-CAPABILITY.md) — small follow-up PR to align them tohive_nodes.🤖 Generated with Claude Code
Consolidates mother MCP infrastructure into packaging/mother/: - setup-mother.sh: idempotent deploy script (binaries, MCP tools, SSH keys, PostgreSQL peer auth, jq-merge external-mcp.json, daemon env update) - node-register-mcp: UPSERT hw-probe JSON into mother_hive.usb_nodes using psql -v :variable heredoc (bound parameter, no SQL interpolation) - colibri-mcp-ssh: SSH forced-command wrapper with allowlist (only "" → stdio MCP mode, "tools" → discovery; everything else rejected) - build-colibri.sh: branch-allowlisted builder (main + semver tags + COLIBRI_BUILD_ALLOW_BRANCHES), features validated, array-quoted cargo args - MOTHER-SETUP.md: architecture document with security properties Security fixes vs. the clawdie-iso versions: - node-register-mcp: was E${ESCAPED} (vulnerable to E backslash interpretation); now psql -v :variable in a heredoc - colibri-mcp-ssh: was unquoted ${SSH_ORIGINAL_COMMAND} passthrough; now case-match allowlist - build-colibri.sh: was arbitrary git checkout + unquoted cargo flags; now branch allowlist + features validation + array args - USB spawn args: no trailing "colibri-mcp" remote command; forced-command wrapper handles empty command - Key management: one key per trust domain (mother-mcp != Forgejo); key lives on seed partition, not baked into image