Grok-MCP logo

Grok-MCP

Community
merterbak

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

Publishermerterbak
RepositoryGrok-MCP
LanguagePython
Forks
20
Stars
51
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    Grok-MCP exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    51 stars and 20 forks from the linked repository.

Grok-MCP

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

Features

  • Agentic Tool Calling: Web search, X search, code execution, and image generation 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/

Prerequisites

Installation

  1. Clone the repository:
bash
git clone https://github.com/merterbak/Grok-MCP.git
cd Grok-MCP
  1. Create a venv environment:
bash
uv venv
source .venv/bin/activate # macOS/Linux or .venv\Scripts\activate on Windows
  1. Install dependencies:
bash
uv sync

Configuration

Claude Desktop Integration

Add this to your Claude Desktop configuration file:

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

Claude Code Integration

Run this command from inside the project directory:

bash
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 .env file with your key:

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

Verify it's registered:

bash
claude mcp list

Filesystem MCP (Optional)

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.

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

For stdio:

bash
uv run python main.py

Docker:

bash
docker compose up --build

Mcp Inspector:

bash
mcp dev main.py

Available Tools

Each tool has a full docstring in src/server.py with 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. See Filesystem MCP (Optional) for setup.

Chat and reasoning

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

Agentic tools

  • 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, code execution, and server-side image generation. Generated images are written to images/.

Image and video

  • generate_image — create or edit images with Grok Imagine (multi-reference editing supported). Pass save=true to write the results to images/ instead of returning temporary URLs.
  • 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.

Files

  • 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.

Local chat history

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

Models

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

License

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

Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "merterbak-grok-mcp": {
      "command": "",
      "args": []
    }
  }
}

Use Grok-MCP MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Grok-MCP is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Grok-MCP as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Grok-MCP MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "merterbak-grok-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-grok"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Grok-MCP MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Grok-MCP MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Grok-MCP to help me with this task?
Grok-MCP
Sure. I read it.
Here is what I found using Grok-MCP.

Frequently asked questions

What is the Grok-MCP MCP server used for?

Grok-MCP is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Grok-MCP MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Grok-MCP with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Grok-MCP MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Grok-MCP connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Grok-MCP MCP to TypingMind?

Grok-MCP runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Grok-MCP MCP provide in TypingMind?

Grok-MCP exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Grok-MCP MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Grok-MCP requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇