agent-x-search
Summary: This server gives an agent native X/Twitter search via Grok, returning cited original posts with transparent usage.
Run
x_searchto search X/Twitter through one Grok Responses request with original-post citations.Provide a required
query(1–6000 chars) as the search term.Control result count with
count(1–20, default 5; guidance only).Filter by users with
include_handlesorexclude_handles(mutually exclusive, up to 20 handles each).Restrict results by date range using inclusive
from_dateandto_date(YYYY-MM-DD).Choose media type with
media(none,images,videos,both).Set response depth with
detail(brief,standard,detailed).Receive structured results including
answer, citations, citation status, backend, model, and elapsed time; no automatic retries occur.Use either subscription OAuth or paid xAI API-key mode depending on configuration.
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., "@agent-x-search Search X for recent posts about AI agents and include original post URLs."
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.
Agent X Search
Give your agent native X search, with original-post citations and transparent usage.
中文 · Client setup · Recorded walkthrough · Measured overhead
An unofficial, local stdio MCP server. Existing Grok subscription login by default; explicitly selected xAI API keys are also supported. No browser automation, HTTP server, background service, build step or runtime dependencies.
Version 0.1.1 — GitHub release archive · npm versions. If npm does not yet list 0.1.1, install the GitHub .tgz archive using the fixed-path instructions below. API-key mode is experimental and has not been live-tested. Verification matrix.
A 30-second walkthrough
Ask your agent:
Find one recent official Grok feature announcement on X. Include its date and original post URL.
A recorded subscription CLI run returned:
24 Aug 2026 — Grok Voice Think Fast 2.0 announcement.
Original post: https://x.com/SpaceXAI/status/2091987538999197752
That call took 32.794 seconds, one model round. This is historical output from the local predecessor, not a speed promise or a new run of this candidate. Provenance and transcript replay.
Related MCP server: grok-build-plugin
Connect
Requires Node.js 24.5+, a local MCP client, network access, and an eligible Grok subscription session or xAI API key. Zero runtime dependencies does not mean zero account requirements or free searches.
Quick start:
codex mcp add agent-x-search -- npx -y agent-x-search@0.1.1 serve
claude mcp add --transport stdio agent-x-search -- npx -y agent-x-search@0.1.1 servex_search defaults to 300 seconds; opt-in x_deep_search defaults to 900 seconds. Both limits are editable with --timeout-ms / --deep-timeout-ms (or their environment variables, 1 second to 1 hour). Generate a complete config without changing files:
npx -y agent-x-search@0.1.1 config --client codexOther targets: claude-code, cursor, vscode, opencode, cline. One package, not six plugins. Client setup and verification levels.
Fixed-path installation
Avoid runtime npx lookups by installing into a directory you choose:
npm install --prefix /absolute/path/to/agent-tools --omit=dev --ignore-scripts agent-x-search@0.1.1
node --use-env-proxy /absolute/path/to/agent-tools/node_modules/agent-x-search/bin/agent-x-search.mjs config --client codex --localOn Windows, use your own absolute path and quote paths containing spaces. Paste the generated config into your client. It starts the installed file directly; no global npm installation or OS startup item is needed. To install the GitHub archive, use the downloaded agent-x-search-0.1.1.tgz instead of the package name.
From source: node --use-env-proxy bin/agent-x-search.mjs serve. Only contributors running tests need npm ci.
Authentication and billing
Default OAuth: install and sign in with the official Grok CLI, then run grok models to populate its metadata. This package reads that existing session into memory, implements no login, and copies no tokens. If expired, official grok models handles refresh. Ordinary searches do not launch the CLI.
The subscription proxy is an internal compatibility surface, not a guaranteed public third-party API. Eligibility, quota and protocol behavior can change. This project is not affiliated with xAI or X and does not promise unlimited or free access.
Explicit API-key mode: use serve --auth api-key with XAI_API_KEY in the MCP server environment. It calls the official xAI Responses endpoint and incurs API charges; no Grok CLI is required. This path has offline contract coverage, not live validation. Never put a key in a prompt or issue.
There is no automatic billing switch. Setting XAI_API_KEY alone does not change OAuth mode. Failed or uncertain requests are never retried or sent to another backend.
npx -y agent-x-search@0.1.1 doctor
npx -y agent-x-search@0.1.1 doctor --auth api-keyDoctor only reads local state. It does not search, refresh tokens, or validate credentials against xAI.
Tools
Tool | Behavior |
| Default and normally the only tool. One Responses request; xAI may perform several internal searches. |
| Opt in with |
Both default to Grok 4.6; --model MODEL selects another model available to your auth mode without a discovery request. API-key mode rejects --enable-deep to avoid mixing billing modes.
Inputs: query, include_handles or exclude_handles, inclusive from_date/to_date, desired count (1–20), media (none, images, videos, both), and detail (brief, standard, detailed). Count/detail are guidance, not retrieval guarantees. Native parameter contract.
Results retain answer, x_citations, citation_count, citation_status, backend, model, elapsed_ms; add auth_mode, usage, and incomplete. Missing usage is unknown, not zero. Verify claims against original posts. MCP structured content includes a JSON text fallback for compatibility; client handling determines actual context usage.
Configure and troubleshoot
Flags override environment variables, then defaults. No project config file is needed. --help and generated client configs show both timeout controls; generated Codex/OpenCode/Cline configs give the selected server limit another 30 seconds to return. All settings and errors.
reauth_required: use officialgrok modelsorgrok login.cli_metadata_required: rungrok models; version headers come from its cache.cli_unavailable: install official Grok CLI or set--grok-cli; direct API-key search does not need it.unsafe_cli_integrations: deep mode refuses your discovered hooks/plugins/MCP/LSP integrations; direct search is independent of that toolset.rate_limited: wait for quota availability; no retry occurred.request_uncertain: a timeout may already have consumed quota or API spend. Do not assume it was free.Startup/discovery failure: run doctor as the same OS user, check Node/paths, then the client's MCP diagnostics. No model call is needed to diagnose transport.
Connection timeout around ten seconds: your MCP client may not inherit terminal proxy variables. Explicitly configure HTTP_PROXY/HTTPS_PROXY/NO_PROXY in its server environment and reload the connection. Version 0.1.1 adds opt-in proxy config export and
doctor --network; see proxy setup. Upgrade from 0.1.0 to use these flags. Directly connected networks need no proxy configuration.
No telemetry or persistent result cache. Grok may retain its normal CLI session metadata. See engineering evidence, architecture and limits, and contributing. MIT licensed.
Available Tools
1 toolx_searchARead-only
Search X/Twitter with native Grok search. One Responses request, original-post citations, explicit no-source status and reported usage. No automatic retry. Uses the configured subscription or paid API mode.
Inputs: query (required), count, media, detail, +4 more.
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 overlap or confusion between tools. The single x_search tool has a clear, singular purpose: searching X/Twitter.
The tool name x_search uses a clear snake_case verb_noun convention that directly reflects its function. With only one tool, there are no conflicting naming patterns to assess.
A single tool is on the thin side, but it is appropriate for a server dedicated exclusively to search functionality. The tool is well-scoped and earns its place.
For the stated purpose of searching X/Twitter, the tool provides complete coverage of the domain. There are no obvious missing search-related operations, and the description suggests a robust implementation.
Maintenance
Related MCP Connectors
Hosted MCP server from TwitterAPI.io that gives AI agents read-only access to Twitter/X data. 12 tools: tweet search with X operators, user profiles, a user's latest tweets, followers and followings, replies, quotes, retweeters, mentions and trends. Connect at https://mcp.twitterapi.io/mcp with a TwitterAPI.io API key or account sign-in; usage is paid per result returned. Separately, TwitterAPI.io also offers x402 pay-per-call HTTP endpoints (tweet search, user info, a user's latest tweets) paid in USDC on Base or Solana with no account or API key; see https://docs.twitterapi.io/x402-pay-per-call. The MCP server itself uses an API key or sign-in.
Real-time X/Twitter search, tweets, threads, replies & profiles MCP (-87% compact tokens & x402).
Real-time X/Twitter search, tweets, threads, replies & profiles MCP (-87% compact tokens & x402).
X/Twitter search, posts, comments, user profiles, user posts/replies and video transcripts.
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
- 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.41 npm29Apache 2.0
- AlicenseBqualityDmaintenanceEnables interacting with Twitter/X through natural language, including searching tweets, posting, sending DMs, and managing timelines via any MCP client.8MIT
- 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-