Skip to main content

xAI Grok

Search the web, search X, generate images, generate video. All from one tool. Sensor: search_web, search_x … turns questions into knowledge. Actuator: generate_image, edit_image, generate_video … turns prompts into media. Zero dependencies. Four interfaces: CLI, Module, Connection Point, Skill.

Install

Open your AI and say:
Clone wipcomputer/wip-xai-grok and read the README and SKILL.md.
Then explain to me:
1. What is this tool?
2. What does it do?
3. What would it change or fix in our current system?

Then ask me if I have more questions, or if I want you to integrate it into our system.
Your AI will read the repo, explain the tool, and walk you through integration interactively.

API Key

Get your xAI API key from https://console.x.ai/ The tool resolves your key automatically:
  1. 1Password (preferred) … op://Agent Secrets/X API/api key. No env vars needed.
  2. Environment variableexport XAI_API_KEY="your-key" as a fallback.

Usage

CLI

# Search (sensor)
wip-xai-grok search-web "latest AI regulation developments"
wip-xai-grok search-x "what people are saying about OpenAI"
wip-xai-grok search-x "AI thoughts" --handles=elonmusk --from=2026-01-01

# Image generation (actuator)
wip-xai-grok imagine "a cat in space, photorealistic" --output=cat.png
wip-xai-grok imagine "minimalist logo" --aspect=16:9 --n=4

# Image editing (actuator)
wip-xai-grok edit "make the sky purple" --image=photo.jpg --output=edited.jpg

# Video generation (actuator)
wip-xai-grok video "a sunset timelapse over the ocean" --duration=10 --resolution=720p --wait
wip-xai-grok video-status abc123

As a Module

import { search_web, search_x, generate_image, generate_video, wait_for_video } from '@wipcomputer/wip-xai-grok';

// Sensor: search
const web = await search_web({ query: "UN climate summit" });
console.log(web.content);
console.log(web.citations);

const x = await search_x({
  query: "AI regulation",
  allowed_x_handles: ["elonmusk"],
  from_date: "2026-01-01",
});

// Actuator: generate
const img = await generate_image({ prompt: "a red cube on white", aspect_ratio: "1:1" });
console.log(img.images[0].url);

const vid = await generate_video({ prompt: "spinning globe", duration: 5 });
const result = await wait_for_video({ request_id: vid.request_id });
console.log(result.url);

Connection Point

Add to your .mcp.json:
{
  "wip-xai-grok": {
    "command": "node",
    "args": ["/path/to/wip-xai-grok/mcp-server.mjs"]
  }
}
Exposes 6 tools: grok_search_web, grok_search_x, grok_imagine, grok_edit_image, grok_generate_video, grok_poll_video.

Functions

FunctionWhatEndpoint
search_webWeb search via GrokPOST /v1/responses (web_search tool)
search_xX/Twitter search via GrokPOST /v1/responses (x_search tool)

Actuator (Generate)

FunctionWhatEndpointCost
generate_imageText to imagePOST /v1/images/generations$0.02/image
edit_imageEdit image with textPOST /v1/images/edits$0.022/image
generate_videoText/image to videoPOST /v1/video/generations$0.05-0.07/sec
poll_videoCheck video statusGET /v1/video/generations/:idfree
wait_for_videoPoll until complete(convenience wrapper)free

Attribution

Search functions ported from castanley/grok v1.0.3 by Christopher Stanley on ClawHub.

License

MIT