# Grok-MCP

> Grok-MCP is an open-source MCP server for design and media. MCP server giving AI clients access to xAI's Grok models, search, vision and media tools. It is available on CLI, API and Self-hosted.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, API, Self-hosted
- **Repository:** https://github.com/merterbak/grok-mcp
- **GitHub stars:** 57
- **License:** MIT
- **Categories:** [design and media](https://ai-powered.com/categories/design-and-media), [AI models and LLM tooling](https://ai-powered.com/categories/ai-and-llm)
- **Listing updated:** 2026-12-01

## About

Grok-MCP wraps xAI's Grok API as a Model Context Protocol server, so an MCP-compatible client can call Grok for chat, web and X search, image analysis, document questions and image or video creation without writing API glue code. Tools are exposed through the standard MCP interface and can be run over stdio, inside Docker, or tested with the MCP Inspector.

Beyond plain chat, the server bundles agentic tools such as web research with citations, X post search with handle and date filters, and a sandboxed Python executor. A unified agent tool can combine files, images, search and generation in one request. Generated media can be saved into a local images folder, and conversations can optionally be kept as JSON history files on disk.

It suits developers and power users who already work in an MCP client and want Grok available alongside other tools. Using it requires an xAI API key, and image or file input needs a filesystem MCP server to pass local paths.

## Features

- **Agentic web and X search:** Runs autonomous searches over the web and X posts, with domain and handle filters and citations.
- **Image and video generation:** Creates, edits and extends images and videos with Grok Imagine, optionally saving outputs locally.
- **Vision analysis:** Sends local or remote images to a Grok vision model for description and questions.
- **File upload and chat:** Uploads documents to xAI and answers questions grounded on them.
- **Stateful conversations:** Stores server-side responses that can be continued, retrieved or deleted by ID.
- **Local chat history:** Saves optional session transcripts as JSON files for later review.
- **Live model listing:** Lists available Grok language and image models along with current pricing.

## Good for

- Research current web or X discussions from inside an MCP-enabled assistant
- Generate or edit images and short videos without leaving the chat client
- Ask questions about uploaded documents using Grok models
- Analyze screenshots or photos by passing their file paths to the vision tool
- Run small Python tasks in a sandbox as part of a multi-step request

## Tools

From the tool list in its README, going by the names, 2 of 22 tools delete data and 1 changes data; 10 names don't say. From the server's own tool labels and tool names; not verified by us.

- `chat`: Standard chat completion with optional persistent history, multi-agent support, service tier and guidelines.
- `chat_with_vision`: Analyze local or remote images with a Grok vision model.
- `chat_with_files`: Chat grounded on previously uploaded documents.
- `stateful_chat`: Continue a server-side stored conversation via response_id.
- `retrieve_stateful_response` (name suggests: reads): Fetch a stored response by ID.
- `delete_stateful_response` (name suggests: deletes): Delete a stored response by ID.
- `web_search` (name suggests: reads): Autonomous web research with domain filters and citations.
- `x_search` (name suggests: reads): Autonomous search over X posts with handle and date filters.
- `code_executor`: Solve tasks by running Python in a sandbox.
- `grok_agent`: Unified agent mixing files, images, web search, X search, code execution and image generation.
- `generate_image`: Create or edit images with Grok Imagine.
- `generate_video`: Text-to-video, image-to-video or video editing with Grok Imagine.
- `extend_video`: Extend an existing generated video with a follow-up prompt.
- `upload_file` (name suggests: changes): Upload a local document.
- `list_files` (name suggests: reads): List uploaded files with sorting.
- `get_file` (name suggests: reads): Fetch file metadata by ID.
- `get_file_content` (name suggests: reads): Download file content as text.
- `delete_file` (name suggests: deletes): Delete a file by ID.
- `list_chat_sessions` (name suggests: reads): List saved sessions in chats/.
- `get_chat_history` (name suggests: reads): Get a session's full transcript.
- `clear_chat_history`: Delete a session's local history file.
- `list_models` (name suggests: reads): List Grok language and image models with live pricing.

## FAQ

### What do I need to run Grok-MCP?

Python 3.11 or higher, the uv tool, and an xAI API key set as XAI_API_KEY.

### How do I connect Grok-MCP to Claude Desktop?

Add a server entry to the Claude Desktop configuration that runs uv with the project directory and main.py, passing your API key in the env block.

### Can I run Grok-MCP in Docker?

Yes, the project includes a docker compose setup for running the server.

### How are images and files passed in?

Paths to local files must be typed into chat, which works best alongside the optional Filesystem MCP server.

### Is Grok-MCP free?

Yes. Grok-MCP is open source, so you can use and self-host it for free.

### What are the best alternatives to Grok-MCP?

The closest alternatives to Grok-MCP are Grok Chat, Grok by xAI by UniversalMCP, MCP Grok, Grok Image and Grok Video.

## Where this comes from

- Description: written from the project's README.

## Alternatives

- [Grok Chat](https://ai-powered.com/mcp/grok-chat): Grok Chat is an open-source MCP server for ai models and llm tooling.
- [Grok by xAI by UniversalMCP](https://ai-powered.com/mcp/grok-by-xai-by-universalmcp): Grok by xAI by UniversalMCP is a free MCP server for ai models and llm tooling.
- [MCP Grok](https://ai-powered.com/mcp/mcp-grok): MCP Grok is an open-source MCP server for design and media.
- [Grok Image](https://ai-powered.com/mcp/grok-image): Grok Image is an open-source MCP server for design and media.
- [Grok Video](https://ai-powered.com/mcp/grok-video): Grok Video is an open-source MCP server for design and media.
- [Ask Grok](https://ai-powered.com/mcp/ask-grok): Ask Grok is a paid MCP server for ai models and llm tooling.
- [Grok Imagine MCP](https://ai-powered.com/mcp/grok-imagine-mcp): Grok Imagine MCP is an open-source MCP server for ai models and llm tooling.
- [Imagine MCP](https://ai-powered.com/mcp/imagine-mcp): Imagine MCP is an open-source MCP server for design and media.

---
Source: https://ai-powered.com/mcp/grok-mcp-2
