Skip to main content
Glama

grok-plugin-codex

Chinese | English

A plugin that uses Grok directly in Codex.
You still talk to Codex. Reviews, hard bug fixes, proposals, design docs, PR babysitting, docs / images / videos — hand those to your local Grok Build.

Chinese search terms

Codex 调用 Grok · 在 Codex 上用 Grok · Codex Grok 插件 · OpenAI Codex 用 xAI Grok · Codex MCP Grok

English search terms

Codex Grok plugin · use Grok in Codex · Grok MCP for Codex · Grok Build Codex · delegate Codex tasks to Grok

Not an official xAI / OpenAI product. Current version 0.6.0. Apache-2.0. Derived from stdevMac/grok-in-codex.


What this is

Codex stays the foreman: you talk to it, it breaks down tasks and tracks progress.
This repo is just a very thin MCP plugin — it doesn't replace Codex, and it doesn't embed the Grok model into Codex. It calls the grok CLI you already have installed locally.

You hand the words to Codex, the plugin hands the task to local Grok

Good for: adding a second capable agent inside Codex; getting a structured review before merging; following a "proposal → design → implementation" flow; or using Grok's image / video / document capabilities (which Codex doesn't have).
Not needed for: one-line fixes, renames, or chit-chat that never touches the repo.

What should stay in Codex, what should go to Grok


Related MCP server: Grok-in-Codex

What it can do

You want

Say to Codex

Tool

Fix / troubleshoot

"Have Grok look into why the tests fail"

grok_rescue

Proposal only, no code changes

"Use Grok to plan an auth rewrite"

grok_plan

Design doc + PR breakdown

"Have Grok write a design doc"

grok_design

Implement per design

"Execute the latest Grok plan, dry-run first"

grok_execute_plan

Review a branch / PR

"Have Grok review this branch against main"

grok_review

Challenge assumptions

"Do an adversarial review of the billing design"

grok_adversarial_review

Babysit CI / review comments

"Have Grok watch the open PRs"

grok_babysit

Named workflows

"List / run a Grok workflow"

grok_workflow

PDF / Word / PPT

"Make a one-page release PDF"

grok_document

Images / short videos

"Use Grok to make a 16:9 release banner"

grok_image / grok_video

Task board

"Check Grok task status"

grok_status / grok_result / grok_cancel

Don't cram bigger product work into one giant rescue:

Big work goes through this pipeline, not one giant rescue

Artifacts land in the project directory (gitignore recommended): .grok-plans/ .grok-designs/ .grok-reviews/ .grok-docs/ .grok-media/ .grok-workflows/.


Environment

  • Node.js 18.18+

  • Grok Build CLI (grok) on PATH, commonly at ~/.grok/bin/grok

  • grok login

  • Grok Build ≥ 1.0.5 recommended (0.2.118 still starts; specific flags are gated by capability detection)

  • gh only needed if you want to post comments on PRs

This plugin doesn't ship a model and won't log you into Grok for you.


Installation

codex plugin marketplace add /path/to/grok-plugin-codex/.agents/plugins
codex plugin add grok@grok-plugin-codex

Open a new Codex session for the MCP tools to load. Then:

node plugins/grok/scripts/grok-companion.mjs setup

Or have Codex call grok_setup.

Codex may launch the plugin from its install cache. Pass the real project path as cwd on every tool call so tasks and artifacts land in that repo:

grok_review cwd="/path/to/project" base=main
grok_status cwd="/path/to/project" json=true

Getting started

Just say it in Codex:

让 Grok 对照 main 评审这个分支。
用 Grok 规划一次鉴权重写。
让 Grok 出一份设计文档,然后 dry-run 执行最新方案。
给重试重构开一个后台 Grok rescue。
用 Grok 生成一张 16:9 发布 banner。
看看 Grok 任务状态。

MCP example:

grok_plan prompt="plan the auth rewrite" background=true
grok_design prompt="design multi-tenant billing" background=true
grok_execute_plan latest=true dryRun=true
grok_workflow action=list
grok_review base=main focus="auth, data loss, and race conditions"
grok_rescue prompt="investigate why npm test is failing" background=true
grok_babysit action=list
grok_document type=pdf prompt="one-pager for the launch"
grok_image aspect="16:9" prompt="Dark developer-tool launch banner"
grok_video image="./.grok-media/image/hero.png" duration="6" prompt="gentle camera push-in"
grok_status
grok_result jobId="plan-abc123"

Tool overview

Tool

Purpose

grok_setup

CLI + login + version + doctor; optional stop-review gate

grok_rescue

Troubleshoot / implement (writable by default)

grok_plan

Proposal only → .grok-plans/

grok_review

Read-only review (tree / branch / PR; optional postPending)

grok_adversarial_review

Challenge designs and assumptions

grok_workflow

List / run Grok Rhai workflows

grok_design

Design doc + PR plan → .grok-designs/

grok_execute_plan

Execute the PR DAG from a design doc

grok_babysit

Babysit PRs / fix CI and review comments (list is read-only)

grok_document

docx / pdf / pptx → .grok-docs/

grok_image

Generate or edit images → .grok-media/image/

grok_video

Short videos → .grok-media/video/

grok_sessions

List / search / export Grok sessions

grok_transfer

Context handoff notes for Grok

grok_status

Tasks + live progress / log tail + usage

grok_result

Final output (plan.md preferred for plan tasks)

grok_cancel

Cancel background tasks

Control parameters for long tasks: sandbox (workspace, read-only, strict, devbox, off; the old alias workspace-write normalizes to workspace), planMode / permissionMode, agent, noSubagents, memory / noMemory, allow / deny, disableWebSearch, forkSession, maxTurns.

Aligned with Grok CLI 1.0.x: if the CLI has no --check / --best-of-n, they aren't force-passed. check=true is written into the prompt. Write tasks that only read for many turns without writing files are stopped on execution drift.


Usage notes

Rescue — writable by default. readOnly=true for troubleshooting only. worktree=true for safer changes.

Plan / design / execute — artifacts go to .grok-plans/ and .grok-designs/. latest=true picks the newest design. dryRun=true is read-only.

Review — never applies patches. With postPending=true on a PR, it only posts PENDING GitHub comments when it finds something.

Media — files are copied into .grok-media/ to stay within the project path contract.

Jobsbackground=true returns a job id. Multiple Grok tasks can run at once. Track them with grok_status / grok_result / grok_cancel.

CLI posture — uses a denylist (--disallowed-tools) rather than an allowlist. Media, dry-run / validate-only, and babysit list are read-only (no yolo). Reviews default to --sandbox read-only and don't strip shell tools (Grok 1.0.x needs them to produce task results).

Environment variables

Variable

Purpose

GROK_BINARY

Overrides the grok path (tests use a mock)

GROK_CODEX_PLUGIN_STATE

Root directory for this plugin's task state

CODEX_PLUGIN_DATA

Host plugin data directory; only trusted when the basename is grok / grok-*

Default state directory: ~/.grok/codex-plugin/state/. Not shared with the Claude plugin state.

Task control

  • No global single-task lock. Prefer background=true for long tasks.

  • Status follows the text stream and thought stream; still shows running on whitespace-only tokens. Status also records the most recent tool and whether a write tool has run.

  • Plan results prefer harvesting plan.md. Completed tasks store config, usage, artifacts (v3).

  • Reaper: pid dead and result.json complete → completed; pid dead but result truncated → failed (never stuck on running forever).

  • Background result.json is written atomically (tmp + rename).

  • PR post-pending also runs when background jobs finish; empty / oversized diffs fail closed, findings go to .grok-reviews/.


Development

npm test
node plugins/grok/scripts/grok-companion.mjs setup --json
node plugins/grok/mcp/server.mjs   # stdio NDJSON MCP server

Version numbers in package.json, plugins/grok/.codex-plugin/plugin.json, and .agents/plugins/marketplace.json must match.


License

Apache-2.0. See LICENSE and NOTICE.

This project is derived from stdevMac's stdevMac/grok-in-codex.

A
license - permissive license
Not graded
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

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

Related MCP Servers

  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables Codex to use Grok Build CLI as a controlled subagent via MCP tools for independent investigation, review, and isolated implementation tasks.
    4
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Connects 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.
    2
    Apache 2.0

View all related MCP servers

Related MCP Connectors

  • A paid remote MCP for OpenAI Codex agent coordination MCP, built to return verdicts, receipts, usage

  • A paid remote MCP for OpenAI Codex context compressor, built to return verdicts, receipts, usage log

  • A paid remote MCP for OpenAI Codex memory MCP, built to return verdicts, receipts, usage logs, and a

View all MCP Connectors

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/bigu1/grok-plugin-codex'

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