Skip to main content
Glama
README.md
# Palette Swapper MCP Lite

Free MCP server that lets your AI coding agent (Claude Code, Cursor, Codex, Claude Desktop, Windsurf, any MCP client) **look at and recolour pixel-art sprites**: real PNG files on your disk, no image editor required.

Every tool that reads an image returns an upscaled preview, so the agent can actually *see* the sprite and check its own work.

- **One file**: `palette-swapper-mcp-lite.mjs`. Node.js 18+. No `npm install`, no API key, no network.
- Runs locally on your files. It never overwrites a file unless you pass `overwrite: true`.
- Reads every PNG flavour (RGBA, RGB, greyscale, indexed, 1–16 bit, interlaced).

## Tools

| Tool | What it does |
|---|---|
| `inspect_sprite` | Size, exact palette (hex + pixel counts), % transparent, preview image |
| `swap_colors` | Replace exact colours in one PNG or a whole folder of frames (`{"#3aa048": "#b13e53"}`) |
| `scale_sprite` | Crisp nearest-neighbour upscale (×2…×16) or integer downscale |
| `export_palette` | Save a sprite's palette as `.gpl` (Aseprite/GIMP/Krita), `.hex` or `.png` strip |

## Install

```bash
curl -O https://atelier10e.github.io/agents-web/agent-a/palette-swapper-mcp/palette-swapper-mcp-lite.mjs
```

**Claude Code** (run it from your game project):
```bash
claude mcp add palette-swapper-lite -- node /absolute/path/to/palette-swapper-mcp-lite.mjs
```

**Cursor** (`.cursor/mcp.json`) / **Claude Desktop** (`claude_desktop_config.json`):
```json
{ "mcpServers": { "palette-swapper-lite": { "command": "node", "args": ["/absolute/path/to/palette-swapper-mcp-lite.mjs"] } } }
```

**Codex CLI** (`~/.codex/config.toml`):
```toml
[mcp_servers.palette-swapper-lite]
command = "node"
args = ["/absolute/path/to/palette-swapper-mcp-lite.mjs"]
```

Then try: *"Inspect example/slime.png, recolour the green to red, and upscale it ×8."*

## Need more? Palette Swapper MCP (full version)

![One prompt: 5 colour variants packed into a sheet with a Phaser atlas](media/shot1_variants_sheet.png)

The full version adds **5 tools**: `make_variants` (many colour variants at once, hue shifts that keep shading, recolour only some colours), `apply_palette` (snap any image to a Lospec/.gpl/.hex palette, perceptual OKLab matching), `add_outline`, `slice_sheet` and `pack_sheet` (sprite sheet + Phaser JSON atlas + Godot hframes/vframes).
4 € on itch.io: https://atelier-10e.itch.io/palette-swapper-mcp · details: https://atelier10e.github.io/agents-web/agent-a/palette-swapper-mcp/

## About

Made by [Atelier 10e](https://atelier10e.github.io/agents-web/agent-a/). Issues and pull requests are welcome.

The PNG decoder was compared pixel by pixel with Pillow on 10 PNG variants (0 differing pixels). The example slime sprite is original and free to use.

MIT licence.