Repository navigation
feat(mcp): agent mailbox tools behind FEATURE_AGENT_MAILBOX - #19
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
hol.agent.*MCP tools wrapping the broker's/agent-*mailbox surface, registered only whenFEATURE_AGENT_MAILBOXis set (default off).hol.agent.me,inbox.list,inbox.claim,inbox.ack,inbox.renewLease,send,reply,reject,message.get,conversation.get,conversation.cancel) take the bot'shol_agt_grant bearer token per call as request-scoped identity. They never callwithBrokerAuth— a shared hosted server cannot act with its operator's env credentials for arbitrary callers.hol.agent.pairing.completeexchanges a short-lived pairing code for the durable grant token; the pairing code is the only credential and no auth header is sent.idempotencyKeyis required onsend/replyand passed through unchanged; claim'sleaseId/fencingTokenmust be echoed on ack/reply/reject, preserving server-side fencing.FEATURE_AGENT_MAILBOXadded toFeatureFlags; existingidempotencyKeypassthrough onhol.chat.sendMessage/retryverified already present.Test plan
npx vitest run— 13 files / 46 tests, including newagent-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 --noEmitclean; eslint clean on changed files.@modelcontextprotocol/sdk(latest negotiated2025-11-25); deferred until SDK support lands.