Grok2 Image

Provides image generation via Grok-2 through MCP with configurable API keys and optional proxies.
  • javascript

28

GitHub Stars

javascript

Language

6 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "fl0w1nd-grok2-image-mcp-server": {
      "command": "npx",
      "args": [
        "grok2-image-mcp-server"
      ],
      "env": {
        "HTTP_PROXY": "http://127.0.0.1:7890",
        "XAIAPI_KEY": "YOUR_API_KEY",
        "XAIAPI_BASE_URL": "https://api-proxy.me/xai/v1",
        "IMAGE_PROXY_DOMAIN": "https://image.proxy.workers.dev"
      }
    }
  }
}

You can run the Grok2 Image MCP Server locally to let a chat assistant generate images using the Grok-2 model through the Model Context Protocol. This MCP server acts as a bridge between your client and the Grok-2 image generation service, enabling image requests to be fed and handled consistently within your MCP workflow.

How to use

Use this MCP server with any MCP client to generate images by sending image requests through the common MCP interface. Your client can submit prompts, handle responses, and manage image URLs via the MCP channel just like other data sources and actions in your setup.

Practical usage patterns include pairing the MCP server with your dialog manager to generate images from user prompts, applying image proxying when needed, and routing results back to the user interface. If you encounter image access issues, you can configure an image proxy domain and an API base URL so requests go through reliable proxies.

How to install

Prerequisites: you need Node.js and npm (or a compatible runtime) installed on your system.

Install and run the MCP server using the recommended npx approach. The server runs locally and exposes an MCP command that your clients can invoke.

{
  "mcpServers": {
    "grok2_image": {
      "command": "npx",
      "args": [
        "grok2-image-mcp-server"
      ],
      "env": {
        "XAIAPI_KEY": "YOUR_API_KEY"
      }
    }
  }
}
npx -y grok2-image-mcp-server
{
  "mcpServers": {
    "grok2_image": {
      "command": "npx",
      "args": [
        "grok2-image-mcp-server"
      ],
      "env": {
        "XAIAPI_KEY": "YOUR_API_KEY"
      }
    }
  }
}

Additional setup and env vars

Configure optional environment variables to tailor how the server requests and serves images. These variables control API access, image proxying, and network routing.

Optional settings you can provide when you run the server include the base API URL, an image proxy domain, and an HTTP proxy for network access. These help with access in restricted environments and can improve reliability.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational