# pixel-surgeon

Generate and edit AI images or video clips directly inside your agent workflow via Gemini, OpenAI, and Grok. Fixes mangled text through region patching.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 5
- Author: j-east
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/j-east/pixel-surgeon-mcp
- Updated: 2026-06-04
- HTML: https://affpapa.org/en/nevibecode/mcp/pixel-surgeon

## What it does

The server connects your coding agent to three external model providers. Grok Imagine handles quick concept drafts at minimal expense. When an asset needs crisp typography or clear diagrams, requests go to OpenAI `gpt-image-2`. Google Veo 3 builds short video clips. It creates ambient audio along with footage at 5s or 8s durations.

Standard image generators often mangle letters and small details. To address this, tools like `fix_image` divide pictures into tile grids to re-render broken text regions before stitching them back together. There is also `remove_background` for alpha transparency and built-in visual presets such as `neo-brutalist` and `duval-software-infographic`.

Running the server requires at least one API credential among Google, OpenAI, or xAI. Advanced models like Gemini 3.1 Flash Image and Veo 3 demand prepaid Google AI credits. When a Google billing error occurs, the server drops down to the free `gemini-2.5-flash-image` tier capped at 1K resolution.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `GOOGLE_API_KEY`, `OPENAI_API_KEY`, `XAI_API_KEY` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add pixel-surgeon -e GOOGLE_API_KEY=<GOOGLE_API_KEY> -e OPENAI_API_KEY=<OPENAI_API_KEY> -e XAI_API_KEY=<XAI_API_KEY> -- npx -y pixel-surgeon-mcp
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add pixel-surgeon --env GOOGLE_API_KEY=<GOOGLE_API_KEY> --env OPENAI_API_KEY=<OPENAI_API_KEY> --env XAI_API_KEY=<XAI_API_KEY> -- npx -y pixel-surgeon-mcp
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "pixel-surgeon": {
            "command": "npx",
            "args": [
                "-y",
                "pixel-surgeon-mcp"
            ],
            "env": {
                "GOOGLE_API_KEY": "<GOOGLE_API_KEY>",
                "OPENAI_API_KEY": "<OPENAI_API_KEY>",
                "XAI_API_KEY": "<XAI_API_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "pixel-surgeon": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "pixel-surgeon-mcp"
            ],
            "env": {
                "GOOGLE_API_KEY": "<GOOGLE_API_KEY>",
                "OPENAI_API_KEY": "<OPENAI_API_KEY>",
                "XAI_API_KEY": "<XAI_API_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e GOOGLE_API_KEY=<GOOGLE_API_KEY> -e OPENAI_API_KEY=<OPENAI_API_KEY> -e XAI_API_KEY=<XAI_API_KEY> pixel-surgeon npx -y pixel-surgeon-mcp
```
Replace <…> with your own values

## When to use it
- generate infographics and diagrams with legible typography using GPT Image 2
- repair garbled letters on generated graphics via grid tile re-rendering
- render short video clips with matching audio using Veo 3
- strip backgrounds from images to produce transparent alpha channels

## Example prompts
- Generate a system architecture diagram in clean-tech-infographic style using gpt-image-2
- Repair the illegible labels on this diagram using fix_image
- Create a 5-second vertical 9:16 video clip from this prompt using Veo 3

## Similar
- [Next AI Draw.io](https://affpapa.org/en/nevibecode/mcp/next-ai-drawio.md) — MCP server · ★ 36427
- [tldraw](https://affpapa.org/en/nevibecode/mcp/tldraw.md) — MCP server · ★ 51104
- [Figma-Context-MCP](https://affpapa.org/en/nevibecode/mcp/figma-context-mcp.md) — MCP server · ★ 16073
- [Agent-Native Assets](https://affpapa.org/en/nevibecode/mcp/agent-native-assets.md) — MCP server · ★ 7527
- [Remove AI Watermarks](https://affpapa.org/en/nevibecode/mcp/remove-ai-watermarks.md) — MCP server · ★ 6144
- [Dembrandt](https://affpapa.org/en/nevibecode/mcp/dembrandt.md) — MCP server · ★ 3851

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
