Skip to main content
Glama
chipherndon

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: qmailing MCP server

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 → inboxsend 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

Maintenance

ActivityMaintained
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/chipherndon/grok-bot-mcp-connector'

If you have feedback or need assistance with the MCP directory API, please join our Discord server