Skip to content

Instantly share code, notes, and snippets.

@jleechan2015
Created March 27, 2026 08:05
Show Gist options
  • Select an option

  • Save jleechan2015/16a709aabe42b7f71289ce243c130333 to your computer and use it in GitHub Desktop.

Select an option

Save jleechan2015/16a709aabe42b7f71289ce243c130333 to your computer and use it in GitHub Desktop.
MCP Agent Mail — AO Worker Global Inbox Proof: heartbeat + session start/end messages flowing into global:jleechanclaw

MCP Agent Mail — AO Worker Global Inbox Proof

Test date: 2026-03-27 MCP server: http://127.0.0.1:8765/mcp/ Project key: jleechanclaw Agent: jc938prtest

Workflow

  1. register_agent(project_key="jleechanclaw", agent_name="jc938prtest", program="agent-orchestrator", model="claude")

    • Response: agent registered with slug jc938prtest
  2. send_message(...) — worker heartbeat → global:jleechanclaw

  3. send_message(...) — session start → global:jleechanclaw

  4. send_message(...) — session end → global:jleechanclaw

  5. fetch_inbox(project_key="jleechanclaw", agent_name="jc938prtest", limit=20, include_bodies=true)

    • Returns all 3 messages from global inbox

fetch_inbox result

{
  "result": [
    {
      "id": 11,
      "project_id": 1,
      "sender_id": 11,
      "thread_id": null,
      "subject": "session end — jc938prtest",
      "importance": "normal",
      "ack_required": false,
      "created_ts": "2026-03-27T08:01:45.892824+00:00",
      "attachments": [],
      "body_md": "Done with: Fix mcp-mail plugin tests",
      "from": "jc938prtest",
      "kind": "cc",
      "source": "global_inbox_mention"
    },
    {
      "id": 10,
      "project_id": 1,
      "sender_id": 11,
      "thread_id": null,
      "subject": "session start — jc938prtest",
      "importance": "normal",
      "ack_required": false,
      "created_ts": "2026-03-27T08:01:45.601645+00:00",
      "attachments": [],
      "body_md": "Starting task: Fix mcp-mail plugin tests",
      "from": "jc938prtest",
      "kind": "cc",
      "source": "global_inbox_mention"
    },
    {
      "id": 9,
      "project_id": 1,
      "sender_id": 11,
      "thread_id": null,
      "subject": "worker heartbeat — jc938prtest",
      "importance": "normal",
      "ack_required": false,
      "created_ts": "2026-03-27T08:01:35.355123+00:00",
      "attachments": [],
      "body_md": "I'm alive — heartbeat",
      "from": "jc938prtest",
      "kind": "cc",
      "source": "global_inbox_mention"
    }
  ]
}

Key observations

  • All 3 message types arrive in global inbox: worker heartbeat, session start, session end
  • source: "global_inbox_mention" confirms messages route through global:jleechanclaw routing
  • Agent name slugified by server: jc938-pr-testjc938prtest (registered), messages sent as jc938prtest
  • RPC format uses tools/call with params.name and params.arguments per MCP spec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment