Codex × Grok Bot MCP Task Bridge
Open-source MCP task bridge for trusted local Codex, Claude Code, and Cursor callers plus one Grok Bot executor, with asynchronous jobs, fenced leases, idempotency, scoped OAuth, and Cloudflare Workers/D1/R2.
接入你的智能体
从发布者处安装。不是 PlugMCP 端点。
远程 URL 还是本机命令? 两种安装方式的区别
来自发布者
Open-source MCP task bridge for trusted local Codex, Claude Code, and Cursor callers plus one Grok Bot executor, with asynchronous jobs, fenced leases, idempotency, scoped OAuth, and Cloudflare Workers/D1/R2.
Open-source MCP task bridge for Codex and Grok Bot with async jobs, leases, idempotency, scoped OAuth, and Cloudflare Workers/D1/R2. Hermes integration roadmap included.
This is not an official xAI SDK or Grok API integration. It does not use CC Switch Grok OAuth, private Grok APIs, or an unauthenticated fallback. Hermes integration is planned for a later release and is not a runtime dependency of v0.4.
Codex / Claude Code / Cursor ──> Cloudflare Task Bridge <── OAuth MCP ── Grok Bot
│
D1 + R2
The bridge handles queueing, leases, retries, idempotency, attachment limits, and permission checks. It does not make knowledge judgments or write to external knowledge bases.
The target unattended setup uses a Grok Bot Routine to call claim_next_task on a schedule, execute in its cloud computer, and report in the owning Bot conversation. This specific Grok Bot integration still needs an in-app connector and Routine test. Codex uses get_task as the authoritative status read. See Automatic cloud execution.
Requirements: Node.js LTS, a Cloudflare account, Wrangler, D1, R2, and KV.
npm ci
cp .dev.vars.example .dev.vars
npm run check
npm test
npx wrangler kv namespace create codex-grok-task-bridge-oauth
npx wrangler d1 create codex-grok-task-bridge
npx wrangler r2 bucket create codex-grok-task-bridge-attachments
Replace the resource placeholders in wrangler.jsonc, then set secrets with Wrangler. Never commit .dev.vars, access tokens, OAuth login codes, cookies, or production data.
wrangler.jsonc declares two cron triggers: */5 * * * * reconciles expired task leases against D1, and the daily 17 3 * * * run purges stale OAuth state. The purge stays off the five-minute schedule because its KV list calls would otherwise exhaust the free-plan daily limit.
npx wrangler d1 migrations apply codex-grok-task-bridge --local
npm run dev
For an authenticated end-to-end smoke test, provide BRIDGE_URL, CODEX_TOKEN, and GROK_TOKEN only in the shell environment and run:
npm run smoke
The Codex ↔ Grok connector protocol smoke test records a verified handoff after restarting the Codex client. Grok was manually prompted in a grok.com conversation. It covers task creation, claim, progress reporting, completion, and result retrieval; it does not verify an unattended Grok Bot Routine or cloud-computer browser work.
The public X account research case records a read-only task that asked Grok Bot to collect the day's public posts from an X account and return a concise evidence-backed summary. It verifies cloud-browser research through a manually triggered Bot conversation; Routine-based unattended triggering remains a separate capability to verify.
Codex uses the /mcp endpoint with a dedicated Bearer token. Grok Bot uses /grok/mcp through the OAuth discovery, authorization-code, and PKCE flow. The Grok scope set is limited to:
task:read task:claim task:progress task:complete
After connecting the Custom MCP Connector, verify that Grok can see claim_next_task and complete_task, but cannot see create_task or cancel_task. Any login, MFA, payment, publishing, deletion, production change, or external message action must stop for human approval.
The connector is invoked by a conversation or a scheduled Routine. A Custom MCP server cannot currently push a message into an arbitrary Grok conversation or wake a Bot through a public webhook, so the Routine is the supported automatic polling mechanism.
Register the remote MCP server once at the Codex user level, then restart the Codex desktop app. New Codex desktop, CLI, and IDE conversations on the same host can use the bridge tools without per-project setup.
codex mcp add grok-bridge \
--url https://<bridge-domain>/mcp \
--bearer-token-env-var GROK_BRIDGE_TOKEN
Keep GROK_BRIDGE_TOKEN in the local environment or a secret manager; never place its value in repository configuration. Confirm the registration with codex mcp list. To remove only this registration, run codex mcp remove grok-bridge and restart the client.
v0.4 supports trusted local Codex, Claude Code, and Cursor callers with independent identities and least-privilege scopes. Multi-agent callers documents the managed Worker Secret, setup backups, rollback commands, and the credential-free stdio proxy used by clients without a native bearer-token environment setting. Callers cannot read, cancel, or list another caller's tasks.
.env files, browser profiles, or complete workspaces.SECURITY.md; do not publish credentials in Issues.The optional Grok Task Continuation skill makes the Codex side of an asynchronous hand-off explicit. After creating bridge tasks, it creates a heartbeat scoped to the current Codex task. When a known task reaches a terminal state, Codex reviews the authoritative get_task result, including evidence and limitations, then continues the original request using the authority already granted.
Install it globally for future Codex tasks:
mkdir -p ~/.codex/skills
cp -R skills/grok-task-continuation ~/.codex/skills/
This is a per-task continuation consumer, not a Worker callback. Neither the Worker nor Grok Bot can push a message into an arbitrary Codex conversation. The heartbeat remains silent while tasks are non-terminal and asks for new authority before any external write, deployment, publication, payment, or destructive action.
grok-task-continuation Skill keeps the originating Codex task responsible for evaluating a terminal bridge result and completing the requested follow-up.owner_client_id; Grok remains the only executor.hermes kanban as its task source of truth.research_evidence and browser_collection tasks.Maintained by @aipmer, focusing on AI agents, MCP, automation workflows, and knowledge systems.
Apache-2.0. See LICENSE.
Open-source MCP task bridge for Codex and Grok Bot with async jobs, leases, idempotency, scoped OAuth, and Cloudflare Workers/D1/R2. Hermes integration roadmap included.
工具
暂无工具列表。远程服务器在首次健康检查后会获得工具列表。
常见问题
在本页复制适用于 Cursor、Claude Desktop、Claude Code 或 VS Code 的 stdio 配置。它使用发布者的安装方式,而不是 PlugMCP 代理。
此记录未列出必需的环境变量。
Codex Grok Task Bridge 通过 stdio 在本地运行。
上次检查时间:2026-10-28。 Open-source MCP task bridge for Codex and Grok Bot with async jobs, leases, idempotency, scoped OAuth, and Cloudflare Workers/D1/R2. Hermes integration roadmap included.