hyperhive/hive-agent-mcp
Repository files (latest commit first)
Filename Latest commit message Latest commit date
atlas 7bb68fe819 c0re: guard the agent-creation path every hive actually uses
The reserved-name check landed only in `swarm-controller::create_agent`.
That daemon is opt-in and off on most hives, so the ordinary per-hive
flow -- `request_init_config` -> `handle_request_init_config` ->
`require_new_child` -> `submit_init_config` -- stayed exactly as
unguarded as before: an agent named `operator`, `forge` or `system` was
still creatable through the path every hive uses, with no warning.

Caught in review by argus. The issue named `create_agent` as the
existing shape to copy, so the shape got copied and the question of
which OTHER sites create an agent never got asked -- an issue naming one
call site is describing an exemplar, not an inventory.

Same treatment as the other path: warn, do not refuse.

The warning needs somewhere to go. `Response` had `Ok` (carries nothing)
and `Err` (refuses), so a check that warns had no way to reach its
caller. Adds `Response::OkWarn { warnings }` -- additive, every existing
`Ok` site is untouched -- rendered by `format_ack` *after* the success
line rather than instead of it: the approval really was queued, and a
warning shown as a failure invites a retry that queues a second one.

Mutation-verified: dropping the warnings and unconditionally appending a
marker each turn a different test red.
2026-08-27 16:36:42 +02:00
..
src c0re: guard the agent-creation path every hive actually uses 2026-08-27 16:36:42 +02:00
Cargo.toml refactor(sock): one socket client, retry as a policy value 2026-07-26 22:44:48 +02:00
README.md remove hive-agent-wake — no shipped consumer 2026-07-25 20:05:32 +02:00

hive-agent-mcp

The built-in hyperhive MCP server every agent gets by default. Runs a long-lived streamable-http listener (the hive-mcp-http systemd unit) that claude reconnects to each turn via --mcp-config — this avoids the per-turn stdio re-registration race that a spawned-per-turn server would hit. HTTP is the sole transport; there is no stdio mode here.

When to use it

This is where the core hyperhive tool surface lives: send, recv, ask/answer, remind, get_loose_ends, set_status, get_agent_meta, lifecycle (kill/start/restart/update on direct children), scheduling, and the approval-request tools. Reach for this crate when you're adding or changing a built-in tool rather than an extraMcpServers add-on — those are separate stdio bridges (see hive-bash-mcp, hive-matrix-mcp) that dial the harness socket or their own daemon instead of living here.

Shape

  • mcp/ — the tool surface itself: one handler per tool, dispatch through client.rs back into the hyperhive broker (/run/hive/mcp.sock) or, for loose-ends v2 (todos/reminders), the in-agent socket the hive-agent harness serves.
  • client.rs — socket client to the hyperhive broker.
  • send_allow.rs — enforces the per-agent hyperhive.allowedRecipients allow-list on send/ask.
  • paths.rs — socket + state path resolution shared with the harness's own paths.rs conventions.

Sibling of hive-agent (the serve loop that renders the --mcp-config blob pointing here). Standalone bin crate so the always-on MCP server doesn't need to link the whole turn-loop lib.