Skip to content

feat(mcp): agent mailbox tools behind FEATURE_AGENT_MAILBOX - #19

Merged
kantorcodes merged 1 commit into
masterfrom
feat/agent-network-tools
Oct 1, 2026
Merged

kantorcodes merged 1 commit into
masterfrom
feat/agent-network-tools

Conversation

@kantorcodes

Copy link
Copy Markdown
Member

Summary

  • Adds 12 hol.agent.* MCP tools wrapping the broker's /agent-* mailbox surface, registered only when FEATURE_AGENT_MAILBOX is set (default off).
  • Bot-plane tools (hol.agent.me, inbox.list, inbox.claim, inbox.ack, inbox.renewLease, send, reply, reject, message.get, conversation.get, conversation.cancel) take the bot's hol_agt_ grant bearer token per call as request-scoped identity. They never call withBrokerAuth — a shared hosted server cannot act with its operator's env credentials for arbitrary callers.
  • hol.agent.pairing.complete exchanges a short-lived pairing code for the durable grant token; the pairing code is the only credential and no auth header is sent.
  • idempotencyKey is required on send/reply and passed through unchanged; claim's leaseId/fencingToken must be echoed on ack/reply/reject, preserving server-side fencing.
  • FEATURE_AGENT_MAILBOX added to FeatureFlags; existing idempotencyKey passthrough on hol.chat.sendMessage/retry verified already present.

Test plan

  • npx vitest run — 13 files / 46 tests, including new agent-mailbox.test.ts (7 cases: tool surface, bearer-only auth with operator-key leak check, 204 claim, idempotency/fencing passthrough, unauthenticated pairing, upstream error mapping).
  • npx tsc --noEmit clean; eslint clean on changed files.
  • MCP Events subscription (protocol 2026-07-28) is not in the installed @modelcontextprotocol/sdk (latest negotiated 2025-11-25); deferred until SDK support lands.

Adds 12 hol.agent.* tools wrapping the broker's /agent-* mailbox
routes: pairing completion, runtime identity, inbox list/claim/ack/
lease-renew, send, reply, reject, message and conversation reads, and
conversation cancel.

Each bot-plane call takes the bot's hol_agt_ grant bearer per call as
request-scoped identity; the tools never use the server's env broker
credentials, so a shared hosted server cannot act as its operator.
Registered only when FEATURE_AGENT_MAILBOX is set.

Signed-off-by: Michael Kantor <6068672+kantorcodes@users.noreply.github.com>
@kantorcodes
kantorcodes merged commit c9a4e29 into master Oct 1, 2026
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant