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 analyze sentiment on X about the new iPhone launch this 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 Server
X (旧 Twitter) の投稿をリアルタイム検索・分析する MCP (Model Context Protocol) サーバーです。
xAI の Grok API が提供する x_search ツールを利用して、最新の X 投稿を取得します。
提供ツール
ツール名 | 説明 |
| キーワードで X 投稿を検索 |
| 特定ユーザーの投稿を検索 |
| トピックに対する反応・議論を分析(要約 / 感情分析 / 時系列) |
Related MCP server: Grok MCP Server
セットアップ
1. xAI API キーの取得
xAI Console でアカウントを作成し、API キーを取得してください。
2. MCP クライアントに設定
Claude Desktop
claude_desktop_config.json に以下を追加:
{
"mcpServers": {
"x_search": {
"command": "npx",
"args": ["-y", "x-search-mcp"],
"env": {
"XAI_API_KEY": "your-api-key"
}
}
}
}Claude Code
プロジェクトルートの .mcp.json またはCLIで追加:
{
"mcpServers": {
"x_search": {
"command": "npx",
"args": ["-y", "x-search-mcp"],
"env": {
"XAI_API_KEY": "your-api-key"
}
}
}
}ローカルで実行する場合
git clone https://github.com/yourname/x-search-mcp.git
cd x-search-mcp
npm install
npm run buildMCP クライアント設定:
{
"mcpServers": {
"x_search": {
"command": "node",
"args": ["/path/to/x-search-mcp/build/index.js"],
"env": {
"XAI_API_KEY": "your-api-key"
}
}
}
}ツールの詳細
search_posts — 投稿検索
パラメータ | 型 | デフォルト | 説明 |
| string | (必須) | 検索クエリ |
| number | 8 | 最大結果数 (1-25) |
| string | "" | 検索対象ハンドル(カンマ区切り) |
| string | "" | 除外ハンドル(カンマ区切り) |
| string | "" | 開始日 (YYYY-MM-DD) |
| string | "" | 終了日 (YYYY-MM-DD) |
| string | "auto" | 鮮度フィルタ (auto/day/week/month) |
| string | "auto" | 検索モード (auto/latest/popular) |
| string | "ja" | 言語コード |
| boolean | false | 画像理解を有効化 |
| boolean | false | 動画理解を有効化 |
| number | 0.2 | 生成温度 (0.0-1.0) |
| number | 900 | 最大出力トークン数 |
search_user_posts — ユーザー投稿検索
パラメータ | 型 | デフォルト | 説明 |
| string | (必須) | X のユーザー名(@なしで指定) |
| string | "" | 追加の検索キーワード |
| number | 10 | 最大結果数 (1-25) |
| string | "" | 開始日 (YYYY-MM-DD) |
| string | "" | 終了日 (YYYY-MM-DD) |
| string | "auto" | 鮮度フィルタ |
| string | "latest" | 検索モード |
| string | "ja" | 言語コード |
| number | 900 | 最大出力トークン数 |
analyze_topic — トピック分析
パラメータ | 型 | デフォルト | 説明 |
| string | (必須) | 分析対象トピック |
| string | "summary" | 分析観点 (summary/sentiment/timeline) |
| number | 15 | 最大結果数 (1-25) |
| string | "" | 開始日 (YYYY-MM-DD) |
| string | "" | 終了日 (YYYY-MM-DD) |
| string | "week" | 鮮度フィルタ |
| string | "ja" | 言語コード |
| number | 1500 | 最大出力トークン数 |
aspect の種類:
summary— 主要な投稿と全体的な傾向をまとめるsentiment— 肯定・否定・中立の感情を分析するtimeline— 時系列で出来事の流れを追う
環境変数
変数名 | 必須 | デフォルト | 説明 |
| Yes | — | xAI API キー |
| No | — |
|
| No |
| 使用する Grok モデル |
| No |
| API ベース URL |
ライセンス
MIT
Available Tools
3 toolsanalyze_topicC
X上でのトピックに対する反応・議論を分析します。
Inputs: topic (required), aspect, to_date, language, +4 more.
search_postsC
X(旧Twitter)の投稿を検索します。Grok x_search経由で最新ポストを取得します。
Inputs: query (required), to_date, language, freshness, +9 more.
search_user_postsC
特定ユーザーのX投稿を検索します。
Inputs: username (required), query, to_date, language, +5 more.
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_posts and search_user_posts are clearly distinguished by scope (general vs. user-specific). analyze_topic is more analytical but still overlaps somewhat with search_posts since both involve topic-related retrieval and discussion analysis.
All three tools follow a consistent snake_case verb_noun pattern: search_posts, search_user_posts, analyze_topic. The convention is predictable and readable.
Three tools is on the thin side but reasonable for a focused X search server. Each tool has a distinct role in search, user-specific search, and topic analysis.
The core search surface is covered, but there are notable gaps such as retrieving individual post details, user profile lookup, or pagination/filter controls. Agents may hit dead ends for common follow-up actions.
Maintenance
Related MCP Connectors
X (formerly Twitter): X (formerly Twitter) public and private data API for search, posts (Tweets).
Real-time X/Twitter trending topics, live tweet search & user timeline data API ($0.0006/call).
Look up users, search and read posts, and publish or delete your own posts in X.
Twitter: Access real-time Twitter/X data as soon as it's posted! With the Twitter/X AIO API, you.
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.473 npmMIT
- AlicenseAqualityDmaintenanceEnables real-time search of X.com (Twitter) posts, users, threads, and trends via xAI's Grok API, directly from Claude.552 PyPI4MIT
- AlicenseNot gradedqualityDmaintenanceReal-time X/Twitter social intelligence for AI agents and developers, powered by Grok's live search capabilities.3MIT
- AlicenseAqualityDmaintenanceEnables searching X (Twitter) posts, discussions, trends, and web content via Grok API using natural language.31MIT