Grok2 Image MCP Server

grok image mcp server

Local serverstdio

What is the Grok2 Image MCP server?

Grok2 Image MCP server is a locally run integration for AI assistants that speak the Model Context Protocol. grok image mcp server.

What you get

An MCP (Model Context Protocol) server for image generation and editing using the Grok image model from xAI.

  • Image Generation — — Generate images from text prompts with configurable aspect ratio, resolution, and batch count
  • Image Editing — — Edit existing images with natural language instructions, supporting 1–3 source images
  • Local File Support — — Provide local image paths for editing; the server reads and encodes them automatically
  • Image Proxy — — Optional proxy domain for imgen.x.ai to handle network restrictions
  • HTTP Proxy — — Optional network proxy for API requests

What the assistant can call

Once Grok2 Image is connected, these are the calls the assistant has available:

  • generate_image — The generate_image tool exposed by this server
  • edit_image — The edit_image tool exposed by this server

Setting it up

Setup follows the usual MCP pattern — install or clone the server, register it in your client's configuration file, restart the client. The configuration blocks on this page cover the common clients.

Configuration and credentials

You will need 2 environment variables: XAIAPI_KEY, XAIAPI_BASE_URL. The server will not start without them, which is usually why the tools fail to appear on a first run. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

Choosing this one

Plenty of AI and media services servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. Grok2 Image's toolset — generate_image, edit_image — is a fair guide to whether it matches your workflow. It is maintained by fl0w1nd; worth a glance at recent repository activity before you build anything load-bearing on it.

We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.

Before you rely on it

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the grok2 image mcp server does with a few real requests.

Available tools

ToolWhat it does
generate_imageThe generate_image tool exposed by this server.
edit_imageThe edit_image tool exposed by this server.

How to install the Grok2 Image MCP server

{
  "mcpServers": {
    "grok_image": {
      "command": "npx",
      "args": ["grok-image-mcp"],
      "env": {
        "XAIAPI_KEY": "your-xai-api-key"
      }
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Configuration

VariableDescriptionRequired
XAIAPI_KEYCredential the server authenticates with.Yes
XAIAPI_BASE_URLEndpoint or connection string the server talks to.Yes

Example prompts to try

  • Use Grok2 Image to generate image.
  • Use Grok2 Image to edit image.

Frequently asked questions

Two tools: `generate_image` for creating images from text, and `edit_image` for modifying existing images using natural language.