grok-mcp
grok-mcp
封装 xAI Grok API 的 MCP 服务器。允许 Claude 和其他 AI 智能体将思考、规划和实时搜索任务委托给 Grok。
设置
npm install -g grok-mcp或者直接使用 npx:
npx grok-mcp你需要从 console.x.ai 获取 xAI API 密钥。
在 Claude Code 中配置
添加到你项目的 .mcp.json 中:
{
"mcpServers": {
"grok": {
"type": "stdio",
"command": "npx",
"args": ["grok-mcp"],
"env": {
"XAI_API_KEY": "your-xai-api-key"
}
}
}
}工具:ask_grok
支持多种用例的单一工具。
参数
参数 | 类型 | 必需 | 描述 |
| string | 是 | 给 Grok 的问题或任务 |
| string | 否 | 自定义系统提示词 |
| string | 否 | 使用的模型(默认: |
| boolean | 否 | 启用实时网页搜索 |
| boolean | 否 | 启用 X/Twitter 搜索 |
可用模型
grok-4.20-reasoning— 旗舰推理模型(默认)grok-4.20-non-reasoning— 快速,无推理grok-4.20-multi-agent— 多智能体模式,非常适合架构和规划grok-4.1-fast-reasoning— 更经济的推理模型grok-4.1-fast-non-reasoning— 最便宜,速度快
示例
提问:
prompt: "What are the trade-offs between microservices and monoliths?"深度架构规划(多智能体):
prompt: "Design a system architecture for a real-time collaborative editor"
model: "grok-4.20-multi-agent"搜索网页:
prompt: "What happened in tech news today?"
web_search: true搜索 X/Twitter:
prompt: "What are people saying about the new React release?"
x_search: true许可证
MIT
This server cannot be installed
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/PKWadsy/grok-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server