Grok Plugin Codex
This server exposes the local Grok CLI as MCP tools, allowing Codex to delegate code analysis, reviews, diagnostics, and background job management to Grok as a second-agent surface.
Check & Models —
grok_checkverifies CLI installation, version, and login/model availability;grok_modelslists available models.Run & Continue —
grok_runexecutes any prompt in foreground (JSON) or background (streaming-JSON) mode;grok_continueresumes an existing session by ID or the latest one.Review Tools —
grok_reviewperforms bounded, findings-first code reviews;grok_adversarial_reviewfocuses on failure modes (max 5 findings);grok_rescueprovides an independent, read-only diagnosis and minimal path forward.Session & Export —
grok_sessionslists/searches past sessions;grok_exportreturns a session as Markdown or saves it to a file.Background Job Management —
grok_statuschecks job status;grok_resultretrieves stdout/stderr tails and parsed output;grok_cancelterminates a running job.Shared Configuration — All tools accept parameters for working directory, Grok binary, model, timeout, background execution, web search toggle, subagents, max turns, reasoning effort, and privacy controls (e.g.,
allowCodexPrivatePaths).
Click on "Install 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 Plugin CodexReview the latest commit for potential issues."
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 Plugin Codex
grok-plugin-codex is a Codex plugin that exposes the local Grok CLI through a bundled Node/TypeScript stdio MCP server.
It lets Codex ask Grok for bounded repo work, reviews, rescue analysis, adversarial failure-mode checks, session listing/export, and background job management while keeping Codex hidden runtime context out of scope.
Repository: https://github.com/handong66/grok-plugin-codex
Tools
grok_check: discover Grok CLI, rungrok --version, and check login/model availability withgrok models.ok: truemeans both CLI discovery andgrok modelssucceeded.grok_models: return raw and parsedgrok modelsoutput.grok_run: rungrok --cwd <cwd> -p <prompt> --output-format jsonin foreground orstreaming-jsonin background.grok_continue: continue with--resume <sessionId>or with--continueonly whencontinueLatest: true.grok_rescue: read-only independent diagnosis prompt wrapper.grok_review: bounded findings-first review prompt wrapper.grok_adversarial_review: bounded failure-mode review prompt wrapper that asks Grok for at most 5 findings. The cap is prompt-level guidance, not output truncation.grok_sessions: wrapgrok sessions list/search.grok_export: wrapgrok export <sessionId>and return Markdown from stdout by default.grok_status,grok_result,grok_cancel: manage background Grok jobs.
There is no grok_transfer tool in v1. Grok has import, but this repository does not claim a verified Codex rollout JSONL to Grok import schema.
Related MCP server: grok-build-mcp
Requirements
Node.js
>=22npm
Codex local plugin marketplace support
Grok CLI installed and logged in
Check Grok directly:
grok --version
grok modelsInstall
From the repository root:
npm install
npm run check
codex plugin marketplace add .
codex plugin add grok-plugin-codex --marketplace grok-plugin-codexThen start a new Codex thread so the MCP tools and grok skill are loaded.
npm run check builds plugins/grok-plugin-codex/dist/server.js; the installed MCP server runs that bundle from the plugin directory.
Usage Notes
Use the Grok tools as a second-agent surface. Codex remains responsible for scope, workspace state, verification, git, and final judgment.
Pass cwd whenever Grok should inspect a specific workspace. If cwd is omitted, the plugin falls back to the MCP server process directory, which is normally the installed plugin directory rather than the user's active repo.
For long tasks, pass background: true to use --output-format streaming-json, then poll:
grok_status -> grok_result -> grok_cancel if neededUse the same cwd when polling or cancelling a background job that was used when the job was started; job records live under <cwd>/.grok-plugin-codex/jobs.
grok_result treats a background job as complete only when the process succeeded, at least one text event was observed, and an end event was observed. Partial logs are process evidence, not a finished review.
Use very low maxTurns values only for sentinel checks or prompts that do not need file/tool work. Repo reviews and rescue analysis usually need enough turns for Grok to inspect the requested files and produce a final answer.
Shared Arguments
Run, continue, rescue, review, and adversarial-review tools accept:
cwdgrokBinmodeltimeoutMsbackgrounddisableWebSearchnoSubagentsmaxTurnsalwaysApprovereasoningEffortallowCodexPrivatePaths
grok_check accepts cwd, grokBin, timeoutMs, and optional includeModels. grok_models accepts cwd, grokBin, and timeoutMs.
grok_sessions accepts cwd, grokBin, timeoutMs, query, and limit. Search queries are separated from Grok CLI flags before execution. grok_export accepts cwd, grokBin, timeoutMs, sessionId, and optional outputFile; outputFile must resolve inside cwd. Discovery-style subcommands pass cwd as Grok's global --cwd option. Job tools accept cwd plus a jobId in the generated job_<timestamp>_<8-hex> format; grok_result also accepts maxChars.
grok_check also accepts includeModels: false to skip grok models and verify only CLI discovery/version. With the default behavior, grok_check runs grok models and ok: true means both discovery and model probing succeeded.
alwaysApprove defaults to false and is only passed when explicitly true.
reasoningEffort is passed through only when the plugin does not know it is unsupported. The local default model grok-composer-2.5-fast does not support --reasoning-effort; the plugin warns and does not pass that flag for that model. If no model is specified, the plugin also warns and does not pass --reasoning-effort, because the local default may be grok-composer-2.5-fast.
Privacy Boundary
This plugin does not copy Codex hidden context, system/developer messages, tool outputs, hidden reasoning, secrets, or Grok auth tokens into prompts.
Grok CLI child processes receive only the plugin-declared environment allowlist: GROK_BIN, HOME, and PATH.
Prompts that ask Grok to read Codex private runtime paths such as ~/.codex are rejected by default. Set allowCodexPrivatePaths: true only when the user explicitly asks for that risk and understands it.
This boundary does not redact arbitrary user-provided text. If a caller pastes secrets, private tool output, or sensitive file contents into prompt, problem, or target, that text is passed to Grok.
Development
npm install
npm run check
git diff --checkOptional authenticated live smoke:
npm run smoke:live-grokKeep these files aligned whenever tools change:
README.mdplugins/grok-plugin-codex/README.mdplugins/grok-plugin-codex/skills/grok/SKILL.mdplugins/grok-plugin-codex/src/tools.tsplugins/grok-plugin-codex/src/server.tsscripts/smoke-mcp.mjs
See docs/development.md and docs/verification.md.
Project Policies
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/handong66/grok-plugin-codex'
If you have feedback or need assistance with the MCP directory API, please join our Discord server