x-search
x-search-mcp
一个围绕 xAI 服务端 x_search 工具的轻量级 stdio MCP 包装器。
该服务器从环境变量读取上游配置,并将每次 search 调用转发到兼容 OpenAI/xAI Responses 的端点。它既适用于官方 xAI 端点,也适用于实现相同 Responses + x_search 协议的中间件(如 CLIProxyAPI)。
MCP 接口
服务器名称:
x-search传输:stdio
工具:
search
工具参数:
字段 | 必填 | 默认值 | 说明 |
| 是 | — | 对 Grok 的搜索请求 |
| 否 | 省略 | 最多 20 个;与 |
| 否 | 省略 | 最多 20 个;与 |
| 否 | 省略 | 包含当日,格式为 |
| 否 | 省略 | 包含当日,格式为 |
| 否 |
| 传递给原生 |
| 否 |
| 传递给原生 |
句柄过滤状态为以下三种之一:无过滤(默认)、允许列表或排除列表。同时提供两个列表会被拒绝。
Related MCP server: X Search MCP Server
环境
MCP 客户端会向生成的子进程提供恰好三个上游设置:
XAI_BASE_URL— 例如https://api.x.ai/v1,或一个以/v1结尾、兼容 OpenAI/xAI 的中间件基础 URLXAI_MODEL— 例如grok-4.6XAI_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 服务器、数据库或持久化状态。
This server cannot be installed
Maintenance
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
- AlicenseNot gradedqualityAmaintenanceLive 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.3125Apache 2.0
- AlicenseNot gradedqualityDmaintenanceEnables searching X (Twitter) posts, discussions, trends, and web content via Grok API using natural language.231MIT
- AlicenseAqualityBmaintenanceMCP 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.31MIT
- AlicenseCqualityCmaintenanceEnables Claude or any MCP client to call Grok (xAI) for answers via a simple, phone-first tool.1Apache 2.0
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.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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