X Search 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., "@X Search MCP search for AI news from @OpenAI and @GoogleAI in the last week"
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.
x-search-mcp
Minimal MCP server for xAI X search using the Responses API and structured outputs.
Features
Single MCP tool:
x_searchUses xAI Responses API with
x_searchtool callingStructured output parsing + citation normalization
Related MCP server: x-search-mcp
Requirements
Node.js >= 18
XAI_API_KEYenvironment variable
MCP client config
Add the following config to your MCP client:
{
"mcpServers": {
"x-search": {
"command": "npx",
"args": ["-y", "x-search-mcp"],
"env": {
"XAI_API_KEY": "your-key-here"
}
}
}
}Local development
npm install
npm run buildSmoke test (optional)
XAI_API_KEY=your-key-here npm run build
XAI_API_KEY=your-key-here npm run smoke-testNote: this test requires network access and may fail in restricted environments.
MCP Tool
x_search
Searches X with optional filters.
Input
{
"query": "string",
"allowed_x_handles": ["string"],
"excluded_x_handles": ["string"],
"from_date": "YYYY-MM-DD",
"to_date": "YYYY-MM-DD",
"enable_image_understanding": true,
"enable_video_understanding": true,
"include_raw_response": false
}Output
{
"answer": "string",
"citations": ["https://x.com/..."],
"inline_citations": [
{
"url": "https://x.com/...",
"start_index": 10,
"end_index": 42,
"title": "1"
}
],
"raw_response": {}
}Environment Variables
XAI_API_KEY(required)XAI_MODEL(default:grok-4-1-fast)XAI_BASE_URL(default:https://api.x.ai/v1)XAI_TIMEOUT(default:30000)
Notes
allowed_x_handlesandexcluded_x_handlesare mutually exclusive.Date filters must be
YYYY-MM-DDandfrom_datemust be <=to_date.Tool responses are returned as MCP
structuredContent(with a text fallback for display).Citations are normalized from xAI response annotations when available.
Available Tools
1 toolx_searchX SearchBRead-only
Search X posts using xAI's Responses API x_search tool. Returns a normalized answer and citations.
Inputs: query (required), allowed_x_handles, excluded_x_handles, from_date, +4 more. Returns: answer, citations, raw_response, inline_citations
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 confusion or overlap between tools. The tool's purpose is clearly defined as searching X posts using a specific API, making it unambiguous in isolation.
Since there is only one tool, naming consistency is inherently perfect. The tool name 'x_search' follows a clear verb_noun pattern, and there are no other tools to create inconsistency.
A single tool is too few for a server named 'X Search MCP', which implies a search-focused domain. This minimal set lacks basic operations like filtering, sorting, or handling search history, making it feel incomplete and under-scoped.
The server's domain appears to be searching X posts, but with only one search tool, there are significant gaps. Missing functionalities might include advanced search options, result pagination, or related operations like trending topics, making the surface severely incomplete for practical use.
Maintenance
Related MCP Connectors
X/Twitter search, posts, comments, user profiles, user posts/replies and video transcripts.
X (formerly Twitter) posts, profiles, and search for AI agents. Free key, self-minted, no signup.
X (Twitter) search, profiles and trends, YouTube search, video stats and comments, TikTok comments.
Fetch recent public X/Twitter posts by named handle for monitoring, comparison, OSINT, and research.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with X (Twitter) API v2 for posting tweets, searching, liking, retweeting, and more through natural language.23 PyPIMIT
- FlicenseNot gradedqualityCmaintenanceEnables real-time search of X (Twitter) posts, user timelines, and trends using either xAI's Responses API or the official X API v2.4-
- 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-
- AlicenseAqualityDmaintenanceProvides read-only access to X (Twitter) search via xAI's Responses API, returning Grok-generated answers with citations from posts, profiles, and threads.1MIT