Grok MCP

by merterbak

Not rated
GitHub

About

A MCP server for xAI's Grok API, providing access to capabilities including image understanding, image generation, live web search, and reasoning models.

Details

Author
merterbak
Categories
Developer Tools, Search, Knowledge Base

Setup

Install Grok MCP in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/merterbak/Grok-MCP

Follow the installation instructions in the repository README, then restart your MCP client.

MCP server for xAI’s Grok API with Web/X search, vision, image/video generation and file support.

- Agentic Tool Calling: Web search, X search, and code execution with multi-step reasoning
- Multiple Grok Models: Access to latest models such as grok-4.6, grok-4.5, grok-build-0.1 and more
- Image and Video Generation: Create images and videos using Grok Imagine
- Vision Capabilities: Analyze images with Grok's vision models
- Files API: Upload, manage, and chat with documents
- Stateful Conversations: Maintain conversation context as id across multiple requests
- Local Chat History: Option to save persistent client side chat history as JSON files in chats/

- Python 3.11 or higher
- xAI API key (Get one here)
-
Astral UV

git clone https://github.com/merterbak/Grok-MCP.git cd Grok-MCP
uv venv source .venv/bin/activate # macOS/Linux or .venv\Scripts\activate on Windows

Add this to your Claude Desktop configuration file:

{ "mcpServers": { "grok": { "command": "uv", "args": [ "--directory", "/path/to/Grok-MCP", "run", "python", "main.py" ], "env": { "XAI_API_KEY": "your_api_key_here" } } } }

Run this command from inside the project directory:

claude mcp add grok-mcp -e XAI_API_KEY=your_api_key_here -- uv run --directory /path/to/Grok-MCP python main.py

Or if you have a.envfile with your key:

claude mcp add grok-mcp -- uv run --directory /path/to/Grok-MCP python main.py

Claude Desktop can't send uploaded images in the chat to an MCP tool. The easiest way to give access to files directly from your computer is official Filesystem MCP server. After setting it up you’ll be able to just write the image’s file path (such as /Users/mert/Desktop/image.png) in chat and Claude can use it with any vision chat tool.

{ "mcpServers": { "filesystem": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-filesystem", "/Users/<your-username>/Desktop", "/Users/<your-username>/Downloads" ] } } }

Each tool has a full docstring insrc/server.pywith its arguments and return format. MCP client surfaces those directly, so this list is just a quick map of what's available.

Note: For using images and files, you must provide paths to chat. SeeFilesystem MCP (Optional)for setup.

- chat— standard chat completion with optional persistent history and multi-agent support.
- 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 viaresponse_id.
- retrieve_stateful_response— fetch a stored response by ID.
- delete_stateful_response— delete a stored response by ID.

- web_search— autonomous web research with domain filters and citations.
- x_search— autonomous search over X (Twitter) posts, with handle and date filters.
- code_executor— solve tasks by running Python in a sandbox.
- grok_agent— unified agent that mixes files, images, web search, X search, and code execution.

- generate_image— create or edit images with Grok Imagine (multi-reference editing supported).
- 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— upload a local document.
- list_files— list uploaded files with sorting.
- get_file— fetch file metadata by ID.
- get_file_content— download file content as text.
- delete_file— delete a file by ID.

- list_chat_sessions— list saved sessions inchats/.
- get_chat_history— get a session's full transcript.
- clear_chat_history— delete a session's local history file.

- list_models— list all Grok language and image models with live pricing.

This project is open source and available under the MIT License.

This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.

Semantic code search for AI agents without indexing your codebase or storing any data. Fast and accurate.

Create and read feature flags, review experiments, generate flag types, search docs, and interact with GrowthBook's feature flagging and experimentation platform.

Word search, crossword, and sudoku generator MCP server with printable PDF worksheets, themed word banks, and verifiable LLM evals. Local-first, from the makers of puzzletide.com.

Official MCP server for Stimulsoft Reports & Dashboards documentation. Semantic search across FAQ, Programming Manual, Server/User Manual, and Server/Cloud API for .NET, WPF, Avalonia, WEB, Blazor, Angular, React, JS, PHP, Java, and Python platforms.

Searching and access your AI coding sessions from Claude Code, Gemini CLI, opencode, and OpenAI Codex.

Search Apple's Developer Documentation with smart search and wildcard support.

MCP server that exposes ast-grep (sg) as two tools for structural code search.

Search everything your terminal ever printed. Local MCP server over per-command recorded output: full-text search, exit codes, diffs, secret redaction. Built and maintained by an AI agent (Soren Achebe).

Let AI agents search, register, and manage domains via API

Search, compare, and get docs for 210+ APIs ranked by CLI and agent relevance

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.