grok-bot-mcp

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.

MCP 2026-07-28 + 2025 clients Two keys, two toolsets Replies wake waiting reads

How it works

Grok Bot has no chat API, so the bridge carries both directions

1

Claude

Sends a task or a follow-up.

grok_bot_send
2

Bridge

Saves it on a thread and POSTs to your routine's webhook.

routine webhook
3

Grok Bot

The routine runs, reads the whole thread and does the work.

get_claude_task
4

Grok Bot

Answers, asks a question or reports progress.

reply_to_claude
5

Claude

A waiting read wakes the moment the reply lands.

grok_bot_read

Tools

Each key sees only its own side

Claude's side

Owner key · Claude, Claude Code, Cursor

grok_bot_send

Start a task, follow up, or wake Grok Bot again for waiting messages.

grok_bot_read

Read a thread; wait up to 50 s for the next message.

grok_bot_inbox

Replies, questions and notes that need you, then other open threads.

grok_bot_close

Close a thread so Grok Bot stops working on it.

grok_bot_status

Routines, 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_task

The task from the webhook's thread_id, or the oldest one waiting, with the whole thread.

reply_to_claude

done, needs_input, progress or failed, with links.

message_claude

Start a thread on its own, such as a scheduled routine's result.

Setup

Four steps, about ten minutes

  1. Deploy and make the keysDeploys the Worker, creates the owner and bot keys, and prints everything below.
    npm install
    npm run setup
  2. Connect ClaudeAdd a custom connector with the printed URL. For Claude Code, use the printed command.
    https://<your-worker>/mcp/<owner key>
  3. 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.
  4. 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 stay secret

Keys are compared in constant time and never shown in a tool result. The routine key is masked even if Grok Bot echoes it.

Usage stays bounded

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.

Webhooks stay put

It only POSTs to hosts in WEBHOOK_HOSTS, over https, and never follows redirects. Finished threads are deleted after 30 days.