x-search
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., "@x-searchsearch X for recent posts about the new Grok release"
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.
x-search-mcp
A Cloudflare Worker that exposes xAI's server-side x_search as a Streamable HTTP MCP server.
The search tool forwards requests to an OpenAI/xAI Responses-compatible endpoint, including compatible middleware such as CLIProxyAPI. It keeps the original tool arguments and returns the upstream text as received.
MCP interface
Server name:
x-searchTransport: Streamable HTTP
Endpoint:
/mcpby default, or/<SECRET_PATH>/mcpwhen the optional secret is setTool:
search
Tool arguments:
Field | Required | Default | Notes |
| yes | — | Search request for Grok |
| no | omitted | Max 20; mutually exclusive with |
| no | omitted | Max 20; mutually exclusive with |
| no | omitted | Inclusive |
| no | omitted | Inclusive |
| no |
| Passed to native |
| no |
| Passed to native |
The handle-filter state is one of three choices: no filter (default), an allow-list, or an exclude-list. Supplying both lists is rejected.
Related MCP server: bluex-mcp
Worker environment
Production runtime configuration is managed in the Cloudflare dashboard, which is the canonical source for variables and secrets. wrangler.jsonc uses keep_vars: true and intentionally does not declare runtime variables or secrets.
Current settings used by the Worker:
XAI_BASE_URL(required variable): for examplehttps://api.x.ai/v1, or a compatible middleware base URL ending in/v1.XAI_MODEL(required variable): the model passed to the Responses API.XAI_API_KEY(required secret): bearer credential accepted by the configured upstream.SECRET_PATH(optional secret): a hard-to-guess URL prefix. If set,/mcpreturns 404, and the root health response does not disclose the secret.
The SECRET_PATH value is a shared URL secret, not user-specific authentication. Anyone with the full endpoint URL can use the upstream credential. Do not publish the complete URL.
Only the Responses API is used. Each call sends one native x_search tool with tool_choice: "required". Non-2xx upstream response bodies are returned to the MCP client.
Development
npm ci
npm run build
npm testFor local development, put the required upstream values in a git-ignored .dev.vars file and run npx wrangler dev. Add SECRET_PATH there as well when testing the optional secret path locally. Do not put production secrets on the command line.
Deployment
Configure production variables and secrets on the existing Worker in the Cloudflare dashboard. Cloudflare Workers Builds connects this repository's main branch to the existing x-search-mcp Worker; pushing to main runs the tests and type-check, then deploys it. Because wrangler.jsonc sets keep_vars: true, dashboard-managed variables are preserved across deployments; Worker secrets are also kept remotely rather than stored in Git.
For a manual deployment, run npm run deploy.
MCP clients should use the full Streamable HTTP endpoint URL, with no npx command or stdio settings.
This server cannot be deployed
Maintenance
Related MCP Connectors
Live AI-native web search with citations. One tool for every MCP client. Flat per-request pricing.
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.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables searching X (Twitter) posts, discussions, trends, and web content via Grok API using natural language.314 npm1MIT
- AlicenseAqualityCmaintenanceMCP 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
- AlicenseAqualityCmaintenanceProvides read-only access to X (Twitter) search via xAI's Responses API, returning Grok-generated answers with citations from posts, profiles, and threads.1MIT
- AlicenseAqualityBmaintenanceEnables Grok native web search, X (Twitter) search, and Jina Reader web page fetching as read-only MCP tools.345 npmMIT