chatLABSCO 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.
Setup effort
Build from source — git clone https://github.com/merterbak/Grok-MCP.git
USE CASES
Researching something that happened this week
Run autonomous web research with domain filters and get citations back, or search X directly when the discussion is there.
Asking questions about a document you have
Upload the file, then chat grounded on it instead of pasting extracts.
Getting an image or a clip made
Generate or edit the image, turn it into video, and extend the video with a follow-up prompt.
Reading what is in a screenshot or photo
Pass the local or remote image to a Grok vision model and ask about it.
Working a problem that needs real computation
Let the model write and run Python in the sandbox, or hand the whole task to the combined agent.
Continuing a conversation across sessions
Keep it server-side and resume by response id, or read back a saved local transcript.
22 tools
Listed in project docs. Your client may show a different list.
chat_with_visionchat_with_filesstateful_chatretrieve_stateful_responsedelete_stateful_responseweb_searchx_searchcode_executorgrok_agentgenerate_imagegenerate_videoextend_videoupload_filelist_filesget_fileget_file_contentdelete_filelist_chat_sessionsget_chat_historyclear_chat_historylist_modelsBEFORE YOU INSTALL
What to know first
Tools you get
22 tools named in the project's documentation.
Requires
- Python 3.11 or later
- XAI_API_KEY in your environment
Where it runs
Both documented clients run the server on your machine.
INSTALLATION
Connect your client
You clone this one yourself.
Server setup
git clone https://github.com/merterbak/Grok-MCP.git
cd Grok-MCP
uv venv
source .venv/bin/activate
uv syncMCP Clients
Claude Desktop
{
"mcpServers": {
"grok": {
"command": "uv",
"args": [
"--directory",
"<YOUR_PATH_TO_GROK_MCP>",
"run",
"python",
"main.py"
],
"env": {
"XAI_API_KEY": "<YOUR_XAI_API_KEY>"
}
}
}
}Claude Code
claude mcp add grok-mcp -e XAI_API_KEY=<YOUR_XAI_API_KEY> -- uv run --directory <YOUR_PATH_TO_GROK_MCP> python main.py