grok-mcp
The grok-mcp server acts as an MCP bridge, enabling clients (e.g., Claude Code) to query Grok-4.5 and run multi-agent Grok Build workflows. It exposes three tools:
grok_ask: Sends a prompt to Grok, by default in read-only "consult" mode. Optionally enable "worker" mode (worker=True) to allow write access and shell execution within a working directory (safety-enforced to non-main worktrees). Supports specifying a conversation channel, working directory, model (defaultgrok-4.5), file attachment, and wall-clock timeout. Returns structured JSON with status, reply, run ID, and handoff path.grok_workflow: Executes a named, pre-defined multi-agent workflow from.grok/workflows/*.rhai(e.g.,audit-plan,verify-diff,research-panel,council-round,survey-refs). Provide the workflow name and a JSON string of arguments; returns the workflow result as JSON.grok_workflows: Lists all available workflow names, enabling clients to discover what can be run.
The server is a thin wrapper around existing scripts, reusing signal/cancel/audit/debug logic, and is configurable via GC_REPO_ROOT to locate the repository.
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-mcpRun the council-round workflow to debate whether we should adopt this dependency."
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 && claude
Claude Code 主导 + Grok 辅助(grok-ask 双模式 + 项目级 .grok/workflows)。
你
└─ Claude Code(编排 / 决策 / 集成)
├─ bin/grok-ask consult | worker(-w)
└─ bin/grok-workflow → .grok/workflows/*.rhaiPrerequisites
Claude Code CLI (
claude)Grok Build CLI (
grok login)python3,bash
Related MCP server: grok-build-mcp
Quick start
cd "/path/to/grok&&claude"
chmod +x bin/*
# 1) 推荐:一键 compact + 打开 debug 网页 + 调 Grok
./bin/grok-ask-live --no-sandbox -n -c demo -d "$PWD" \
"用三句话总结本仓库是做什么的。"
# → 浏览器: http://127.0.0.1:8765/ 终端: Grok run: SUCCESS + handoff 路径
# 2) 安静模式(不要浏览器)
GC_COMPACT=1 ./bin/grok-ask -c demo -d "$PWD" "..."
# 3) Claude Code 打开本目录后
claude
# 对 Claude 说: 用 ./bin/grok-ask-live 调用 Grok,不要用自己的 Agent 代替Debug window policy
Default (
grok-ask-live/GC_DEBUG_GUI=1): a pywebview native window opens automatically and auto-closes when no run is active and the feed is idle forGC_DEBUG_IDLE_TIMEOUTseconds (default 15). This mirrors cli-agent-mcp's single window.Fall back to a browser tab:
GC_DEBUG_WINDOW=0(or--open). Browser tabs can not be auto-closed;gc-debug-viewer --stopstops the server only.Force another tab:
GC_DEBUG_FORCE_OPEN=1or--force-open.Never open browser:
GC_DEBUG_OPEN=0.cli-agent-mcp uses one pywebview window for the whole MCP process; we mirror that with one HTTP+SSE server wrapped in a pywebview window.
Layout
Path | Purpose |
| Claude orchestrator rules |
| Grok-side rules |
| Roster + routing |
| Shared blackboard |
| Channelized headless Grok (consult/worker) |
| Launch named project workflows |
| Rhai multi-agent panels |
|
|
| Cloned reference sources |
Workflows
Name | Use |
| Multi-dimension plan critique |
| Parallel review + adversarial verify |
| Multi-angle research + cross-check |
| Advocate / skeptic / pragmatist meeting |
| Survey |
./bin/grok-workflow audit-plan '{"plan_path":".team/PLAN.md"}'
./bin/grok-workflow verify-diff '{"target":"HEAD"}'
./bin/grok-workflow research-panel '{"query":"How should Claude invoke Grok workflows?"}'
./bin/grok-workflow council-round '{"topic":"Should worker mode touch main branch?"}'
./bin/grok-workflow survey-refs '{}'Reference clones
dev-docs/refs/code/
cli-agent-mcp/ # multi-CLI MCP (user-requested)
claude-grok-bridge/ # original grok-ask
claude-team-skill/ # /team plan-audit-execute-verify
grok-delegation/ # Claude plugin delegationRe-clone or update:
./scripts/sync-refs.sh # if present
# or manually git -C dev-docs/refs/code/<repo> pullMCP deployment (CC-switch / any MCP client)
The bridge can be exposed as an MCP server (grok-mcp) so an MCP client — CC-switch,
Claude Code, or any FastMCP host — can drive grok-ask / grok-workflow over the MCP
protocol without being inside the repo. This is a thin wrapper: it locates the repo via
GC_REPO_ROOT and runs its bin/ scripts, so all signal/cancel/audit/debug logic is reused.
# local smoke (builds the package and runs the server)
uvx --from . grok-mcpTools: grok_ask (consult/worker), grok_workflow (run a named workflow),
grok_workflows (list), grok_runs (list runs), grok_cancel (cancel a run by id).
CC-switch MCP config (mirrors the cli-agent-mcp pattern; GC_REPO_ROOT must point at a
checkout that has bin/ and .team/, and the machine needs the grok CLI installed):
{
"command": "uvx",
"args": ["--from", "git+https://github.com/Dragonshock/cli-agent-mcp.git", "grok-mcp"],
"env": { "GC_REPO_ROOT": "/Users/you/grok&&claude", "GC_DEBUG": "false" },
"timeout": 6000000
}Design notes
Claude owns decisions, integration, and user-facing narrative.
Grok consult = independent model family, read-only.
Grok worker = burn Grok credits on long implement/test loops in worktrees.
Grok workflows = deterministic parallel fan-out + adversarial verification (the unique Grok lever).
See CLAUDE.md for the full operating loop.
P0 / P1 runtime (cancel, compact, timeouts, debug)
Feature | How |
Cancel without killing Claude | Each run registers |
Compact handoff |
|
First-event / fatal timeout |
|
Default model |
|
Workflow debug |
|
Graceful cancel (P2) | SIGINT/SIGTERM to the bridge cancels the isolated grok process group → |
Audit serialization |
|
Full subprocess capture |
|
./scripts/test-p0-p1.sh # feasibility suite (P0/P1)
./scripts/test-signals.sh # signal handling + flock + debug-log (P2)Debug window (see Grok while Claude calls it)
Default headless calls do not open a Grok TUI. To get a cli-agent-mcp-style debug window:
# 1) Start live viewer (pywebview native window — auto-opens, auto-closes when idle)
./bin/gc-debug-viewer --window
# 2) Run Grok with debug streaming (default opens the native window)
GC_DEBUG=1 GC_DEBUG_GUI=1 ./bin/grok-ask -c demo -d "$PWD" \
"Read README.md and summarize in 5 bullets."Streams tool/thinking/text events to
http://127.0.0.1:8765/(served inside the native window)Full capture:
.team/bridge/debug/<channel>-*.logViewer URL:
./bin/gc-debug-viewer --url(get_gui_url equivalent)Per-call override:
--debugforces on;--no-debugforces off even ifGC_DEBUG=1Auto-close: window closes when no run is active and the feed is idle for
GC_DEBUG_IDLE_TIMEOUTseconds (default 15)Fall back to a browser tab:
GC_DEBUG_WINDOW=0(tabs can't be auto-closed)Workflow to verify/implement:
.grok/workflows/implement-debug-window.rhai
./bin/grok-workflow implement-debug-window '{}'Folder trust (Grok Build)
Project workflows under .grok/workflows/ require this directory to be trusted in Grok Build before /workflow <name> or the in-session workflow tool can load them. If you see workflow path is not trusted, trust the folder in Grok settings, then:
# from Claude (preferred product path)
./bin/grok-workflow survey-refs '{}'
# or inside a trusted Grok session
/workflow survey-refsStatic research from clone inventory: dev-docs/research/refs-survey.md.
Available Tools
3 toolsgrok_askA
Ask Grok (consult by default; worker=True to let Grok edit/run shell in cwd).
prompt: the instruction to Grok (required)
channel: persistent conversation channel (default "default")
cwd: working directory (default: the repo root; worker mode requires a worktree/scratch — enforced by bin/grok-ask's own dual-gate)
worker: True = worker mode (write + shell, auto-approved; main tree refused unless dual-gate override)
model: grok model id (default grok-4.5)
attach_file: file path to attach into the prompt (repeatable not supported here)
timeout_secs: wall-clock timeout in seconds (0 = default)
Returns JSON: {"status","class","text","run_id","handoff","cwd"} status is SUCCESS | FAILED(class) | TIMEOUT; text is the reply body.
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | ||
| model | No | ||
| prompt | Yes | ||
| worker | No | ||
| channel | No | default | |
| attach_file | No | ||
| timeout_secs | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and does so thoroughly: it discloses that worker mode is 'auto-approved', can write and execute shell, requires a worktree/scratch, and refuses the main tree unless overridden. It also explains return statuses and timeout behavior, giving the agent a strong safety and behavior model.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is front-loaded with a one-sentence summary, then uses a clean bulleted parameter list with defaults and behavioral notes. Every line provides necessary information about a complex tool, with no wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's high complexity (worker mode, shell access, dual-gate enforcement) and zero annotations, the description is complete: it covers modes, constraints, defaults, return JSON shape, and status values. The presence of an output schema is a bonus, and the description still explains enough to use the tool safely.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, and the description fully compensates by explaining every parameter: required prompt, channel default, cwd defaults and worktree requirement, worker mode semantics, model default, attach_file limitation ('repeatable not supported here'), and timeout meaning. This adds substantial meaning beyond the raw schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description begins with 'Ask Grok' and clearly distinguishes consult mode from worker mode, giving a specific verb and resource. However, it does not explicitly differentiate this tool from its sibling tools grok_workflow and grok_workflows, so it stops short of full sibling differentiation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context for when to use worker mode ('worker=True to let Grok edit/run shell in cwd') and includes exclusions like 'main tree refused unless dual-gate override'. It does not mention when to use this tool versus the workflow siblings, so it lacks explicit alternative guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
grok_workflowA
Run a named Grok Build workflow (e.g. audit-plan, verify-diff).
name: workflow name from .grok/workflows/ (list via grok_workflows)
args_json: JSON string of workflow args, e.g. '{"target":"HEAD"}'
Returns JSON: {"workflow","success","summary","run_id","handoff"}
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| args_json | No | {} | |
| timeout_secs | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description bears full responsibility for behavioral disclosure. It does not mention whether running a workflow has side effects (e.g., mutating files, requiring permissions, making network calls), nor does it describe rate limits or error behavior. While it lists the return JSON fields, this is insufficient for a tool that executes arbitrary build workflows.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise and front-loaded with the main purpose. Bullet points for parameters and a return format line add structure without excessive verbosity. The only minor flaw is that the hyphen-prefixed lines feel slightly informal, but they are still clear and efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers purpose, main parameters, and return format, but lacks details on timeout_secs semantics, potential side effects, and error handling. Given that no annotations are present and the tool executes workflows, more completeness is expected for safe and correct usage.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema has zero parameter descriptions, so the description must compensate. It explains 'name' and 'args_json' with a concrete example for args_json, but it omits 'timeout_secs' entirely. This leaves one parameter unexplained, so the compensation is partial.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function with a specific verb and resource: 'Run a named Grok Build workflow'. It provides concrete examples (audit-plan, verify-diff) and distinguishes from sibling tools by mentioning that workflow names come from .grok/workflows/ and can be listed via grok_workflows, implying this tool executes them.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage context by instructing that the workflow name is obtained from .grok/workflows/ and can be listed via grok_workflows, establishing a prerequisite step. However, it does not explicitly contrast with grok_ask or state when not to use this tool, so it lacks full exclusionary guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
grok_workflowsA
List available Grok Build workflows (from .grok/workflows/*.rhai).
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of transparency. The verb 'List' implies a read-only operation, and the path specification adds context. However, it does not explicitly state that the tool has no side effects, what happens if no workflows exist, or whether any environment setup is required. For a simple list tool, this is adequate but not comprehensive.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence that is front-loaded with the action ('List') and is immediately informative. There is no redundant or extraneous information, and it fits the tool's simplicity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (0 parameters, output schema exists), the description is complete: it states the operation, the resource type, and the location. It does not need to explain return values because an output schema is present. The absence of parameter details is irrelevant since there are none.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
There are 0 parameters, and the schema has no properties. The description adds meaning by explaining what the tool lists and from where, providing context that the schema cannot. Since 0 parameters typically warrant a baseline of 4, this score is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function: 'List available Grok Build workflows'. It specifies the source path ('.grok/workflows/*.rhai'), making the resource unambiguous. It also naturally distinguishes from siblings like 'grok_workflow' (singular) and 'grok_ask' by focusing on listing workflows.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for listing workflows, but it does not explicitly state when to choose this tool over alternatives like 'grok_workflow' or 'grok_ask'. There is no mention of exclusions or prerequisites. The simple nature of the tool makes the usage somewhat obvious, but explicit guidance is missing.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
3 tool updates
v0.1.0- First observed
grok_ask - First observed
grok_workflow - First observed
grok_workflows
TDQS
Each tool has a clearly distinct purpose: grok_ask handles direct Q&A or worker execution, grok_workflow runs a named workflow, and grok_workflows lists available workflows. There is no overlap or ambiguity among them.
All tools share the 'grok_' prefix, but the second part mixes a verb (ask) with nouns (workflow/workflows). This is a minor inconsistency; the pattern is still predictable and readable.
The server has only 3 tools, which is slightly thin but appropriate for a focused Grok interaction server. The tools cover the core needs without unnecessary bloat.
The domain is Grok interaction, and the surface covers asking, running workflows, and listing workflows. Minor gaps could include viewing workflow details or cancelling runs, but these are not critical for the apparent purpose.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
MCP server for progressive tool usage at any scale (see https://klavis.ai)
MCP server for building and testing AI agents with multi-model experimentation and insights.
MCP server for Grok Imagine AI video generation
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Related MCP Servers
- AlicenseAqualityDmaintenanceMCP server that wraps the xAI Grok API, allowing Claude and other AI agents to delegate thinking, planning, and real-time search tasks to Grok. It provides a single tool with options for different use cases including web search, Twitter/X search, and multi-agent reasoning.246MIT
- AlicenseAqualityCmaintenanceMCP server that wraps the Grok CLI to enable code review, adversarial testing, and chat with xAI's Grok model, integrating into any MCP host as a peer reviewer, adversary, and consultant.49111MIT
- AlicenseAqualityAmaintenanceA minimal local MCP server that lets Claude Desktop or Claude Code delegate coding tasks to Grok Build running headless as a subagent.5481MIT
- AlicenseBqualityBmaintenanceAn MCP server that exposes the local Grok CLI to Codex for bounded repo work, reviews, rescue analysis, adversarial checks, session listing/export, and background job management while keeping Codex hidden context out of scope.12MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- 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/Dragonshock/cli-agent-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server