Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
6,000+ web scrapers for your AI agent, start free logo6,000+ web scrapers for your AI agent, start free

Apify gives your agent live web data: 6,000+ prebuilt scrapers and actors, MCP-ready. Sign up free with $5 in usage credits.

Try Apify free
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 48,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

Enables searching X (Twitter) using the xAI Grok API to get summarised answers with citations. Supports filtering by handles, date range, and image/video understanding.

README.md

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 | |-----------|------|---------|-------------| | query | str | required | Natural-language search query | | allowed_handles | list[str] | None | X usernames to restrict search to (max 10) | | excluded_handles | list[str] | None | X usernames to exclude (max 10) | | from_date | str | None | Start date filter (ISO 8601, e.g. 2026-02-01) | | to_date | str | None | End date filter (ISO 8601) | | enable_image_understanding | bool | True | Analyse images in posts | | enable_video_understanding | bool | False | Analyse video clips in posts | | model | str | grok-4-1-fast | Grok model to use | | system_prompt | str | None | Custom system prompt | | temperature | float | None | Sampling temperature (0-2) |

Returns: { text, citations?, model, usage }

Setup

  1. Get an API key from console.x.ai
  1. Copy the env template and add your key:
   cp .env.example .env
   # edit .env with your XAI_API_KEY
  1. Install 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 | |-------|---------|-----------|------------|-------| | grok-4-1-fast | 2M | $0.20 | $0.50 | Default — fast, cheap, great for search | | grok-4.1 | 256K | $3.00 | $15.00 | Flagship reasoning | | grok-3 | 128K | $2.00 | $10.00 | Stable general purpose |

Live search costs an additional ~$0.025 per source retrieved.

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use Search servers.