Pixel Surgeon

io.github.j-east由 GitHub 帳號 j-east 發布v1.1.1更新於 Oct 24, 2026

AI image and video generation, editing, and region repair via Gemini, OpenAI, and Grok.

已驗證STDIO僅桌面媒體與設計AI 與機器學習

概覽

AI 產生的概覽

一個本機 MCP 伺服器,讓助理透過 Gemini、OpenAI 與 xAI 模型生成、編輯與修復影像,並製作短影片。

可以做什麼
依文字提示生成單張或批次影像,支援選用風格預設,並可依請求在 Gemini、GPT Image 與 Grok Imagine 模型間切換;也能透過 Veo 3 產生帶音訊的 5 秒或 8 秒文字轉影片。以自然語言指令編輯既有影像,或透過網格分塊與定向裁切修復亂碼文字與特定區域,自動對齊長寬比並以直方圖比對合成。開啟瀏覽器裁切介面,供人工選取區域並比較多張結果。管理本機工作區:列出已生成的影像與影片、匯入外部影像、移除背景取得透明通道。
適用情境
適合在對話中讓助理產出或修飾視覺素材:草稿與原型、文字較多的資訊圖與示意圖,或修復既有影像中的亂碼文字。也適合製作短影片片段與快速去背。
執行需求
透過 npx(Node.js)在本機執行,或從原始碼複製安裝。至少需要一個服務商 API 金鑰,以 GOOGLE_API_KEY、OPENAI_API_KEY 或 XAI_API_KEY 傳入,可任意組合。Google 影像與 Veo 3 需開通計費並預付額度。輸出儲存在使用者的圖片資料夾,首次使用會自動啟動本機瀏覽器檢視器。
安裝前請注意
各服務商金鑰皆為計費憑證,影像與影片生成依請求收費;Google 高階模型需預付額度,計費出錯時伺服器會自動改用免費版 Gemini 模型。生成檔案會寫入本機圖片資料夾並自動開啟瀏覽器檢視器。提示詞與來源影像會傳送給所選的第三方服務商。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Pixel Surgeon,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[pixel-surgeon-mcp architecture]

pixel-surgeon-mcp

MCP server for AI image & video generation, editing, and transplant-grade region repair
Powered by Gemini 3.1 Flash Image, OpenAI GPT Image 2, Grok Imagine, and Veo 3

[MCP stdio] [Gemini] [OpenAI] [Grok] [Veo 3] [TypeScript]


An MCP server that gives Claude (or any MCP client) the ability to generate images, edit them, fix garbled text, and create videos — all through natural language.

How it works

pixel-surgeon-mcp is a multi-provider image generation server. You can use any combination of providers and switch between them per-request:

Gemini (Google) — balanced

Google's image generation pipeline uses a two-stage approach: Gemini 3.1 Pro reasons about your prompt, then Gemini 3.1 Flash Image renders the pixels. Supports 9 aspect ratios at 512/1K/2K/4K resolution. Best price/performance ratio, with a free tier available.

OpenAI GPT Image 2 — highest quality

OpenAI's latest image model with dramatically improved text rendering and visual fidelity. Supports flexible resolutions — pixel-surgeon maps your chosen size and aspect ratio to the optimal pixel dimensions automatically. Quality levels: medium (fast) and high (print-ready). Excellent for infographics, diagrams, and text-heavy images where other models struggle. Slower and more expensive.

Grok Imagine (xAI) — fastest

xAI's Aurora-powered image model. Fastest generation speed and lowest cost. Supports 7 aspect ratios at fixed resolutions (~1K). Good for rapid prototyping and iteration.

Veo 3 (Video)

For video, the server calls Veo 3 with async polling — generating both video and ambient audio. Supports 16:9 and 9:16 at 5s or 8s duration.

Region repair

AI image models struggle with text-heavy images. The fix tools solve this by sending smaller regions to the provider, then stitching the results back with histogram-matched compositing for seamless blending.

Tools

ToolDescription
generate_imageText-to-image generation (single image)
generate_imagesParallel batch generation (1-8 images)
generate_videoText-to-video via Veo 3 with audio (5s or 8s)
edit_imageEdit an existing image with natural language instructions
fix_imageGrid-based tile repair for garbled text (2x2, 3x3, etc.)
fix_regionTargeted region repair with automatic aspect ratio snapping
interactive_fixBrowser-based crop UI with multi-shot selection
list_imagesList generated images and videos
save_imageImport an external image into the workspace
remove_backgroundRemove image background (alpha channel transparency)

Models

ModelProviderResolutionBest for
gemini-3.1-flash-imageGoogle512 / 1K / 2K / 4KGeneral image generation, photo-realistic scenes
gemini-2.5-flash-imageGoogle1K max (free tier)Quick drafts, prototyping
gpt-image-2OpenAIFlexible (up to 4K)Text-heavy images, infographics, diagrams, typography
gpt-image-1OpenAI3 fixed sizesLegacy support
grok-imaginexAIFixed (~1K per ratio)Fast iteration, lowest cost

Force a specific model per-call via the model tool parameter, or set DEFAULT_IMAGE_MODEL env var.

Gemini automatic fallback

If a Gemini generation call fails with a billing / prepay error, the server automatically retries on the free-tier gemini-2.5-flash-image model. The viewer shows a yellow banner when this happens. Free-tier limits: 1K max resolution, 10 RPM, 500 RPD.

Style presets

All generation and edit tools support an optional style parameter:

neo-brutalist

Magazine editorial, bold typography, halftone textures. Cream, black, and terracotta palette.

[neo-brutalist style example]

duval-software-infographic

Duval Software's signature retro-futurist infographic style. 1960s Space Age meets 1980s arcade. Cathode blue, amber, and salmon palette. Great for diagrams and system overviews.

[duval-software-infographic style example]

fractal-arcade

Dithered fractals, Sierpinski patterns, low-poly. CRT retro, Amiga/EGA palette.

[fractal-arcade style example]

clean-tech-infographic

Technical diagrams, system flows, data pipelines. Dark navy, cyan, and electric blue.

[clean-tech-infographic style example]

Setup

Get your API key(s)

You need at least one provider API key. You can use any combination for maximum flexibility.

Google (Gemini + Veo 3)
  1. Go to Google AI Studio
  2. Sign in with your Google account
  3. Click Create API Key and copy it

Prepayment required. Gemini 3.1 Flash Image and Veo 3 require billing and prepaid credits. The free-tier fallback (2.5 Flash) has limited resolution and rate limits. See Google AI pricing.

OpenAI (GPT Image 2)
  1. Go to OpenAI API
  2. Sign in or create an account
  3. Click Create new secret key and copy it
  4. Ensure you have API credits — image generation is billed per request

GPT Image 2 excels at text rendering, infographics, and diagrams. If you primarily need text-heavy images, this is the provider to use.

xAI (Grok Imagine)
  1. Go to xAI Console
  2. Sign in or create an account
  3. Create an API key and copy it

Grok Imagine is the fastest and cheapest provider. Great for rapid iteration and prototyping. Fixed output resolutions (~1K) with no size control.

Quick start (npx)

No install needed — run directly with npx. Pass whichever API keys you have:

bash
npx pixel-surgeon-mcp
Claude Code CLI
bash
claude mcp add pixel-surgeon \  -e GOOGLE_API_KEY=your-google-key \  -e OPENAI_API_KEY=your-openai-key \  -e XAI_API_KEY=your-xai-key \  -- npx pixel-surgeon-mcp
Claude Desktop / MCP client config
json
{  "mcpServers": {    "pixel-surgeon": {      "command": "npx",      "args": ["pixel-surgeon-mcp"],      "env": {        "GOOGLE_API_KEY": "your-google-api-key",        "OPENAI_API_KEY": "your-openai-api-key",        "XAI_API_KEY": "your-xai-api-key"      }    }  }}

Install from source

If you prefer a local clone:

bash
git clone https://github.com/j-east/pixel-surgeon-mcp.gitcd pixel-surgeon-mcpnpm installnpm run build

Image output

Generated images are saved to ~/Pictures/pixel-surgeon/. A local browser viewer auto-launches on first use for full-resolution previews with model selection, respin controls, and search.

Development

bash
npm run dev    # tsx watch modenpm run build  # compile TypeScriptnpm run start  # run compiled server

Key implementation details

  • Aspect ratio snapping — crops are adjusted to the nearest Gemini-supported ratio while preserving center point
  • Histogram matching — per-channel RGB normalization ensures composited regions blend seamlessly
  • Human-in-the-loop — interactive_fix opens a browser crop UI, blocks via Promise until the user submits, fires parallel Gemini calls, and lets the user pick the best result
  • MCP size limits — full-resolution images are saved to disk; downsampled versions (< 950KB) are returned in MCP responses

Contributing

PRs are welcome! We're especially looking for:

New style presets

Add entries to the STYLE_PRESETS object in src/index.ts. Your PR should include:

  • The preset definition (name, prompt prefix, default aspect ratio)
  • 2-3 example images generated with the preset (drop them in your PR description)
  • A short description of the visual style for the README table

Model adapters

The server currently supports Gemini, OpenAI, Grok Imagine, and Veo 3. We'd love adapters for other image/video generation APIs — Stable Diffusion, Flux, etc. If you're interested in adding one, open an issue first so we can align on the interface.

Built by Duval Software

pixel-surgeon-mcp is maintained by John Evans, part of the engineering team at Duval Software — a software engineering firm in Jacksonville Beach, FL building AI-powered tools and custom integrations. If you need MCP servers, AI pipelines, or production tooling built, get in touch.

License

MIT

來源:README.md,提交 a7c9189

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.1.1最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分