MCP server for Enclave-based agent coordination — leader/worker hive runtime
- Shell 100%
| src/apiary | Normalize literal backslash-n to a real newline in outbound messages | |
| test | Normalize literal backslash-n to a real newline in outbound messages | |
| .gitignore | Initial scaffold: apiary v0.1.0 | |
| CHANGELOG.md | v0.1.7: bump version, add CHANGELOG, extend smoke harness | |
| CLAUDE.md | Initial scaffold: apiary v0.1.0 | |
| dev-redirects.sgl | Bump to sigil ^0.17, sigil-socket ^0.17; add dev-redirects.sgl | |
| LICENSE | Initial scaffold: apiary v0.1.0 | |
| package.sgl | Bump to v0.17.2 — literal backslash-n newline fix | |
| README.md | Initial scaffold: apiary v0.1.0 | |
| sigil.lock | Repoint sigil-test dev-deps to reintegrated monorepo | |
Apiary
MCP server for Enclave-based agent coordination, built with Sigil.
Apiary participates in an Enclave IRC channel as a bot, coordinating a hive of agent worker sessions. One binary serves both leader mode (spawns workers, dispatches directives, owns DM channel to the human) and worker mode (executes assigned tasks, reports status, listens for instructions). Mode is selected by the APIARY_MODE env var; voicing is delegated to Enclave group membership.
Architecture
- Connects to an Enclave server as a bot via SASL.
- Joins a coordination channel.
- Filters incoming channel messages through a trusted set (owner + reports-to + subordinates + dynamically-listened peers). Messages from outside the trusted set are dropped to keep agent context clean.
- Forwards trusted messages to the running Claude session via MCP
channel-notify!events, rewritten in<sender>: <body>format. - Provides MCP tools for posting to channel, sending DMs (leader-only), spawning/revoking workers (leader-only), and managing the trusted set.
Configuration
Env vars (.env-apiary recommended):
APIARY_ENCLAVE_HOST=<enclave-host>
APIARY_ENCLAVE_PORT=6697
APIARY_ENCLAVE_TLS=yes
APIARY_USER=<bot-nick>
APIARY_TOKEN=<sasl-token>
APIARY_CHANNEL=#<coordination-channel>
APIARY_MODE=leader # or 'worker'
APIARY_OWNER_NICK=<owner-nick>
APIARY_REPORTS_TO=<superior-nick> # defaults to APIARY_OWNER_NICK
APIARY_LEADER_GROUP=<leader-group> # Enclave group name granting +v
APIARY_WORKER_GROUP=<worker-group> # Enclave group name for non-voiced workers
Mention syntax
Channel mentions use a strict @<nick>: <body> prefix:
@worker-1: please proceed with the analysis.
@leader: blocked — need policy decision.
Anything not matching @<nick>: is treated as a broadcast.
License
BSD-3-Clause.