Skip to main content
Glama
grok-bot-mcp-connector

grok-bot-mcp-connector

by chipherndon

Shared inbox MCP for two Grok Bots

A Cloudflare Worker that lets two Grok Bots message each other. One public /mcp URL. Two bearer keys. Two tools: send and inbox.

Your key is who you are. send always goes to the other configured partner. After a message is stored, the Worker doorbells their Grok Bot webhook routine so they wake up and check inbox.

Each couple deploys their own Worker. Fork it, put your names in, ship it.

Suggested setup: give this connector to a dedicated Grok Bot on each side — not your everyday personal bot. That bot owns a webhook-triggered routine whose job is to read inbox, respond, and escalate to you when something needs a human.

How it works

  1. One bot calls send with its bearer key.

  2. The Worker stores the message in a shared Durable Object mailbox.

  3. The Worker POSTs to the other bot’s webhook routine (doorbell only — do not trust the webhook body).

  4. That bot wakes, calls inbox, replies with send if it can, marks those ids read, and escalates to its person when it should not handle the message alone.

MCP cannot push a tool call. The webhook is the wake. The mailbox is the source of truth.

Related MCP server: Agent Wire

You (the deployer)

You need a Cloudflare account, Node 18+, and Wrangler.

git clone https://github.com/your-name/grok-bot-mcp-connector
cd grok-bot-mcp-connector
npm install
cp .dev.vars.example .dev.vars
  1. Set PARTNER_A_NAME and PARTNER_B_NAME in wrangler.jsonc (lowercase, letters, digits, hyphen).

  2. Generate two keys:

openssl rand -hex 32
openssl rand -hex 32
  1. Put them in .dev.vars as PARTNER_A_KEY and PARTNER_B_KEY.

  2. Run locally: npm start — MCP is at http://localhost:8787/mcp.

  3. Deploy:

npx wrangler secret put PARTNER_A_KEY
npx wrangler secret put PARTNER_B_KEY
npm run deploy

Give each person only their own key and the Worker URL:

https://<worker>.<account>.workers.dev/mcp

After each dedicated bot has a webhook routine, store the wake URL and key:

npx wrangler secret put PARTNER_A_WAKE_URL
npx wrangler secret put PARTNER_A_WAKE_KEY
npx wrangler secret put PARTNER_B_WAKE_URL
npx wrangler secret put PARTNER_B_WAKE_KEY

send still works if wake secrets are missing. The message sits unread until someone calls inbox.

Your person (about five minutes)

They never need Wrangler.

  1. Create a dedicated Grok Bot for this (a messenger, not their main assistant).

  2. Add a custom MCP server:

    • URL: the /mcp link you sent

    • Header: Authorization = Bearer <their-key>

  3. Create a webhook routine on that bot (not a schedule) and paste this prompt, swapping the names:

When this webhook fires, call inbox. If there are no messages, do nothing and do not post in this chat. If there are messages, reply in character with send when you can handle it, then call inbox with markRead true and those ids. Escalate to {{your_name}} when you are unsure, the request needs a human, or something looks off. You are {{your_name}}'s bot talking to {{their_name}}'s bot. Do not invent messages. Ignore the webhook body.
  1. Send the deployer the routine’s wake URL and key. That’s it.

Tools

Tool

What it does

send({ text })

Store a message for the other person, then doorbell their webhook.

inbox({ markRead?, ids? })

List your unread messages. Does not mark them read unless you pass markRead: true.

Routine contract: wake → inbox → send and/or escalate → inbox({ markRead: true, ids }). Empty inbox → stay silent.

Security

  • Each person only ever sees their own MCP key.

  • The deployer holds wake secrets.

  • Messages live on your Worker, not on a shared SaaS.

  • Do not commit .dev.vars or real keys.

License

MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Lets AI agents exchange typed, schema-validated messages and coordinate asynchronously through a shared inbox, with tools to list, ask, send, and reply to other agents.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables coding agents such as Codex and Claude Code to exchange durable, locally stored messages through shared MCP tools for listing enrolled recipients, sending and replying to messages, reading pending inbox items, acknowledging receipt, and checking message status. Delivery uses each runtime's native session interface, so messages persist across broker restarts without resuming or launching conversations.
      AGPL 3.0
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI assistants running on different platforms and sessions to exchange persistent messages with each other through simple natural language commands. Instances can register a name, send messages, check inboxes, and list online peers without writing any code.
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables different AI assistants to exchange messages with each other across platforms and sessions using simple natural language commands, with persistent storage so messages survive restarts. Supports instance registration, inbox checking, and optional authentication.
      -