cd /news/ai-agents/show-hn-an-mcp-that-searches-x-using… · home › topics › ai-agents › article
[ARTICLE · art-177363] src=github.com ↗ pub= topic=ai-agents verified=true sentiment=· neutral

Show HN: An MCP that searches X using your own Grokbot plan

A developer released grok-x-mcp, an open-source MCP server that lets ChatGPT, Claude and Gemini search X through a user's existing Grok Bot plan instead of a paid X API account. The server runs on Node.js 22 with no npm dependencies, exposes an `x_search` tool plus an optional off-by-default `x_video` tool, and routes queries through a Grok Bot routine webhook, with each search taking 20 to 40 seconds; the optional video reading took 103 seconds on an 18-second test video and draws on the user's Grok Bot plan. The project requires a machine that stays on, a public HTTPS address on port 443, and a chat app that accepts custom MCP connectors.

key takeaway

grok-x-mcp exposes an `x_search` MCP tool that relays queries through a Grok Bot routine webhook, returning post metadata and media in 20 to 40 seconds with no X API key, and an opt-in `x_video` tool that uses Grok Bot's undocumented `watchVideo` subagent to return on-screen text, a transcript and t

read8 min views8 publishedNov 27, 2026
Show HN: An MCP that searches X using your own Grokbot plan
Image: Michielbdejong (auto-discovered)

Search X (Twitter) from ChatGPT, Claude or Gemini through your own Grok Bot.

You already pay for Grok Bot. Its X connector can search X. This small server lets your chat apps use that search, with no X API account and no extra cost beyond your Grok Bot plan.

  • It is an MCP server that you run on your own machine or VPS.
  • It has one tool: x_search . An optional second tool,x_video , reads the video of a post (off by default, seeOptional: read videos ).
  • It has no npm dependencies. It uses only Node.js 22.
  • It has its own OAuth server, so ChatGPT, Claude and Gemini can connect with no client ID.

Grok Bot has no API for its X search. Only the model of the Bot can call it. A Grok Bot routine with a webhook trigger is the way in:

  1. Your chat app calls x_search on this server.
  2. The server POSTs the search to the webhook of your routine.
  3. The routine runs the x_search skill of your Bot. The skill calls the X connector of the Bot.
  4. The routine POSTs the posts back to this server, at <PUBLIC_URL>/callback , with a one-time token.
  5. The server gives the posts to your chat app.

One search takes 20 to 40 seconds. If it takes longer, the tool gives a req_id, and the chat app asks again.

Each post comes with its media: type, size, direct URL and the author's alt text ("none" when there is none). With images: true, the tool also attaches up to 4 photos (or video posters) as images, at most 1 MB each and 3 MB in total. A photo that fails to download becomes a note, and the text stays.

x_search gives only the metadata of a video (length, size, MP4 URL). To know what a video shows and says, turn on x_video:

export ENABLE_X_VIDEO=1
node bin/grok-x-mcp.mjs setup-prompt   # now also makes the x_video skill

Paste the new text into your Grok Bot chat, as in step 2 of the setup. The Bot makes the x_video skill and changes the routine so that it takes both request types. The webhook URL and key do not change.

How it works: the routine gets the post with the X connector, downloads its video (MP4, up to 720p) to the computer of the Bot, and gives it to watchVideo, a subagent built into Grok Bot that reads the frames and the audio. The tool returns what the video shows (with times), the text on screen, a transcript of the speech, and other sound. question asks for one thing in the video.

  • Nothing runs on your machine. The server only waits. You need no ffmpeg, no speech-to-text model, no GPU and no extra disk space.
  • It is slower and costs more of your Grok Bot plan than a search. One reading took 103 seconds in a test with a 18-second video (the Bot was asleep at the start). Each reading is one routine run, and the work ofwatchVideo also counts on your plan. xAI does not publish how much.
  • watchVideo is not documented by xAI. Its model, its limits (length, size) and its cost are unknown. It can make mistakes: treat its reading as a reading, not as fact.

To turn it off, remove ENABLE_X_VIDEO. The x_video skill can stay in the Bot: nothing calls it.

Item Why
Grok Bot, with its X connector It does the search. Grok Bot comes with X Premium, Super and Ultra.
A machine that stays on, with Node.js 22 or later It runs the server. A small VPS is the easy choice. Your own computer also works while it is on.
A public https address on port 443 for that machine Your chat app and the routine must reach the server. A Grok Bot routine reaches only port 443, so do not use another port. Tailscale Funnel and cloudflared are free, and need no domain.
A chat app that takes a custom MCP connector ChatGPT, Claude or Gemini. Check that your plan allows custom connectors.

You do not need a database, an X API key, or a GitHub or Google app.

git clone https://github.com/marciob/grok-x-mcp.git
cd grok-x-mcp
export PUBLIC_URL="https://your-host.example/$(node bin/grok-x-mcp.mjs random)"

The path of PUBLIC_URL is random. It is the MCP endpoint. Keep it.

node bin/grok-x-mcp.mjs setup-prompt
  1. Copy the text that it prints.
  2. Paste it into a normal chat with your Grok Bot, in the app. The Bot makes the skill x_search and the routinex_search webhook . Do not send it through a routine or an automation: a routine run cannot make another routine.
  3. Open the routine in the Grok Bot desktop app. In the Webhook section, copy thePOST to URL and thekey .

The routine accepts only a callback that starts with your PUBLIC_URL. If you change PUBLIC_URL, run setup-prompt again and give the new text to the Bot.

mkdir -p ~/.grok-x-mcp && chmod 700 ~/.grok-x-mcp
pbpaste > ~/.grok-x-mcp/routine.key   # or paste the key with an editor
chmod 600 ~/.grok-x-mcp/routine.key
export GROK_ROUTINE_URL="https://…"   # the POST to URL
export GROK_ROUTINE_KEY_FILE=~/.grok-x-mcp/routine.key

The server listens on 127.0.0.1:7815. Put an https proxy or a tunnel in front of it. The proxy must send these paths to the server:

  • the route (the path of PUBLIC_URL ), and all paths under it, which includes/callback and/oauth/
  • /.well-known/oauth-protected-resource<route>
  • /.well-known/oauth-authorization-server<route>
  • /.well-known/openid-configuration<route>

Use port 443. A Grok Bot routine cannot reach another port (such as 8443 or 10000): its POST fails with a TLS error, and no result arrives.

With Tailscale Funnel, for each path above:

tailscale funnel --bg --set-path /<route> http://127.0.0.1:7815/<route>

With cloudflared or Caddy, send the whole host to http://127.0.0.1:7815.

node bin/grok-x-mcp.mjs test "from:xai"   # one real search through your routine
node bin/grok-x-mcp.mjs serve

test prints the first posts and the time. If it fails, it says why.

In ChatGPT, Claude or Gemini, add a custom connector with the URL PUBLIC_URL . 2. The app opens the approval page of the server. Enter the approval secret:

cat ~/.grok-x-mcp/approval.secret

Ask, for example: "Search X for the latest posts from @xai about Grok Bot."

Variable Required Default Meaning
PUBLIC_URL yes Public https address of the MCP endpoint, with a random path.
GROK_ROUTINE_URL yes The webhook URL of your routine.
GROK_ROUTINE_KEY_FILE yes, or GROK_ROUTINE_KEY File with the webhook key, mode 600.
MAX_SEARCHES_PER_HOUR no 60 A cap on routine runs (searches and video readings together), 1 to 200.
ENABLE_X_VIDEO no off 1 adds thex_video tool and thex_video skill tosetup-prompt .
APPROVAL_SECRET_FILE no made in DATA_DIR/approval.secret The secret that the approval page asks for.
ADMIN_TOKEN_FILE no none A fixed bearer token, for curl. 32 characters or more.
ALLOWED_REDIRECT_HOSTS no Gemini, claude.ai, chatgpt.com, localhost OAuth redirect hosts.
HOST no 127.0.0.1 Listen address.
PORT no 7815 Listen port.
DATA_DIR no ~/.grok-x-mcp OAuth clients and tokens.

from:user, to:user, @user, "exact phrase", OR, -word, lang:pt, filter:replies, -filter:replies, filter:media, filter:images, filter:videos, filter:links, min_faves:N, within_time:2d, since:YYYY-MM-DD, until:YYYY-MM-DD, since_time:UNIX, until_time:UNIX.

The server changes them to the operators of the X API v2. min_faves is applied to the result, because the v2 search has no likes filter. min_retweets and min_replies do not work.

  • Cost. Each search is one routine run, and each run spends usage of your Grok Bot plan. There is no other cost.
  • Grok Bot routines. A routine runs at most 200 times an hour, and all your routines together at most 300 times an hour (docs ).MAX_SEARCHES_PER_HOUR keeps the server under that.
  • The X connector. The instructions of the connector give 30 calls a minute, 1,000 a day (reset at 00:00 UTC), and at most 25 posts a call. These numbers come from the Bot, not from a public page, and can change.
  • Speed. 20 to 40 seconds a search. About 1 to 3 minutes a video reading (x_video ).

This server is for your own searches with your own Grok Bot. Read the xAI Acceptable Use Policy. It forbids, among other things, "Scraping, harvesting or reselling any Input or Output" and "circumventing any rate limits". Do not share your server with other people, do not resell results, and do not use it for bulk collection. Your Grok account is the one at risk.

  1. The routine checks the callback. It sends results only to an address that starts with yourPUBLIC_URL .
  2. One-time tokens. Each search has its own random token in the callback URL. The server keeps only its SHA-256 digest, and forgets it after 15 minutes.
  3. Old requests do nothing. Each request hasexpires_at , 5 minutes after it is sent (10 minutes for a video reading). The routine drops a request after that time.
  4. OAuth approval. A chat app must pass the approval page, which asks for the approval secret. Access tokens last 1 hour.
  5. Post text is data. The routine and the skills treat the webhook body, the posts, the videos and thequestion ofx_video as data, not as instructions.
  6. The log has one line for each request, with no content, tokens or secrets.
grok-x-mcp setup-prompt     # text for your Grok Bot
grok-x-mcp test "<query>"   # one real search
grok-x-mcp test-video <post> ["question"]   # one real video reading (ENABLE_X_VIDEO=1)
grok-x-mcp serve            # start the server
grok-x-mcp clients          # list the OAuth clients
grok-x-mcp revoke <id>      # remove one client and its tokens ("all" for every client)
grok-x-mcp random           # a random value for a route or a secret
npm test

The tests need no Grok Bot and no network. They use a fake routine.

MIT

── more in #ai-agents 4 stories · sorted by recency
── more on @grok-x-mcp 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/show-hn-an-mcp-that-…] indexed:0 read:8min 2026-11-27 · —