grok-bridge
Grok Bridge is a local MCP server that lets ChatGPT or Codex delegate work to a locally installed Grok Build agent.
Check Grok availability and configuration with
grok_doctor.Run synchronous, read-only consultations for planning, research, or review with
grok_consult.Start durable background jobs that can edit files and run commands in a workspace with
grok_start.Poll job status, progress logs, and persisted final results with
grok_poll.Cancel running jobs and their child process trees with
grok_cancel.List recent bridge jobs and Grok sessions with
grok_list.Export Grok session transcripts as Markdown with
grok_export_session.Jobs automatically resume across max-turn or context boundaries and support configurable effort, timeouts, and session resumption.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@grok-bridge Ask Grok to review this implementation at xhigh effort."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Grok Bridge
Grok Bridge is a local Model Context Protocol (MCP) server and Codex plugin that lets ChatGPT Desktop and Codex delegate substantial work to the locally installed Grok Build agent. It works in repositories and standalone workspace directories.
It supports durable logical jobs, automatic continuation of recoverable Grok execution boundaries, live progress logs, persisted final results, cancellation, session discovery, and transcript export. Delegated jobs use xhigh reasoning effort by default.
Community project. This repository is not affiliated with, endorsed by, or maintained by xAI or OpenAI. Grok and Grok Build are not included.
What it provides
Tool | Purpose |
| Check the Grok executable, authentication, runtime, and defaults. |
| Run a quick synchronous, read-only consultation. |
| Start a durable background logical job with workspace or enforced read-only access. |
| Read attempt/continuation state, progress tails, and the persisted final result. |
| Cancel a known job and its child process tree. |
| List recent bridge jobs and Grok sessions. |
| Export a Grok session transcript as Markdown. |
The bundled skill routes every task that must finish through grok_start, teaches Codex to recover an existing job after caller context compaction, and requires independent verification of Grok's output.
Related MCP server: codex
Completion model
One grok_start call creates one logical job under ~/.grok/bridge/jobs, even when several Grok CLI processes are needed to finish it. The worker:
consumes Grok's
streaming-jsonoutput as a progress heartbeat;treats a normal
end_turnas completion, not process exit code alone;automatically resumes the same Grok session after max-turn, max-token, or context boundaries;
keeps per-attempt prompts, stdout, stderr, metadata, and the final result on disk;
stops on authentication, quota, permission, invalid-request, total-deadline, continuation-limit, or repeated no-progress blockers.
Grok's internal context compaction remains inside Grok and does not end a logical job. A Codex caller can reconnect later, find the job with grok_list, and continue polling it without watching an interactive console.
Requirements
Node.js 20 or newer.
Grok Build installed locally.
Grok authenticated through its own CLI, for example with
grok login --oauth, or with an authentication method supported by your Grok installation.ChatGPT Desktop, Codex CLI, or another MCP client with STDIO server support.
By default the bridge looks for Grok at ~/.grok/bin/grok (grok.exe on Windows), then falls back to grok on PATH. Set GROK_BRIDGE_GROK_EXE to override this.
Install
Clone the repository and install the locked dependencies:
git clone https://github.com/conrad85/grok-bridge.git
cd grok-bridge
npm ci
npm run test:doctorOption A: install as a local Codex plugin
From the cloned repository, register its local marketplace:
codex plugin marketplace add .Restart ChatGPT Desktop, open the Plugins Directory, select the Grok Bridge marketplace, and install the plugin. The plugin bundles both the MCP server configuration and the reusable skill. See the official OpenAI plugin packaging documentation for current marketplace behavior.
Option B: configure the MCP server directly
Use the absolute path to your clone:
codex mcp add grok_bridge -- node /absolute/path/to/grok-bridge/server/index.mjsTo make the workflow skill available to new local sessions, copy skills/grok-bridge into your personal skills directory:
macOS/Linux:
mkdir -p ~/.agents/skills
cp -R skills/grok-bridge ~/.agents/skills/grok-bridgeWindows PowerShell:
New-Item -ItemType Directory -Force "$env:USERPROFILE\.agents\skills" | Out-Null
Copy-Item -Recurse -Force "skills\grok-bridge" "$env:USERPROFILE\.agents\skills\grok-bridge"Restart the desktop app after changing MCP or skill configuration.
Example requests
"Ask Grok to review this implementation at xhigh effort."
"Use Grok as a builder, implement the feature, and run the tests."
"Have Grok reproduce this bug as a tester, then independently verify the result."
"Have Grok finish this report in the current non-repository workspace."
Configuration
Environment variable | Meaning |
| Absolute path or command name for the Grok executable. |
| Directory for bridge jobs and bounded logs. Defaults to |
| Optional authentication method when supported by the local Grok CLI. |
After installing or updating the plugin, start a new Codex session so its bundled skill and MCP tools are loaded together. Existing sessions retain the tool set they started with. Do not depend on paths under Codex plugin caches; invoke the plugin through the skill and grok_* tools exposed to the session.
Safety and privacy
Builder jobs run Grok in its workspace sandbox and add explicit denials for commits, pushes, publishing, deployment, and broad destructive commands. Read-only consultations use stricter permissions. These are defense-in-depth controls, not a substitute for reviewing delegated work.
Durable reviews, planning, and research can use grok_start with access: "read_only"; implementation uses access: "workspace".
Always pass an explicit absolute working directory. It may be a Git repository, an isolated worktree, or a dedicated non-repository task directory, but it must not be a filesystem root or an unnecessarily broad home directory. Do not run concurrent write jobs against the same files.
The bridge itself has no telemetry and does not bundle credentials. Grok Build may send prompts and project context to xAI as part of its normal operation. Job requests, output, and logs are stored locally under GROK_BRIDGE_HOME. Read PRIVACY.md and SECURITY.md before use.
Development
npm ci
npm run build:mcp
npm run check
npm test
npm run audit:publicThe committed dist/index.mjs and dist/worker.mjs are self-contained plugin runtime files. Codex plugin caches do not run npm install, so .mcp.json intentionally launches the bundle instead of the source tree. Rebuild and commit both files whenever server code or runtime dependencies change.
npm test uses a fake Grok executable to cover automatic resume after both historical max-turn result shapes, persisted final output, blocker classification, continuation exhaustion, a no-progress watchdog, and a non-repository working directory.
Tests that invoke a real authenticated Grok installation are intentionally separate:
npm run test:doctor
npm run test:live -- /absolute/project/path
npm run test:background -- /absolute/project/path
npm run test:builder -- /absolute/fixture/pathLicense
MIT. See LICENSE.
Available Tools
7 toolsgrok_cancelCancel Grok JobADestructiveIdempotent
Cancel one known Grok Bridge background job and its child process tree.
Inputs: job_id (required).
grok_consultConsult GrokARead-only
Run a synchronous, read-only Grok second opinion for planning, research, analysis, or code review. Uses xhigh reasoning by default and cannot edit files.
Inputs: cwd (required), prompt (required), role, model, +5 more.
grok_doctorCheck Grok BridgeARead-onlyIdempotent
Check whether Grok Build, local authentication, the bridge runtime, and xhigh defaults are ready.
Inputs: no named parameters.
grok_export_sessionExport Grok SessionARead-onlyIdempotent
Export a Grok session transcript as Markdown so another ChatGPT session can inspect prior delegated work.
Inputs: session_id (required), max_chars.
grok_listList Grok Jobs and SessionsBRead-onlyIdempotent
List recent bridge jobs plus Grok's local session index, useful for resuming work across ChatGPT sessions.
Inputs: limit.
grok_pollPoll Grok JobARead-onlyIdempotent
Read a background Grok job's state, final result, and bounded log tails. Continue polling while state is queued or running.
Inputs: job_id (required), max_chars.
grok_startStart Grok BuilderADestructive
Start a durable background Grok job for implementation, debugging, testing, or review. It may edit files and run commands inside cwd. Poll the returned job_id until terminal.
Inputs: cwd (required), prompt (required), role, model, +5 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool has a distinct, non-overlapping purpose: health check, synchronous consult, async job lifecycle (start/poll/cancel), listing, and session export. No two tools could be confused for one another.
All tools share the consistent grok_ prefix and use clear, action-oriented snake_case names. While some are simple verbs (grok_start) and others verb-noun (grok_export_session), the pattern is uniform and predictable.
Seven tools is well-scoped for a bridge server dedicated to Grok integration. Each tool covers a necessary operation without bloat or redundancy.
The tool set covers the full lifecycle: readiness check, synchronous consultation, background job management (start, poll, cancel), history listing, and session export. No obvious gaps for the domain.
Maintenance
Related MCP Connectors
Use your own Windows, Mac or Linux computer from ChatGPT, Claude, Cursor or Gemini CLI: run commands, read, write and search files, run long processes. Your computer only makes an outgoing connection (no open ports or VPN). Read-only mode, allowed folders, blocked commands and an action log keep you in control. Free plan available.
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Connect AI assistants to your approved computer for files, commands, browser and desktop tasks.
Build, run, inspect, and continue AgentScript workflows on connected Super Chrome and Mac clients.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceConnects OpenAI Codex and Claude Code to the local Grok Build CLI for second-opinion code reviews, bounded coding tasks, web research, media generation, and TTS.3Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables Grok Build to orchestrate the local Codex CLI for code reviews, adversarial reviews, task rescue, session transfer, and background job management through MCP tools.1Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables ChatGPT conversations to directly inspect local workspaces and delegate coding tasks to a local Codex agent, with controlled concurrency, reusable sessions, and task/usage tracking.MIT
- AlicenseCqualityCmaintenanceEnables IDEs and MCP hosts to drive a user's Grok Bot cloud agents, including sending messages, waiting for replies, reading history, and managing agents, secrets, widgets, handoffs, and desktop access. It acts as an outbound bridge from Cursor, Claude, and VS Code to those cloud agents.21MIT