Skip to main content
Glama
sandlong
by sandlong

x-search-mcp

一个围绕 xAI 服务端 x_search 工具的轻量级 stdio MCP 包装器。

该服务器从环境变量读取上游配置,并将每次 search 调用转发到兼容 OpenAI/xAI Responses 的端点。它既适用于官方 xAI 端点,也适用于实现相同 Responses + x_search 协议的中间件(如 CLIProxyAPI)。

MCP 接口

  • 服务器名称:x-search

  • 传输:stdio

  • 工具:search

工具参数:

字段

必填

默认值

说明

query

对 Grok 的搜索请求

allowed_x_handles

省略

最多 20 个;与 excluded_x_handles 互斥

excluded_x_handles

省略

最多 20 个;与 allowed_x_handles 互斥

from_date

省略

包含当日,格式为 YYYY-MM-DD

to_date

省略

包含当日,格式为 YYYY-MM-DD

enable_image_understanding

true

传递给原生 x_search

enable_video_understanding

true

传递给原生 x_search

句柄过滤状态为以下三种之一:无过滤(默认)、允许列表或排除列表。同时提供两个列表会被拒绝。

Related MCP server: X Search MCP Server

环境

MCP 客户端会向生成的子进程提供恰好三个上游设置:

  • XAI_BASE_URL — 例如 https://api.x.ai/v1,或一个以 /v1 结尾、兼容 OpenAI/xAI 的中间件基础 URL

  • XAI_MODEL — 例如 grok-4.6

  • XAI_API_KEY — 配置的上游所接受的 Bearer 凭据

该实现仅使用 Responses API。它会发送一个原生 x_search 工具,并通过 tool_choice: "required" 强制使用工具。

安装 / 运行

对于支持 stdio MCP 服务器的客户端,可以直接从 GitHub 运行:

npx -y github:sandlong/x-search-mcp

并在该 MCP 服务器的 env 配置中提供这三个变量。例如:

{
  "command": "npx",
  "args": ["-y", "github:sandlong/x-search-mcp"],
  "env": {
    "XAI_BASE_URL": "https://api.x.ai/v1",
    "XAI_MODEL": "grok-4.6",
    "XAI_API_KEY": "..."
  }
}

开发

npm install
npm run typecheck
npm test
npm run build

行为

  • 无 Chat Completions 兼容层。

  • 不重写结果,也不做引用清理;xAI/中间件的输出文本将原样返回。

  • 非 2xx 的上游响应体会原样返回给 MCP 客户端。

  • 无 HTTP 服务器、数据库或持久化状态。

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

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

Related MCP Servers

  • A
    license
    Not graded
    quality
    A
    maintenance
    Live 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.
    31
    25
    Apache 2.0
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables searching X (Twitter) posts, discussions, trends, and web content via Grok API using natural language.
    23
    1
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    MCP server for live X/Twitter and web search, driven by your locally logged-in Grok CLI and leveraging your X Premium or SuperGrok subscription quota.
    3
    1
    MIT

View all related MCP servers

Related MCP Connectors

  • Agentic search over your Dewey document collections from any MCP-compatible client.

  • Serper MCP — wraps the Serper Google Search API (serper.dev)

  • x402-gated web search gateway. Tools: search, search_enriched.

View all MCP Connectors

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/sandlong/x-search-mcp'

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