Labsco
MCP SERVER

Grok MCP

by merterbak

Reach xAI's Grok models from your own client — chat, vision, web and X search, code execution, image and video generation.

Model Routing, Multi-Model Consultation & Cost Control
Summary
Grok's whole surface — search, code, vision, image and video — reachable from whichever assistant you already work in.

The agentic tools are the reason to bother: web and X search run as multi-step research with citations rather than a single lookup, and the sandbox lets the model settle a calculation instead of guessing. Media generation and the files API sit behind the same key, so one credential covers research, images and video.

What it is

A server over the xAI API that exposes Grok's model family as tools, including its agentic search and the Grok Imagine media models.

What you get
  • Chat completions against Grok models, with an agent tool that combines files, images, web search, X search and code execution in one call
  • Autonomous web research with domain filters and citations, and search over X posts filtered by handle and date
  • A Python sandbox the model can run code in to work a problem out
  • Vision: local or remote images analysed by a Grok vision model
  • Image generation and editing, including multi-reference editing, plus text-to-video, image-to-video, video editing, and extending a generated video with a follow-up prompt
  • A files workflow — upload a document, list, inspect, download or delete it, and chat grounded on what you uploaded
  • Stateful conversations kept server-side and continued by response id, with stored responses retrievable and deletable
  • Local chat history saved as JSON, listable and clearable per session
  • A live listing of the Grok language and image models with their current pricing
Requirements

An xAI API key from console.x.ai, passed as XAI_API_KEY, and Python 3.11 or newer with uv. Not on a package registry: clone the repository, run uv sync, and launch it over stdio from the project directory — a Docker compose file is included as an alternative. Images and files are passed by path, so a filesystem server alongside it is what makes attachments in chat usable.