Pixel Art MCP
Enables using Hugging Face's free tier text-to-image models as a backend for generating pixel art, configurable via HF_TOKEN and HF_MODEL environment variables.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Pixel Art MCP generate a cozy cabin in the woods, 160x90, 32 colors"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
π¨ Pixel Art MCP
An MCP server that turns text prompts into cozy pixel-art PNGs β using a free, no-API-key image backend β and saves them straight into your project.
Point Claude (or any MCP client) at this server and ask for "a cozy library interior, side view, warm afternoon light"; it generates the image, crushes it down into authentic, palette-limited pixel art, and writes the PNG to disk. Built originally to make scene art for a pixel study-game, but useful for any game/app that needs quick, consistent pixel assets.
β¨ Features
Text β pixel art in one call, saved as a ready-to-use PNG.
Free by default β uses Pollinations (no API key, no signup).
Real pixel-art post-processing β the model output is downscaled to a true pixel grid (nearest-neighbor) and palette-quantized, so it looks like pixel art, not just a blurry "pixel-ish" render.
Pluggable backends β swap to Hugging Face (free token) or a local Stable Diffusion endpoint by changing one function / env var.
Project-agnostic output β relative paths resolve against
PIXEL_OUT_DIR, so the same server serves any project.Two tools: generate from a prompt, or pixelate an image you already have.
Tiny & hackable β one
server.py, ~200 lines, easy to extend.
Related MCP server: pixel-mcp
π§ How it works
MCP servers expose tools to an LLM. This one talks to the client (e.g. Claude Code) over stdio using JSON-RPC; the client launches it, lists its tools, and calls them when the model decides to.
prompt βββΆ style preamble βββΆ free image backend (HTTPS)
β raw image bytes
βΌ
Pillow: resize to WxH (NEAREST)
β
quantize to N colors (median cut)
βΌ
save PNG βββΆ PIXEL_OUT_DIR/<out_path>The "make it look like real pixel art" step is the downscale + palette quantize, not the model β that's the part worth keeping no matter which backend you use.
π¦ Requirements
Python 3.10+
Outbound HTTPS at generation time (to the chosen backend)
An MCP client (e.g. Claude Code)
π Install
git clone https://github.com/uncagedspirit/pixel-art-mcp.git
cd pixel-art-mcp
python -m venv .venv
# Windows:
.venv/Scripts/python.exe -m pip install -r requirements.txt
# macOS / Linux:
# .venv/bin/python -m pip install -r requirements.txtOptionally install it as a package (gives you a pixel-art-mcp command):
.venv/Scripts/python.exe -m pip install .π Register with Claude Code
Add an entry to your project's .mcp.json (or your global Claude config).
Windows
{
"mcpServers": {
"pixel-art": {
"command": "C:/path/to/pixel-art-mcp/.venv/Scripts/python.exe",
"args": ["C:/path/to/pixel-art-mcp/server.py"],
"env": { "PIXEL_OUT_DIR": "C:/path/to/your/project" }
}
}
}macOS / Linux
{
"mcpServers": {
"pixel-art": {
"command": "/path/to/pixel-art-mcp/.venv/bin/python",
"args": ["/path/to/pixel-art-mcp/server.py"],
"env": { "PIXEL_OUT_DIR": "/path/to/your/project" }
}
}
}Then restart Claude Code and approve the pixel-art server. The CLI
alternative: claude mcp add pixel-art -- <python> <server.py>.
PIXEL_OUT_DIRsets where generated files land (defaults to the working directory). Set it to the project you want assets written into.
π οΈ Tools
generate_pixel_art(prompt, out_path, width=160, height=90, colors=32, seed=None)
Generate a pixel-art PNG from a prompt.
Arg | Meaning |
| What to draw |
| Where to save (relative β under |
| Pixel-grid size. |
| Palette size; |
| Optional, for reproducible results |
pixelate_image(in_path, out_path, width=160, height=90, colors=32)
Pixelate an image you already have into a matching style.
ποΈ Backends
Set PIXEL_BACKEND:
Value | Free? | Setup |
| β | nothing β no key |
| free tier | set |
To use a local Stable Diffusion (best quality/control, needs a GPU), add a
backend function that POSTs to your local endpoint (e.g. AUTOMATIC1111 /
ComfyUI / SD.Next) and wire it into _generate_raw. The post-processing stays
the same.
π§ͺ Quick test (without an MCP client)
.venv/Scripts/python.exe -c "import server; print(server.make_pixel_art('cozy cafe interior, side view, warm lamps', 'out/cafe.png', 160, 90, 32, 1))"πΊοΈ Roadmap / ideas
chroma_keytool β generate sprites on a solid background and key it out for transparent characters/props.Sprite-sheet / animation frames (e.g. N-frame idle loops, packed into a strip).
Palette locking β pass a fixed palette so a whole asset set shares colors.
Tileset / tilemap export (Tiled-friendly) for maps.
Batch generation from a manifest (one call β a whole scene set).
Upscaled preview output alongside the true-resolution PNG.
More backends (Replicate, local ComfyUI workflow, Retro Diffusion).
Optional background removal / auto-trim for props.
Deterministic, seed-pinned regeneration + a small results gallery.
Contributions welcome β open an issue or PR.
π€ Contributing
Fork & branch.
Keep
server.pysmall; put new capabilities behind new@mcp.tool()functions.Prefer pure helper functions (like
make_pixel_art) so logic is testable without the MCP transport.Update this README's tool list + roadmap.
β οΈ Notes
Pollinations is a free community service: it can be slow/rate-limited and you should review its terms for your intended (especially commercial) use.
This is a generation/dev tool. It makes network calls when generating; the output is plain local PNGs you commit into your project.
π License
MIT β do whatever, just keep the notice.
Available Tools
2 toolsgenerate_pixel_artA
Generate a pixel-art PNG from a text prompt and save it.
Args: prompt: What to draw, e.g. "cozy library interior, side view, tall arched windows, warm lamps". out_path: Save location (relative paths resolve against PIXEL_OUT_DIR), e.g. "assets/pixel/library/background.png". width: Pixel-grid width (smaller = chunkier). 160x90 suits 16:9 scenes; use 32-64 for sprites/props. height: Pixel-grid height. colors: Palette size (16-48 reads as retro). seed: Optional seed for reproducible output.
Inputs: prompt (required), out_path (required), width, height, +2 more. Returns: result
pixelate_imageC
Pixelate an existing image into matching pixel art (downscale + quantize).
Inputs: in_path (required), out_path (required), width, height, +1 more. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 2 tools
The two tools have clearly distinct purposes: generating pixel art from a text prompt and pixelating an existing image. There is no overlap or ambiguity.
Both tools follow a consistent verb_noun pattern in snake_case: 'generate_pixel_art' and 'pixelate_image'. The naming is predictable and easy to understand.
The server has only two tools, which is on the low side. While they cover basic generation and pixelation, the small number may limit the server's usefulness for complex workflows.
The tool set lacks common operations like listing, deleting, or editing pixel art. The completeness is minimal, covering only creation and transformation without supporting lifecycle management.
Maintenance
Related MCP Connectors
MCP server for Flux AI image generation
Generate AI images, video, music, and sound effects, and upscale them, from any MCP client.
Generate game-ready 3D models, textures, and audio from natural language, over MCP.
Generate AI images and videos from any compatible MCP client.
Related MCP Servers
- AlicenseBqualityDmaintenanceAn MCP server that allows users to generate images using Replicate's Stable Diffusion model and save them to the local filesystem.3MIT
- FlicenseAqualityDmaintenanceAn MCP server that enables AI coding agents to create pixel art programmatically by providing canvas manipulation tools and PNG export.1028 npm9-
- AlicenseNot gradedqualityDmaintenanceMCP server for generating pixel-art sprites with transparent backgrounds using any diffusers-compatible text-to-image model.MIT
- AlicenseNot gradedqualityBmaintenanceAn MCP server that bridges Antigravity AI with LibreSprite, enabling real-time pixel art drawing, animation, and manipulation through natural language commands.MIT