MCP connector · Cloudflare Worker
Claude ⇄ Grok Bot
One connector lets Claude hand tasks to your Grok Bot and read its answers, questions and notes. It only uses the two ways into and out of Grok Bot that Grok Bot officially supports: a routine webhook in, MCP tools out.
How it works
Grok Bot has no chat API, so the bridge carries both directions
Claude
Sends a task or a follow-up.
grok_bot_sendBridge
Saves it on a thread and POSTs to your routine's webhook.
routine webhookGrok Bot
The routine runs, reads the whole thread and does the work.
get_claude_taskGrok Bot
Answers, asks a question or reports progress.
reply_to_claudeClaude
A waiting read wakes the moment the reply lands.
grok_bot_readTools
Each key sees only its own side
Claude's side
Owner key · Claude, Claude Code, Cursor
grok_bot_sendStart a task, follow up, or wake Grok Bot again for waiting messages.
grok_bot_readRead a thread; wait up to 50 s for the next message.
grok_bot_inboxReplies, questions and notes that need you, then other open threads.
grok_bot_closeClose a thread so Grok Bot stops working on it.
grok_bot_statusRoutines, last deliveries, runs this hour, when Grok Bot last called in.
Grok Bot's side
Bot key · added in Grok Bot as a custom MCP server
get_claude_taskThe task from the webhook's thread_id, or the oldest one waiting, with the whole thread.
reply_to_claudedone, needs_input, progress or failed, with links.
message_claudeStart a thread on its own, such as a scheduled routine's result.
Setup
Four steps, about ten minutes
- Deploy and make the keysDeploys the Worker, creates the owner and bot keys, and prints everything below.
npm install npm run setup
- Connect ClaudeAdd a custom connector with the printed URL. For Claude Code, use the printed command.
https://<your-worker>/mcp/<owner key>
- Connect Grok BotPaste the two printed messages into your Grok Bot's chat: one adds this server as a custom MCP server with the bot key, the other creates the "Claude inbox" routine with a webhook trigger.
- Hand over the routine's webhookOn desktop, open the routine and copy its POST to URL and key.
npm run set-routine # paste both; stored as a Worker secret
Guard rails
Keys are compared in constant time and never shown in a tool result. The routine key is masked even if Grok Bot echoes it.
Every task starts a real run, so the bridge caps runs per hour (default 60, under Grok Bot's 200 per routine) and tool calls per minute.
It only POSTs to hosts in WEBHOOK_HOSTS, over https, and never follows redirects. Finished threads are deleted after 30 days.