Skip to main content
Glama
konarkm

X Search MCP

by konarkm

x-search-mcp

Minimal MCP server for xAI X search using the Responses API and structured outputs.

Features

  • Single MCP tool: x_search

  • Uses xAI Responses API with x_search tool calling

  • Structured output parsing + citation normalization

Related MCP server: x-mcp-server

Requirements

  • Node.js >= 18

  • XAI_API_KEY environment 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 build

Smoke test (optional)

XAI_API_KEY=your-key-here npm run build
XAI_API_KEY=your-key-here npm run smoke-test

Note: this test requires network access and may fail in restricted environments.

MCP Tool

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_handles and excluded_x_handles are mutually exclusive.

  • Date filters must be YYYY-MM-DD and from_date must 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 tool

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 1 tool updatev1.0.0
    • First observedx_search

TDQS

B3.3/5.0
Disambiguation5/5

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.

Naming Consistency5/5

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.

Tool Count2/5

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.

Completeness2/5

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

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables AI assistants to interact with X (Twitter) API v2 for posting tweets, searching, liking, retweeting, and more through natural language.
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables real-time search of X (Twitter) posts, user timelines, and trends using either xAI's Responses API or the official X API v2.
    4
    -
  • F
    license
    A
    quality
    D
    maintenance
    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.
    1
    2
    -

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/konarkm/x-search-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server