Pixel Art MCP
An MCP server that generates pixel-art PNGs from text prompts, using a free image backend, and saves them directly to your project directory.
README
🎨 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.
<!-- Replace with a real screenshot once you have one -->
<!--
-->
✨ 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.
🧠 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.txt
Optionally 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 |
|---|---|
prompt |
What to draw |
out_path |
Where to save (relative → under PIXEL_OUT_DIR) |
width,height |
Pixel-grid size. 160x90 for 16:9 scenes; 32–64 for sprites |
colors |
Palette size; 16–32 reads as retro |
seed |
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 |
|---|---|---|
pollinations (default) |
✅ | nothing — no key |
huggingface |
free tier | set HF_TOKEN (and optionally HF_MODEL) |
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.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。