Grok2API MCP Server
English · 中文
An MCP (Model Context Protocol) server that provides real-time web search via Grok. Returns structured results with source URLs, confidence scores, key points, and multi-language support.
接入你的智能体
從發布者安裝。不是 PlugMCP 端點。
遠端 URL 還是本機指令? 兩種安裝方式的差異
來自發布者
English · 中文
An MCP (Model Context Protocol) server that provides real-time web search via Grok. Returns structured results with source URLs, confidence scores, key points, and multi-language support.
MCP server for real-time web search via Grok — structured results with sources, confidence scores, and multi-language support
Claude / Cursor / etc. ──MCP──> grok-mcp-server ──HTTP──> grok2api ──> Grok
This server bridges MCP clients to a grok2api-compatible backend, exposing Grok's real-time web search through an OpenAI-compatible API.
brief, analyst, raw24h, 7d, 30d, allgrok_stats toolYou need a running grok2api instance (or any OpenAI-compatible API endpoint backed by a Grok model with web search).
It is strongly recommended to use a secondary/alt Grok account for this, not your primary account.
Choose the method that fits your environment:
Requires Docker and Docker Compose installed on your server.
git clone https://github.com/chenyme/grok2api
cd grok2api
docker compose up -d
The admin panel will be available at http://your-server-ip:8000/admin (default password: grok2api).
Requires Python 3.11+ and uv.
# Install uv if you don't have it
brew install uv
# Clone and run
git clone https://github.com/chenyme/grok2api
cd grok2api
uv sync
uv run main.py
The admin panel will be at http://localhost:8000/admin (default password: grok2api).
Requires Python 3.11+ and uv.
# Install uv (PowerShell)
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
# Clone and run
git clone https://github.com/chenyme/grok2api
cd grok2api
uv sync
uv run main.py
The admin panel will be at http://localhost:8000/admin (default password: grok2api).
Requires Python 3.11+ and uv.
# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
# Clone and run
git clone https://github.com/chenyme/grok2api
cd grok2api
uv sync
uv run main.py
The admin panel will be at http://localhost:8000/admin (default password: grok2api).
For cloud deployments (Vercel, Render), see the grok2api README.
F12 or Cmd+Opt+I)sso or sso-rwhttp://your-server:8000/admin)The GROK_API_KEY in your .env is the admin key configured in grok2api (the app.app_key value, default: grok2api).
Option A: Global install (recommended)
git clone https://github.com/wousp112/grok2api-mcp-server.git
cd grok-mcp-server
cp .env.example .env
# Edit .env with your API URL and key
npm install
npm link
Option B: Local install
git clone https://github.com/wousp112/grok2api-mcp-server.git
cd grok-mcp-server
cp .env.example .env
# Edit .env with your API URL and key
npm install
Copy .env.example to .env and fill in your values:
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"grok-search": {
"command": "grok-mcp-server",
"args": [],
"env": {
"PATH": "/usr/local/bin:/usr/bin:/bin"
}
}
}
}
{
"mcpServers": {
"grok-search": {
"command": "grok-mcp-server",
"args": []
}
}
}
Add to .cursor/mcp.json:
{
"mcpServers": {
"grok-search": {
"command": "grok-mcp-server",
"args": []
}
}
}
Note: If you skipped
npm link, use the full path instead:"command": "/path/to/grok-mcp-server/index.js"
grok_web_searchSearch the web or Twitter/X via Grok with structured output.
Response structure:
{
"summary": "Concise factual summary",
"key_points": [
{ "point": "Key finding", "source_urls": ["https://..."] }
],
"sources": [
{
"title": "Article Title",
"url": "https://...",
"publisher": "Publisher Name",
"published_at": "2025-01-01T00:00:00Z",
"relevance_note": "Why this source matters"
}
],
"confidence": 0.85,
"as_of": "2025-01-01T12:00:00Z",
"notes": "Additional context or caveats"
}
grok_statsReturns runtime metrics: call counts, error distribution, uptime.
MIT
MCP server for real-time web search via Grok — structured results with sources, confidence scores, and multi-language support
工具
尚無工具清單。遠端伺服器會在首次健康檢查後取得工具清單。
常見問題
在本頁複製適用於 Cursor、Claude Desktop、Claude Code 或 VS Code 的 stdio 設定。它使用發布者的安裝方式,而不是 PlugMCP 代理伺服器。
這筆記錄未列出必要的環境變數。
Grok2api 透過 stdio 在本機執行。
上次檢查時間:2026-10-28。 MCP server for real-time web search via Grok — structured results with sources, confidence scores, and multi-language support