grok-build-mcp
MCP 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.
README
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 |
|---|---|
grok_chat |
One-shot prompt → Grok's reply |
grok_review |
Pass a unified diff (or auto-grab git diff main...HEAD) and get a per-dimension code review |
grok_consult |
Replay a message history for multi-turn — caller owns the thread |
grok_challenge |
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-mcp
Wire it into your MCP host
Claude Code
claude mcp add grok npx -- grok-build-mcp
Or 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 |
|---|---|---|
GROK_MCP_BIN |
grok |
Path to the grok binary |
GROK_MCP_TIMEOUT |
120000 |
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_id - v0.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 build
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。