grok-build-mcp
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-build-mcpRun grok build in /home/user/project to fix lint errors."
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 Build(构建代理)MCP(模型上下文协议)
该服务只提供 run_grok 工具。它会在指定 cwd 中启动 Grok(构建代理),并在同一工作目录中自动复用已有会话。
安装
当前环境已具备 Python(编程语言)与 MCP(模型上下文协议)依赖。其他环境可执行:
python -m pip install -r requirements.txt还需要通过 NPM(包管理器)安装 Grok Build(构建代理)命令行工具:
npm install -g @xai-official/grok
grok --version服务不会使用用户目录中的固定路径。Windows(微软操作系统)会运行 npm prefix -g 得到全局安装目录,并调用其中的 grok.cmd;macOS(苹果操作系统)与 Linux(开源操作系统)直接调用 grok。若命令行工具位于自定义位置,可通过 GROK_COMMAND 环境变量指定可执行文件的完整路径。
在 Codex(代码智能体)全局配置中将入口设置为 grok_build_mcp.py 后,重启 Codex(代码智能体)。
Related MCP server: agent-services-mcp
Codex(代码智能体)配置
在 ~/.codex/config.toml 中添加:
[mcp_servers.grok_build]
command = "python"
args = ["/absolute/path/to/grok_build_mcp.py"]
startup_timeout_sec = 30
tool_timeout_sec = 21600
enabled_tools = ["run_grok"]
default_tools_approval_mode = "auto"
[mcp_servers.grok_build.env]
# 仅当 Grok(构建代理)命令不在标准 NPM(包管理器)目录时设置。
GROK_COMMAND = "/custom/path/to/grok"Windows(微软操作系统)示例中的 Python(编程语言)入口可写为 D:\\Python\\python.exe,脚本路径使用双反斜杠;若不设置 GROK_COMMAND,请保持 npm 可执行并完成上述全局安装。
推理强度
当前版本固定使用 grok-4.5,但不会向 Grok Build(构建代理)传入 --reasoning-effort(推理强度参数)或 --effort(推理强度参数)。因此它使用 Grok Build(构建代理)在该模型下的默认推理强度。
run_grok 的返回值会包含状态、退出码、结构化结果和日志路径,但不包含推理强度。日志同样不能证明模型实际消耗的内部推理词元。
Grok Build(构建代理)命令行工具支持 --reasoning-effort(推理强度参数)。若未来为服务加入该配置,应将请求值以 requested_reasoning_effort(请求的推理强度)返回,例如:
[mcp_servers.grok_build.env]
GROK_REASONING_EFFORT = "high"这只能记录请求的档位;模型供应商通常不会公开实际内部推理量。
工具
run_grok 仅接收以下必填参数:
prompt:交给 Grok(构建代理)的完整任务。cwd:目标项目的绝对工作目录。
服务按规范化后的 cwd 自动保存和恢复 Grok(构建代理)会话。首次任务成功完成后才保存会话编号,避免中断任务留下无效映射。调用方不需要提供会话编号或恢复参数。
每次调用会阻塞至 Grok(构建代理)结束,并返回状态、退出码、最终 JSON(数据格式)结果及两个日志路径。日志保存在 logs,会话映射保存在 state/sessions.json。
This server cannot be installed
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 Servers
- AlicenseAqualityBmaintenanceMCP 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.45010MIT
- AlicenseBqualityDmaintenanceMCP Server for Git operations, agent templates, and project utilities.980MIT
- AlicenseBqualityCmaintenanceAn 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
- Alicense-qualityBmaintenanceAn MCP server that wraps the local Grok Build CLI, enabling Codex to delegate code reviews, bounded coding tasks, and setup diagnostics to Grok for a second opinion or parallel processing.4Apache 2.0
Related MCP Connectors
MCP server for generating rough-draft project plans from natural-language prompts.
The MCP server for Azure DevOps, bringing the power of Azure DevOps directly to your agents.
Personal assistant MCP server with search, execute, packages, jobs, secrets, and integrations.
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/guheng-re/grok-build-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server