lassetier-mcp
v0.1.0
Published
MCP server for Lassetier — generate and convert game assets (isometric, top-down, pixel art) from AI agents like Claude Code.
Maintainers
Readme
lassetier-mcp
MCP server for Lassetier — generate and convert game assets (isometric, top-down, platformer, pixel art) directly from AI agents like Claude Code.
The server is a thin client of the public Lassetier REST API: every generation is billed in Lassetier credits (1 credit = $0.01 USD, ~25 credits per asset) and every tool response reports the exact cost and remaining balance.
Setup
- Create an API key at https://lassetier.com/dashboard/settings/api-keys (shown once — store it safely).
- Add the server to Claude Code:
claude mcp add --env LASSETIER_API_KEY=lat_live_xxx --transport stdio lassetier -- npx -y lassetier-mcpThat's it. Open a new Claude Code session and the lassetier tools are available.
Project-scoped .mcp.json (shared with your team — put the key in your shell env instead of the file):
{
"mcpServers": {
"lassetier": {
"type": "stdio",
"command": "npx",
"args": ["-y", "lassetier-mcp"],
"env": { "LASSETIER_API_KEY": "${LASSETIER_API_KEY}" }
}
}
}Environment variables
| Variable | Required | Description |
| --- | --- | --- |
| LASSETIER_API_KEY | yes | Your lat_live_… key |
| LASSETIER_API_URL | no | API base URL (default https://lassetier.com/api/v1) |
Tools
| Tool | Cost | Description |
| --- | --- | --- |
| generate_asset | ~25 credits | One asset from a text prompt; saves the PNG locally if output_path is given |
| convert_image | ~25 credits | Converts a local image into a game asset, faithful to the source |
| generate_batch | ~25 × n | Up to 20 assets of the same style into a folder (tilesets!) |
| animate_asset | free | Procedural animation preset (float, pulse, spin, sway, blink, shake, bob) on an existing asset — 0 credits, instant |
| generate_animation | ~25-100 credits | AI walk/idle/attack/effect animation (method routed internally, failures auto-refunded) |
| pack_spritesheet | free | Packs local images or library assets into an engine-ready spritesheet + atlas (Phaser/PixiJS, Godot 4, Unity, generic) |
| search_library | free | Search your saved assets + CC0 packs |
| download_library_asset | free | Download a library asset into the project |
| list_styles | free | The 6 styles with descriptions |
| get_credits | free | Balance and price per image, in credits |
Styles: isometric, isometric_pixel, topdown, platformer, pixel32, pixel64.
Safety by design
- Files are only written inside the current working directory — absolute or
../escapes are refused. - An existing file is never overwritten unless the agent passes
overwrite: true. - Output paths are validated before any credits are spent.
- Insufficient balance returns the exact shortfall and the purchase URL; failed generations are automatically refunded.
Example session
You: Génère un tileset isométrique de 6 routes et place-le dans assets/tiles/.
Claude Code calls
generate_batch:{ "style": "isometric", "output_dir": "assets/tiles", "prompts": [ { "prompt": "a straight asphalt road tile", "filename": "road-straight.png" }, { "prompt": "a 90 degree asphalt road turn tile", "filename": "road-turn.png" }, { "prompt": "a T-intersection asphalt road tile", "filename": "road-t.png" }, { "prompt": "a 4-way asphalt road crossing tile", "filename": "road-cross.png" }, { "prompt": "an asphalt road tile with a pedestrian crossing", "filename": "road-crosswalk.png" }, { "prompt": "a dead-end asphalt road tile with a roundabout", "filename": "road-end.png" } ] }Result:
Batch: 6 assets in style "isometric" — estimated 150 credits ($1.50) (balance before: 800 credits ($8.00)). ✓ assets/tiles/road-straight.png (503 KB) ✓ assets/tiles/road-turn.png (153 KB) ✓ assets/tiles/road-t.png (210 KB) ✓ assets/tiles/road-cross.png (245 KB) ✓ assets/tiles/road-crosswalk.png (198 KB) ✓ assets/tiles/road-end.png (176 KB) Done: 6/6 assets, total 150 credits ($1.50). Remaining balance: 650 credits ($6.50).All tiles share the same camera angle, lighting and style — ready to drop into your game.
Complete workflow: generate, then pack (free)
The natural chain — ask once:
You: Generate 6 isometric road tiles and pack them into a Phaser spritesheet in assets/tiles/.
Claude Code calls
generate_batch(above), thenpack_spritesheet:{ "image_paths": [ "assets/tiles/road-straight.png", "assets/tiles/road-turn.png", "assets/tiles/road-t.png", "assets/tiles/road-cross.png", "assets/tiles/road-crosswalk.png", "assets/tiles/road-end.png" ], "engine": "phaser", "output_dir": "assets/tiles", "mode": "grid" }Result:
Spritesheet ready — FREE (0 credits, 6 images). ✓ assets/tiles/sheet-0.png ✓ assets/tiles/atlas.json ✓ assets/tiles/INSTRUCTIONS.txt ✓ assets/tiles/stats.json See INSTRUCTIONS.txt for the phaser import steps.
Packing is always free (no AI involved): trim with correct offsets,
MaxRects packing, 1 px edge extrusion against texture bleeding,
duplicate detection, multi-page when needed. Engines: phaser
(also PixiJS), godot (Godot 4 — .tpsheet plugin + native .tres),
unity (.tpsheet for TexturePacker Importer), generic (JSON + CSS).
Animation workflow: generate → animate → pack
You: Generate a gold coin asset, make it spin, and pack it into a Phaser spritesheet.
Claude Code chains three tools:
generate_asset—{ "prompt": "a shiny gold coin", "style": "isometric", "output_path": "assets/coin.png" }(~25 credits)animate_asset—{ "asset_id": "<conversion id from step 1>", "preset": "spin", "output_dir": "assets/coin-spin" }(free)pack_spritesheet—{ "image_paths": ["assets/coin-spin/frame-000.png", …], "engine": "phaser", "output_dir": "assets/coin-spin", "mode": "grid" }(free)Result:
sheet-0.png+atlas.jsonready forthis.anims.create()— total cost 25 credits, the animation itself was free.
CLI
The package also ships a lassetier command:
npm install -g lassetier-mcp
lassetier auth lat_live_xxx # saved to ~/.lassetier/config.json (600), verifiedlassetier generate "un baril de bois" --style iso --out ./assets/barrel.png
lassetier convert ./photo.jpg --style iso-pixel --out ./assets/
lassetier batch ./prompts.txt --style iso --out ./assets/ # one prompt per line, # = comment
lassetier search "medieval house" --game-type iso
lassetier credits- Style aliases:
iso→ isometric,iso-pixel→ isometric_pixel,top-down→ topdown. - Batches over 5 images ask for confirmation with the cost estimate
(
14 images × 25 crédits ≈ 350 credits ($3.50). Continuer ? [o/N]) — bypass with--yesfor CI. --jsonon every command for programmatic use (human noise stays on stderr).- Exit codes:
0success,1error,2insufficient credits. --outaccepts a file or a directory; existing files are never overwritten without--overwrite.
Development
npm install
npm run build
# test locally against the server:
claude mcp add --env LASSETIER_API_KEY=lat_live_xxx --transport stdio lassetier -- node ./dist/index.jsLicense
MIT — the Lassetier API itself is a paid service (pay-as-you-go credits, no subscription).
