grok-quorum-mcp
Enables Claude to query Grok as a peer for collaborative reasoning, code reviews, and architecture debates. It provides access to real-time web research and multiple specialized reasoning modes through the xAI API.
README
grok-quorum-mcp
An MCP server that lets Claude query Grok as a quorum peer — enabling two AI systems to debate architecture, review code, and reason together before presenting solutions to the user.
Why a Quorum?
Single-AI workflows have blind spots. When Claude can consult Grok as an equal peer, you get:
- Stronger code review — Two AI perspectives catch more bugs than one
- Better architecture — Claude proposes, Grok challenges (or vice versa), you decide
- Live research — Grok searches the web and X/Twitter in real-time for current information
- Cost control — Four modes from cheap quick answers to expensive deep multi-agent analysis
Privacy & Security
- Runs 100% locally — no telemetry, no analytics, no data collection
- Your API key never leaves your machine except in direct calls to
api.x.ai - Conversation history is in-memory only, cleared when the process exits
- You supply your own xAI API key — we never see it
Installation
npm install -g grok-quorum-mcp
API Key Setup
You need an xAI API key. Get one at console.x.ai.
Option 1: Environment variable (recommended)
export XAI_API_KEY="xai-your-key-here"
Option 2: Key file
echo "xai-your-key-here" > ~/.xai_api_key
chmod 600 ~/.xai_api_key
Security note: Always use
chmod 600on the key file. The server will warn you if permissions are too open.
Configuration
Claude Code
Add to your ~/.mcp.json:
{
"mcpServers": {
"grok-quorum": {
"command": "grok-quorum-mcp",
"env": {
"XAI_API_KEY": "xai-your-key-here"
}
}
}
}
Claude Desktop
Add to your Claude Desktop MCP config:
{
"mcpServers": {
"grok-quorum": {
"command": "npx",
"args": ["-y", "grok-quorum-mcp"],
"env": {
"XAI_API_KEY": "xai-your-key-here"
}
}
}
}
Modes
| Mode | Model | Use Case | Input/Output per 1M | Timeout |
|---|---|---|---|---|
fast |
grok-4-1-fast-reasoning | Quick answers, simple questions | $0.20 / $0.50 | 60s |
code |
grok-4.20-0309-reasoning | Precise code review with reasoning | $2.00 / $6.00 | 2min |
deep |
grok-4.20-multi-agent-0309 | Multi-agent reasoning, architecture | $2.00 / $6.00 | 5min |
deep16 |
grok-4.20-multi-agent-0309 | Maximum depth multi-agent analysis | $2.00 / $6.00 | 10min |
All models support 2M token context (2,000,000 tokens input) and 4M TPM rate limits.
Cost guidance: fast is 10x cheaper than the others. Use it for quick questions. code/deep/deep16 all use 4.20-class models at the same per-token rate — the difference is reasoning depth and multi-agent orchestration.
Tools
| Tool | Description |
|---|---|
grok_query |
Query Grok with mode selection, optional context, and live search |
grok_new_conversation |
Clear conversation history (use when switching topics) |
grok_get_history |
View conversation state and approximate token usage |
grok_get_last_response |
Recover raw API response — cost protection if parsing fails |
Usage Examples
Quick question:
grok_query(message: "What's the best way to handle WebSocket reconnection?", mode: "fast")
Code review with context:
grok_query(
message: "Review this for security issues and race conditions",
context: "<file contents here>",
mode: "code"
)
Architecture debate:
grok_query(
message: "We're choosing between PostgreSQL and DynamoDB for our event store. Challenge my assumptions.",
mode: "deep",
new_conversation: true
)
Live research:
grok_query(
message: "What are the latest MCP server best practices?",
mode: "fast",
search: "web"
)
Advanced Configuration
Override models via environment variables:
| Variable | Description | Default |
|---|---|---|
XAI_API_KEY |
xAI API key (required) | — |
GROK_MODEL_FAST |
Model for fast mode | grok-4-1-fast-reasoning |
GROK_MODEL_CODE |
Model for code mode | grok-4.20-0309-reasoning |
GROK_MODEL_DEEP |
Model for deep/deep16 modes | grok-4.20-multi-agent-0309 |
GROK_SYSTEM_PROMPT |
Custom system prompt | (built-in) |
Troubleshooting
| Issue | Fix |
|---|---|
| "No xAI API key found" | Set XAI_API_KEY env var or create ~/.xai_api_key |
| Empty responses | Run grok_get_last_response to inspect the raw API payload |
| Timeouts on deep mode | Try fast mode first, or simplify the question |
| Model access errors | Check your xAI plan supports the requested model |
Built by Xega
This project is built and maintained by Xega.ai — an AI company building intelligent systems that evolve with your essence.
We built this because we believe the best AI workflows involve multiple perspectives. Claude and Grok as equals, with the human as the final decision-maker.
Contributing
Issues and PRs welcome at github.com/flycory/grok-quorum-mcp.
License
MIT — see LICENSE.
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。