MCP server for Grok image generation and editing
Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"grok-image": {
"command": "/path/to/mcp-server-grok-image"
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
An MCP (Model Context Protocol) server for xAI's Grok image generation API. Built in Rust, exposes image generation and editing as MCP tools.
No automated test available for this server. Check the GitHub README for setup instructions.
Five weighted categories — click any category to see the underlying evidence.
No known CVEs.
No package registry to scan.
Click any tool to inspect its schema.
Be the first to review
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Others in ai-ml / design
Persistent memory using a knowledge graph
Dynamic problem-solving through sequential thought chains
MCP server for accessing Figma plugin console logs and screenshots via Cloudflare Workers or local mode
Workspace template + MCP server for Claude Code, Codex CLI, Cursor & Windsurf. Multi-agent knowledge engine (ag-refresh / ag-ask) that turns any codebase into a queryable AI assistant.
MCP Security Weekly
Get CVE alerts and security updates for Mcp Server Grok Image and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
An MCP (Model Context Protocol) server for xAI's Grok image generation API. Built in Rust, exposes image generation and editing as MCP tools.
Communicates via stdio using JSON-RPC 2.0, like all MCP servers.
| Tool | Description |
|---|---|
generate_image | Generate an image from a text prompt |
edit_image | Edit an existing image using natural language instructions |
list_styles | List available image styles for use with generate_image |
Generate an image from a text description.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
prompt | string | yes | Text description of the desired image |
model | string | no | Model to use (default: grok-imagine-image) |
n | integer | no | Number of images to generate (1-10, default 1) |
aspect_ratio | string | no | Aspect ratio: 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 2:1, 1:2, auto, etc. |
resolution | string | no | Output resolution: 1k (~1024px, default) or 2k (~2048px) |
response_format | string | no | Output format: url (default, temporary) or b64_json |
style | string | no | Style name to apply (use list_styles to see options) |
When a style is set, the prompt is wrapped in the style's template. For example, with style: "watercolor" and prompt: "a cat on a roof", the API receives "a cat on a roof, as a watercolor painting". Avoid including style language in the prompt itself when using this parameter.
The response includes the resolved prompt so you can see exactly what was sent to the API.
Edit an existing image using natural language instructions.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
image_url | string | yes | URL, base64 data URI, or local file path of the source image |
prompt | string | yes | Natural language edit instructions |
model | string | no | Model to use (default: grok-imagine-image) |
n | integer | no | Number of variations to generate (1-10, default 1) |
resolution | string | no | Output resolution: 1k (~1024px, default) or 2k (~2048px) |
response_format | string | no | Output format: url (default, temporary) or b64_json |
Note: The style parameter is intentionally not available on edit_image -- edit prompts are instructions (e.g. "remove the background"), not descriptions, so wrapping them in style templates would produce nonsense.
Returns all available image styles with their name, description, and prompt template. No parameters.
| Style | Description |
|---|---|
watercolor | Watercolor painting style |
oil-painting | Oil painting with visible brushstrokes |
pencil-sketch | Detailed pencil sketch |
pixel-art | Retro pixel art |
anime | Anime style illustration |
pop-art | Bold pop art style |
art-nouveau | Art nouveau with flowing organic lines |
cinematic | Cinematic photography with dramatic lighting |
portrait | Professional portrait photography |
macro | Extreme macro photography |
aerial | Aerial drone photography |
studio | Studio photography on clean background |
noir | Dark film noir style |
vintage | Faded vintage photograph |
| Model | Resolution | Cost | Rate Limit |
|---|---|---|---|
grok-imagine-image (default) | 1k/2k | $0.02/image | 300 RPM |
Create the config file:
mkdir -p ~/.config/mcp-server-grok-image
Create ~/.config/mcp-server-grok-image/config.toml:
api_key = "xai-..."
Add custom styles to your config file. Custom styles with the same name as a built-in will override it.
api_key = "xai-..."
[[styles]]
nam
... [View full README on GitHub](https://github.com/codeChap/mcp-server-grok-image#readme)