{"slug": "show-hn-an-mcp-that-searches-x-using-your-own-grokbot-plan", "title": "Show HN: An MCP that searches X using your own Grokbot plan", "summary": "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.", "body_md": "Search X (Twitter) from ChatGPT, Claude or Gemini through your own Grok Bot.\n\nYou 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.\n\n- It is an MCP server that you run on your own machine or VPS.\n- It has one tool: `x_search` . An optional second tool,`x_video` , reads the video of a post (off by default, see[Optional: read videos](#optional-read-videos) ).\n- It has no npm dependencies. It uses only Node.js 22.\n- It has its own OAuth server, so ChatGPT, Claude and Gemini can connect with no client ID.\n\nGrok 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:\n\n1. Your chat app calls `x_search` on this server.\n2. The server POSTs the search to the webhook of your routine.\n3. The routine runs the `x_search` skill of your Bot. The skill calls the X connector of the Bot.\n4. The routine POSTs the posts back to this server, at `<PUBLIC_URL>/callback` , with a one-time token.\n5. The server gives the posts to your chat app.\n\nOne search takes 20 to 40 seconds. If it takes longer, the tool gives a `req_id`, and the chat app asks again.\n\nEach 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.\n\n`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`:\n\n```\nexport ENABLE_X_VIDEO=1\nnode bin/grok-x-mcp.mjs setup-prompt   # now also makes the x_video skill\n```\n\nPaste 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.\n\nHow 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.\n\n- **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.\n- **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 of`watchVideo` also counts on your plan. xAI does not publish how much.\n- **`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.\n\nTo turn it off, remove `ENABLE_X_VIDEO`. The `x_video` skill can stay in the Bot: nothing calls it.\n\n| Item | Why | \n|---|---|\n| Grok Bot, with its X connector | It does the search. Grok Bot comes with X Premium, Super and Ultra. | \n| 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. | \n| 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. | \n| A chat app that takes a custom MCP connector | ChatGPT, Claude or Gemini. Check that your plan allows custom connectors. | \n\nYou do not need a database, an X API key, or a GitHub or Google app.\n\n```\ngit clone https://github.com/marciob/grok-x-mcp.git\ncd grok-x-mcp\nexport PUBLIC_URL=\"https://your-host.example/$(node bin/grok-x-mcp.mjs random)\"\n```\n\nThe path of `PUBLIC_URL` is random. It is the MCP endpoint. Keep it.\n\n```\nnode bin/grok-x-mcp.mjs setup-prompt\n```\n\n1. Copy the text that it prints.\n2. Paste it into a normal chat with your Grok Bot, in the app. The Bot makes the skill `x_search` and the routine`x_search webhook` . Do not send it through a routine or an automation: a routine run cannot make another routine.\n3. Open the routine in the Grok Bot desktop app. In the **Webhook** section, copy the**POST to** URL and the**key** .\n\nThe 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.\n\n```\nmkdir -p ~/.grok-x-mcp && chmod 700 ~/.grok-x-mcp\npbpaste > ~/.grok-x-mcp/routine.key   # or paste the key with an editor\nchmod 600 ~/.grok-x-mcp/routine.key\nexport GROK_ROUTINE_URL=\"https://…\"   # the POST to URL\nexport GROK_ROUTINE_KEY_FILE=~/.grok-x-mcp/routine.key\n```\n\nThe 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:\n\n- the route (the path of `PUBLIC_URL` ), and all paths under it, which includes`/callback` and`/oauth/`\n- `/.well-known/oauth-protected-resource<route>`\n- `/.well-known/oauth-authorization-server<route>`\n- `/.well-known/openid-configuration<route>`\n\nUse 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.\n\nWith Tailscale Funnel, for each path above:\n\n```\ntailscale funnel --bg --set-path /<route> http://127.0.0.1:7815/<route>\n```\n\nWith cloudflared or Caddy, send the whole host to `http://127.0.0.1:7815`.\n\n```\nnode bin/grok-x-mcp.mjs test \"from:xai\"   # one real search through your routine\nnode bin/grok-x-mcp.mjs serve\n```\n\n`test` prints the first posts and the time. If it fails, it says why.\n\n1. \nIn ChatGPT, Claude or Gemini, add a custom connector with the URL `PUBLIC_URL` .\n2. \nThe app opens the approval page of the server. Enter the approval secret: \n\n```\ncat ~/.grok-x-mcp/approval.secret\n```\n\n3. \nAsk, for example: \"Search X for the latest posts from @xai about Grok Bot.\"\n\n| Variable | Required | Default | Meaning | \n|---|---|---|---|\n| `PUBLIC_URL` | yes |  | Public https address of the MCP endpoint, with a random path. | \n| `GROK_ROUTINE_URL` | yes |  | The webhook URL of your routine. | \n| `GROK_ROUTINE_KEY_FILE` | yes, or `GROK_ROUTINE_KEY` |  | File with the webhook key, mode 600. | \n| `MAX_SEARCHES_PER_HOUR` | no | `60` | A cap on routine runs (searches and video readings together), 1 to 200. | \n| `ENABLE_X_VIDEO` | no | off | `1` adds the`x_video` tool and the`x_video` skill to`setup-prompt` . | \n| `APPROVAL_SECRET_FILE` | no | made in `DATA_DIR/approval.secret` | The secret that the approval page asks for. | \n| `ADMIN_TOKEN_FILE` | no | none | A fixed bearer token, for curl. 32 characters or more. | \n| `ALLOWED_REDIRECT_HOSTS` | no | Gemini, claude.ai, chatgpt.com, localhost | OAuth redirect hosts. | \n| `HOST` | no | `127.0.0.1` | Listen address. | \n| `PORT` | no | `7815` | Listen port. | \n| `DATA_DIR` | no | `~/.grok-x-mcp` | OAuth clients and tokens. | \n\n`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`.\n\nThe 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.\n\n- **Cost.** Each search is one routine run, and each run spends usage of your Grok Bot plan. There is no other cost.\n- **Grok Bot routines.** A routine runs at most 200 times an hour, and all your routines together at most 300 times an hour ([docs](https://docs.x.ai/grok-bot/skills-routines-and-automations) ).`MAX_SEARCHES_PER_HOUR` keeps the server under that.\n- **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.\n- **Speed.** 20 to 40 seconds a search. About 1 to 3 minutes a video reading (`x_video` ).\n\nThis server is for your own searches with your own Grok Bot. Read the [xAI Acceptable Use Policy](https://x.ai/legal/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.\n\n1. **The routine checks the callback.** It sends results only to an address that starts with your`PUBLIC_URL` .\n2. **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.\n3. **Old requests do nothing.** Each request has`expires_at` , 5 minutes after it is sent (10 minutes for a video reading). The routine drops a request after that time.\n4. **OAuth approval.** A chat app must pass the approval page, which asks for the approval secret. Access tokens last 1 hour.\n5. **Post text is data.** The routine and the skills treat the webhook body, the posts, the videos and the`question` of`x_video` as data, not as instructions.\n6. **The log has one line for each request,** with no content, tokens or secrets.\n\n```\ngrok-x-mcp setup-prompt     # text for your Grok Bot\ngrok-x-mcp test \"<query>\"   # one real search\ngrok-x-mcp test-video <post> [\"question\"]   # one real video reading (ENABLE_X_VIDEO=1)\ngrok-x-mcp serve            # start the server\ngrok-x-mcp clients          # list the OAuth clients\ngrok-x-mcp revoke <id>      # remove one client and its tokens (\"all\" for every client)\ngrok-x-mcp random           # a random value for a route or a secret\nnpm test\n```\n\nThe tests need no Grok Bot and no network. They use a fake routine.\n\nMIT", "url": "https://wpnews.pro/news/show-hn-an-mcp-that-searches-x-using-your-own-grokbot-plan", "canonical_source": "https://github.com/marciob/grok-x-mcp", "published_at": "2026-11-27 16:01:15+00:00", "updated_at": "2026-11-27 16:15:28.836914+00:00", "lang": "en", "topics": ["ai-agents", "agent-protocols", "ai-tools", "developer-tools", "ai-products"], "entities": ["grok-x-mcp", "Grok Bot", "xAI", "X", "ChatGPT", "Claude", "Gemini", "Node.js 22"], "also_reported_by": [], "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", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/show-hn-an-mcp-that-searches-x-using-your-own-grokbot-plan", "markdown": "https://wpnews.pro/news/show-hn-an-mcp-that-searches-x-using-your-own-grokbot-plan.md", "text": "https://wpnews.pro/news/show-hn-an-mcp-that-searches-x-using-your-own-grokbot-plan.txt", "jsonld": "https://wpnews.pro/news/show-hn-an-mcp-that-searches-x-using-your-own-grokbot-plan.jsonld"}}