grok-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-mcp summarize X posts about Rust programming from @rustlang"
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-mcp
FastMCP server for searching X (Twitter) via the xAI Grok API.
Uses the xAI Responses API with the x_search server-side tool — Grok autonomously searches X, analyses results, and returns a grounded answer with citations.
Tools
search_x
Search X posts and get a summarised answer with source citations.
Parameter | Type | Default | Description |
|
| required | Natural-language search query |
|
|
| X usernames to restrict search to (max 10) |
|
|
| X usernames to exclude (max 10) |
|
|
| Start date filter (ISO 8601, e.g. |
|
|
| End date filter (ISO 8601) |
|
|
| Analyse images in posts |
|
|
| Analyse video clips in posts |
|
|
| Grok model to use |
|
|
| Custom system prompt |
|
|
| Sampling temperature (0-2) |
Returns: { text, citations?, model, usage }
Related MCP server: grok-mcp-server
Setup
Get an API key from console.x.ai
Copy the env template and add your key:
cp .env.example .env # edit .env with your XAI_API_KEYInstall dependencies:
uv sync
Usage with Claude Code
Add to your Claude Code MCP config (~/.claude/settings.json or project .claude/settings.json):
{
"mcpServers": {
"grok": {
"command": "uv",
"args": ["run", "--directory", "/path/to/grok", "python", "server.py"]
}
}
}Model Options
Model | Context | Input $/1M | Output $/1M | Notes |
| 2M | $0.20 | $0.50 | Default — fast, cheap, great for search |
| 256K | $3.00 | $15.00 | Flagship reasoning |
| 128K | $2.00 | $10.00 | Stable general purpose |
Live search costs an additional ~$0.025 per source retrieved.
Available Tools
1 toolsearch_xARead-only
Search X (Twitter) posts using Grok and return a summarised answer with citations.
The xAI server autonomously searches X, analyses results, and synthesises an answer grounded in real posts.
Inputs: query (required), to_date, from_date, temperature, +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 1 tool
With only one tool, there is no possibility of confusing it with another. The tool's purpose is clearly distinct by default.
The tool name 'search_x' follows a clear verb_noun pattern and is a single, coherent naming choice. No inconsistency exists with only one tool.
A single tool is borderline for a server named 'grok-mcp'. While the narrow search-and-summarize scope justifies a single tool, the surface feels thin and could benefit from additional related tools.
The tool covers the core search-and-summarize function well, but lacks complementary operations like retrieving raw posts, user timelines, or trending topics. Minor gaps agents can work around, but not a dead end.
Maintenance
Related MCP Connectors
X/Twitter search, posts, comments, user profiles, user posts/replies and video transcripts.
Search and chat with your X bookmarks, with citations back to the original posts.
X (Twitter) search, profiles and trends, YouTube search, video stats and comments, TikTok comments.
Search X (Twitter) posts and read profiles, followers, trends and X Articles. OAuth sign-in.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables searching X (formerly Twitter) using xAI's Responses API with support for filtering by handles, date ranges, and media understanding, returning structured results with citations.110 npm1MIT
- AlicenseNot gradedqualityDmaintenanceSearch X (formerly Twitter) in real-time from your AI assistant using xAI's Grok API, with no X API account required.1,028 npmMIT
- AlicenseAqualityDmaintenanceEnables real-time search of X.com (Twitter) posts, users, threads, and trends via xAI's Grok API, directly from Claude.549 PyPI4MIT
- AlicenseAqualityDmaintenanceEnables searching X (Twitter) posts, discussions, trends, and web content via Grok API using natural language.310 npm1MIT