grok-live-mcp
Click on "Deploy 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-live-mcp what are people saying on X about the latest Grok release today?"
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-live-mcp
A lightweight Python Model Context Protocol (MCP) server that exposes xAI Grok's real-time Web Search, X (Twitter) Search, and Code Reasoning tools via xAI's Responses API (/v1/responses) to Cursor, Claude Desktop, and local AI agents.
Why Responses API?
xAI retired the legacy search_parameters Chat Completions beta on January 12, 2026. Plain /v1/chat/completions calls do not perform live web or X retrieval. This server uses AsyncOpenAI against https://api.x.ai/v1 with /v1/responses server-side agentic tools (web_search, x_search, and code_interpreter), returning structured answers with deduplicated citation links.
Related MCP server: grok-build-plugin
Architecture
flowchart LR
A["Cursor / Claude Desktop / Local Agent"] <-->|"MCP (STDIO JSON-RPC)"| B["grok-live-mcp (FastMCP)"]
B -->|"AsyncOpenAI /v1/responses"| C["xAI Grok API"]
C --> D["web_search"]
C --> E["x_search"]
C --> F["code_interpreter"]Available MCP Tools
Tool | Description | Default Model |
| Real-time Web Search, X Search, or both, with optional domain and UTC date filters ( |
|
| Dedicated X (Twitter) search with handle allow/exclude filters (up to 20), date windows, and optional image/video understanding. |
|
| Deep coding, debugging, and quantitative reasoning with optional server-side |
|
Installation
Prerequisites
Python 3.10+
An xAI API key from console.x.ai
Setup with uv (recommended)
git clone https://github.com/<olivia-1106>/grok-live-mcp.git
cd grok-live-mcp
cp .env.example .env
# Edit .env and set XAI_API_KEY
uv venv
uv pip install -e ".[dev]"Setup with pip
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"IDE & Client Configuration
Cursor (~/.cursor/mcp.json or .cursor/mcp.json)
{
"mcpServers": {
"grok-live-mcp": {
"command": "uv",
"args": [
"--directory",
"/ABSOLUTE/PATH/TO/grok-live-mcp",
"run",
"grok-live-mcp"
],
"env": {
"XAI_API_KEY": "xai-your-api-key-here"
}
}
}
}Claude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"grok-live-mcp": {
"command": "/ABSOLUTE/PATH/TO/grok-live-mcp/.venv/bin/grok-live-mcp",
"env": {
"XAI_API_KEY": "xai-your-api-key-here"
}
}
}
}Environment Variables
Variable | Default | Description |
| (required) | Your xAI API key. |
|
| xAI OpenAI-compatible base URL. |
|
| Default model for |
|
| Default model for |
|
| HTTP request timeout in seconds. |
|
| Logging verbosity (always written to |
Development & Testing
ruff check .
ruff format --check .
pytest -vLicense
MIT
Available Tools
3 toolsask_grok_realtimeA
Query Grok with real-time Web Search and/or X Search via xAI's Responses API.
Args: query: Question or research prompt requiring up-to-date information. search_mode: Which live search tools to enable ("both", "web", or "x"). model: Optional xAI model ID (defaults to XAI_DEFAULT_MODEL / grok-4.3). allowed_domains: Restrict web search to at most 5 domains (mutually exclusive with excluded_domains). excluded_domains: Exclude up to 5 domains from web search. from_date: Optional X search start date in YYYY-MM-DD format (UTC). to_date: Optional X search end date in YYYY-MM-DD format (UTC, exclusive).
Inputs: query (required), model, to_date, from_date, +3 more. Returns: result
grok_code_reasoningA
Use Grok's frontier reasoning model for debugging, architecture review, or quantitative analysis.
Args: prompt: Code snippet, bug report, math/data problem, or architecture question. model: Optional xAI model ID (defaults to XAI_REASONING_MODEL / grok-4.7). enable_code_interpreter: Allow Grok to execute Python on xAI's server-side sandbox to verify calculations. enable_web_search: Also enable live web search (e.g., to verify latest library APIs or CVEs).
Inputs: prompt (required), model, enable_web_search, enable_code_interpreter. Returns: result
search_x_postsA
Search real-time public posts, threads, and sentiment on X (Twitter) via Grok.
Args: query: Topic, keywords, or question to investigate on X. model: Optional xAI model ID (defaults to XAI_DEFAULT_MODEL / grok-4.3). allowed_x_handles: Only search posts from these X handles (max 20, with or without '@'). excluded_x_handles: Ignore posts from these X handles (max 20, mutually exclusive with allowed_x_handles). from_date: Start date in YYYY-MM-DD format (00:00 UTC). to_date: End date in YYYY-MM-DD format (exclusive, 00:00 UTC). enable_image_understanding: Allow Grok to inspect images attached to X posts. enable_video_understanding: Allow Grok to inspect videos attached to X posts.
Inputs: query (required), model, to_date, from_date, +4 more. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a clear primary domain: X post search, general real-time web/X research, and code/math reasoning. The main ambiguity is that ask_grok_realtime with search_mode='x' overlaps with search_x_posts, though the latter is more specialized with X handle filters and sentiment focus.
All names use snake_case and are readable, but the pattern is mixed: two begin with verbs (search_x_posts, ask_grok_realtime) while grok_code_reasoning is a noun phrase. The deviation is minor but keeps it from a fully predictable verb_noun convention.
Three tools is a reasonably tight surface for a focused Grok live-search and reasoning server, and each tool covers a distinct capability. It is slightly minimal but not obviously missing a tool that would justify a larger set.
The server covers its apparent core: X post search, live web/X research, and code-oriented reasoning. Minor gaps exist, such as no dedicated single-post retrieval or general non-search Grok chat tool, but agents can work around these via the provided tools.
Maintenance
Related MCP Connectors
Real-time web search, reasoning, and research through Perplexity's API
Web search, Google SERP, page extraction to markdown and cited answers for AI agents.
Live web search and fetch plus Twitter, Reddit, GitHub, Amazon, YouTube, Telegram data. No API keys.
Long-term memory for Claude, ChatGPT, Cursor: search, save and organize notes, links, docs, videos.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables real-time search of X.com (Twitter) posts, users, threads, and trends via xAI's Grok API, directly from Claude.552 PyPI4MIT
- AlicenseNot gradedqualityCmaintenanceLive X (Twitter) and web search for any coding agent through your existing Grok subscription. Exposes a grok_search MCP tool, so no X API key or X developer account is needed.111 npm29Apache 2.0
- FlicenseAqualityDmaintenanceEnables searching X (Twitter) using the xAI Grok API to get summarised answers with citations. Supports filtering by handles, date range, and image/video understanding.12-
- AlicenseAqualityDmaintenanceEnables searching X (Twitter) posts, discussions, trends, and web content via Grok API using natural language.31MIT