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-mcpreview my current git diff for security flaws"
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
Bring xAI's Grok Build CLI into any MCP host as a peer reviewer, adversary, and consultant — alongside whatever main model you're already running.
grok-build-mcp is a small Model Context Protocol server that wraps the grok CLI. Your existing agent (Claude Code, Cursor, Cline, OpenClaw, …) can call into Grok for second-opinion code review, adversarial testing, or extended chat — without leaving its session.
繁體中文版:README.zh-TW.md
What you get
Four tools, all stateless, all stdout-only:
Tool | Use it for |
| One-shot prompt → Grok's reply |
| Pass a unified diff (or auto-grab |
| Replay a message history for multi-turn — caller owns the thread |
| Adversarial: ask Grok to find every bug, race, edge case, and security hole |
Prerequisites
Node.js ≥ 18
The Grok CLI installed and authenticated:
curl -fsSL https://x.ai/cli/install.sh | bash grok # first run handles auth
Install
npm install -g grok-build-mcp
# or use npx — no install needed
npx grok-build-mcpWire it into your MCP host
Claude Code
claude mcp add grok npx -- grok-build-mcpOr edit ~/.claude.json directly:
{
"mcpServers": {
"grok": {
"command": "npx",
"args": ["-y", "grok-build-mcp"]
}
}
}Cursor
Create .cursor/mcp.json (project) or ~/.cursor/mcp.json (global):
{
"mcpServers": {
"grok": {
"command": "npx",
"args": ["-y", "grok-build-mcp"]
}
}
}Cline (VS Code)
Settings → Cline → MCP Servers:
{
"grok": {
"command": "npx",
"args": ["-y", "grok-build-mcp"]
}
}Any other MCP host
grok-build-mcp speaks plain stdio MCP. Point any client at npx -y grok-build-mcp and it works.
Tool reference
grok_chat
{ "prompt": "Explain consistent hashing in two sentences." }Optional: model to override the default Grok model.
grok_review
{ "base_ref": "main", "focus": "security" }If diff is omitted, runs git diff <base_ref>...HEAD in cwd (defaults to your host's working directory). Returns a markdown review with verdict, per-dimension scores (correctness / readability / architecture / security / performance), and concrete fix-it items.
grok_consult
{
"messages": [
{ "role": "system", "content": "You are a senior backend engineer." },
{ "role": "user", "content": "How would you cache this query?" },
{ "role": "assistant", "content": "Two options..." },
{ "role": "user", "content": "What's the failure mode of option 2?" }
]
}The server is stateless — the caller passes the full thread each time. Most MCP hosts handle this naturally.
grok_challenge
{
"code": "function transfer(from, to, amount) { from.balance -= amount; to.balance += amount; }",
"context": "Node.js, called concurrently from HTTP handlers"
}Returns severity-ranked issues (Critical / High / Medium / Low) with concrete reproductions and patches.
Configuration
Env var | Default | Purpose |
|
| Path to the |
|
| Per-call timeout in milliseconds |
Authentication and model defaults live in the Grok CLI itself (~/.grok/config.toml).
Roadmap
v0.1 (this release): four stateless tools, stdio transport
v0.2: server-side session persistence so
grok_consultcan take aconversation_idv0.3: streaming responses through MCP
progressnotifications
Development
git clone https://github.com/howardpen9/grok-mcp.git
cd grok-mcp
npm install
npm test
npm run buildLicense
MIT
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
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/howardpen9/grok-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server