X Search MCP Server
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 Server search X for recent posts about climate change"
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 Server
让 Claude Code 搜索 X (Twitter) 实时内容的 MCP Server。
功能
search_x — 搜索 X 上的帖子、讨论、趋势
search_web_via_grok — 通过 Grok 搜索网页
search_combined — 同时搜索 X 和网页
Related MCP server: Grok MCP Server
快速开始
1. 获取 xAI API Key
访问 https://console.x.ai 注册,新用户送 $25 免费额度。
2. 克隆项目
git clone https://github.com/your-repo/x-search-mcp.git
cd x-search-mcp3. 安装依赖
npm install
npm run build4. 配置环境变量
创建 .env 文件:
XAI_API_KEY=your-api-key-here5. 配置 Claude Code
将以下配置添加到 ~/.claude/settings.local.json:
{
"mcpServers": {
"x-search": {
"command": "node",
"args": ["x-search-mcp/build/index.js"],
"env": {
"XAI_API_KEY": "your-api-key-here"
}
}
}
}6. 重启 Claude Code
重启后,你就可以直接让 Claude 搜索 X 上的内容了:
"搜一下 X 上关于 Claude Code 的最新讨论"
费用说明
每次 X 搜索约消耗 5000-7000 tokens ≈ $0.001-0.003
新用户 $25 免费额度足够搜索数千次
可通过数据共享计划获得 $150/月额外免费额度
项目结构
x-search-mcp/
├── src/
│ └── index.ts # 源码
├── build/
│ └── index.js # 编译产物
├── package.json
├── tsconfig.json
└── README.md技术栈
TypeScript
@modelcontextprotocol/sdk
xAI Grok API
License
MIT
Available Tools
3 toolssearch_combinedB
Search both X (Twitter) and the web simultaneously for comprehensive results. Grok will automatically decide which source to use or combine both. Best for getting a complete picture of a topic from social media AND web sources.
Inputs: query (required), to_date, from_date.
search_web_via_grokA
Search the web for real-time information via Grok. Returns summarized results from web pages. Useful for current events, documentation, news, and general knowledge.
Inputs: query (required), allowed_domains.
search_xA
Search X (Twitter) for real-time posts, discussions, and trends on any topic. Powered by Grok's x_search, returns summarized results with original quotes from users. Supports filtering by date range and specific X handles.
Inputs: query (required), to_date, from_date, x_handles.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
search_x and search_web_via_grok clearly target distinct sources, but search_combined is a superset of both, so an agent may reasonably wonder why it would ever pick the narrower tools. The descriptions do clarify intent, keeping them mostly distinguishable.
All three share the search_ prefix, which is good, but the suffixes vary in style (search_x, search_web_via_grok, search_combined) rather than following one predictable pattern. Still readable and mostly consistent.
Three tools is on the thin side for a search server, and one of them (search_combined) arguably subsumes the other two, making the surface feel slightly redundant rather than lean.
The core search domain is covered across X, web, and combined sources, but finer operations like thread retrieval, user/timeline lookup, or pagination are absent. Minor gaps an agent can work around.
Maintenance
Related MCP Connectors
X/Twitter search, posts, comments, user profiles, user posts/replies and video transcripts.
Search X (Twitter) posts and read profiles, followers, trends and X Articles. OAuth sign-in.
X (Twitter) search, profiles and trends, YouTube search, video stats and comments, TikTok comments.
Web search, scraping, Google Trends and data lookups. Paid per call in USDC on Base via x402.
Related MCP Servers
- 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.542 PyPI4MIT
- AlicenseNot gradedqualityDmaintenanceEnables real-time web and Twitter/X search via Grok, returning structured results with source URLs, confidence scores, and key points. Supports multiple output modes, language options, and time range filtering.1,028 npm4MIT
- 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-