Skip to main content
Glama
LufiSprite Studio

LufiSprite Studio

by Lufi735

lufisprite-mcp

Model Context Protocol (MCP) Server & Agent Skill for LufiSprite Studio v1.224+

Node.js >= 18 Zero Dependencies MCP Compatible License: MIT

lufisprite-mcp bridges LufiSprite Studio v1.224+ with AI coding agents such as Google Antigravity, Cursor, Claude Code, and Windsurf. Just like Blender MCP, it lets your AI assistant control the live studio canvas in real time—creating projects, painting 2D pixel art, managing layers and animation frames, building 3D scenes/models, and inspecting its own work via PNG screenshots.


Features

  • Zero External Dependencies — Built purely on Node.js native http, crypto, readline, and fs. No npm install required.

  • 2D Pixel Art Creation — Paint whole sprites fast with ASCII character grids (draw_grid_ascii), individual pixels (draw_pixels), geometric shapes (draw_shape), flood fill (flood_fill), and palette management.

  • Layer & Animation Control — Create, reorder/select, toggle visibility/opacity on 2D and 3D layers, add/duplicate animation frames, and adjust FPS.

  • 3D Low-Poly Modeling & Scene Building — Open the 3D viewport, add primitives (cube, cuboid, sphere, cylinder, cone, torus, plane), import procedural or custom Wavefront .obj meshes (import_3d_obj), transform objects, and add lights, cameras, groups, or bones.

  • Visual Feedback Loop — Capture crisp 2D composite or 3D viewport PNG screenshots (get_canvas_screenshot) so the AI agent can visually inspect and refine what it drew.

  • Included Agent Skill (SKILL.md) — Ships with skill/lufisprite-studio/SKILL.md so AI agents automatically follow best practices for palette design, ASCII sprite grids, Y-up 3D modeling, and visual verification.


Related MCP server: aseprite-mcp

Architecture

+-----------------------------------+   stdio (JSON-RPC 2.0)   +-----------------------------------+
| AI Coding Agent                   | <----------------------> | lufisprite-mcp                    |
| (Google Antigravity / Cursor /    |                          | server/index.js                   |
|  Claude Code + SKILL.md)          |                          | WebSocket Server: 127.0.0.1:41924 |
+-----------------------------------+                          +-----------------+-----------------+
                                                                                 ^
                                                                                 | WebSocket (RFC 6455)
                                                                                 v
                                                               +-----------------------------------+
                                                               | LufiSprite Studio v1.224+         |
                                                               | (Browser / Desktop / Capacitor)   |
                                                               | Top-Right MCP Connection Panel    |
                                                               +-----------------------------------+

Because LufiSprite Studio runs in a web/Capacitor environment (where the browser cannot bind a listening TCP port directly), lufisprite-mcp starts the local WebSocket bridge on ws://127.0.0.1:41924, and LufiSprite Studio connects to it from its built-in MCP panel.


Installation

1. Clone the Repository

git clone https://github.com/<your-username>/lufisprite-mcp.git
cd lufisprite-mcp

Requirements:

  • Node.js 18+ (node -v)

  • LufiSprite Studio v1.224+

(No npm install step is needed—there are zero runtime dependencies.)

2. Configure Your AI Coding Tool

Google Antigravity

Add lufisprite-studio to your ~/.gemini/config/mcp_config.json (see examples/antigravity-mcp-config.json):

{
  "mcpServers": {
    "lufisprite-studio": {
      "command": "node",
      "args": [
        "C:\\path\\to\\lufisprite-mcp\\server\\index.js",
        "--port",
        "41924"
      ]
    }
  }
}

Cursor / Claude Code / Windsurf

See examples/cursor-mcp-config.json:

{
  "mcpServers": {
    "lufisprite-studio": {
      "command": "node",
      "args": [
        "/absolute/path/to/lufisprite-mcp/server/index.js"
      ],
      "env": {
        "LUFISPRITE_MCP_PORT": "41924"
      }
    }
  }
}

3. Install the Agent Skill (SKILL.md)

Copy the skill/lufisprite-studio folder into your agent's skills directory so the AI knows the recommended 2D/3D workflows automatically:

  • Google Antigravity (Global): ~/.gemini/config/skills/lufisprite-studio/SKILL.md

  • Workspace-level: <your-project>/.agent/skills/lufisprite-studio/SKILL.md


How to Use

  1. Start your AI coding agent (e.g., Google Antigravity)—it automatically launches lufisprite-mcp and opens ws://127.0.0.1:41924.

  2. Open LufiSprite Studio v1.224+.

  3. On the Home Page (top-right corner, next to the Guide and Settings buttons) or in the Editor top-right bar, click the MCP plug icon.

  4. Verify the WebSocket URL is ws://127.0.0.1:41924 (optional: enable Auto-reconnect) and click Connect.

    • The indicator dot turns green when connected.

    • All incoming MCP tool calls appear in real time in the Live MCP Activity Log.

  5. Prompt your AI agent!

Example Prompts

  • 2D Pixel Art:

    "Create a 32x32 pixel art project in LufiSprite Studio and draw a glowing blue mana potion with highlight shading and a cork stopper. Take a screenshot to verify."

  • Sprite Animation:

    "Add a 4-frame idle bounce animation to the current sprite at 8 FPS."

  • 3D Low-Poly Modeling:

    "Open the 3D viewport in LufiSprite Studio and build a low-poly stylized pine tree next to a wooden cabin using 3D primitives and custom OBJ meshes, then inspect the 3D screenshot."


Available MCP Tools (23 Tools)

App & Project

Tool

Description

get_app_state

Inspect current screen (splash/editor), project dimensions, layers, 3D status, and 3D objects.

create_project

Create and open a new project (name, width, height, enable3D).

list_projects

List projects saved in LufiSprite Studio IndexedDB.

open_project

Open a saved project by id or name.

undo_redo

Undo or redo recent operations (steps).

2D Pixel Art

Tool

Description

draw_grid_ascii

Paint a full sprite or region using ASCII character rows + a char-to-hex palette map.

draw_pixels

Set an array of { x, y, color } pixels in one undoable step.

draw_shape

Draw filled or outlined line, rect, circle, or ellipse.

flood_fill

Contiguous 4-way flood fill starting at (x, y).

clear_layer

Clear all pixels on a 2D layer.

get_layer_pixels

Read non-empty pixels from a 2D layer or bounding box.

Layers, Palette & Animation

Tool

Description

list_layers

List all layers with indices, IDs, types (2d/3d/group), visibility, and opacity.

create_layer

Create a new 2d or 3d layer.

update_layer

Select, rename, toggle visibility/opacity/blendMode, or delete a layer.

set_palette_colors

Set the active color and/or append colors to the active palette.

manage_frames

list, add, duplicate, select, delete animation frames or set_fps.

3D Modeling & Scene

Tool

Description

open_3d_viewport

Ensure a 3D layer exists and open the interactive 3D viewport.

add_3d_primitive

Add cube, cuboid, sphere, cylinder, cone, torus, or plane with position/rotation/scale/color.

import_3d_obj

Import custom/procedural Wavefront .obj mesh text directly into the 3D layer.

transform_3d_object

Move, rotate (degrees), scale, recolor, rename, toggle visibility, or delete any 3D object.

add_3d_scene_item

Add light, sun, point, ambient, camera, group, or bone.

list_3d_objects

List all 3D objects in the 3D layer with their transforms.

Visual Inspection

Tool

Description

get_canvas_screenshot

Capture a PNG screenshot of the 2d composite canvas or 3d viewport/layer.


CLI Options & Health Endpoint

  • --port <number> or LUFISPRITE_MCP_PORT: WebSocket bridge port (default: 41924)

  • --host <ip> or LUFISPRITE_MCP_HOST: Bind address (default: 127.0.0.1)

  • Health check endpoint: GET http://127.0.0.1:41924/health returns JSON { ok, connected, client, wsUrl }.


Running Tests

npm test

Runs test/test-mcp-server.js, verifying MCP initialize, tools/list (23 tools), /health endpoint, WebSocket client connection, JSON tool calls, and >64 KB base64 PNG image round-trips.


Troubleshooting

  • "No LufiSprite Studio instance is connected to ws://127.0.0.1:41924" Open LufiSprite Studio v1.224+, click the MCP plug button in the top-right corner, and click Connect.

  • Port 41924 already in use Pass --port 41925 in mcp_config.json, restart your MCP client, and select the localhost:41925 preset in LufiSprite Studio's MCP panel.

  • Standalone / Manual Bridge Check You can test the bridge directly with node server/index.js --port 41924 and open http://127.0.0.1:41924/health in your browser.


License

MIT

Available Tools

23 tools
add_3d_primitiveB

Add a 3D primitive mesh (cube, cuboid, sphere, cylinder, cone, torus, plane) to the project 3D layer with optional dimensions, position, rotation (degrees), scale, and hex color.

Inputs: kind (required), name, color, scale, +3 more.

add_3d_scene_itemC

Add a 3D light (light, sun, point, ambient), extra camera, group, or bone to the 3D layer.

Inputs: kind (required), name, color, position, +2 more.

clear_layerC

Clear all pixels on the target 2D layer.

Inputs: layerIndex.

create_layerB

Create a new 2D pixel layer or 3D layer in the active project.

Inputs: name, type.

create_projectB

Create and open a new LufiSprite Studio project with the given canvas width/height (4..512) and 3D mode enabled/disabled.

Inputs: name, width, height, enable3D.

draw_grid_asciiA

Paint an entire 2D sprite or region quickly using ASCII character rows and a char->hex color palette map. Characters "." or " " are skipped unless mapped in palette or clearBackground is true.

Inputs: rows (required), palette (required), offsetX, offsetY, +3 more.

draw_pixelsA

Paint individual pixels on a 2D layer in a single undoable operation. Coordinates are 0-based from top-left (x: 0..width-1, y: 0..height-1).

Inputs: pixels (required), layerIndex.

draw_shapeC

Draw a 2D geometric shape (line, rect, circle, ellipse) on a 2D layer.

Inputs: x (required), y (required), color (required), shape (required), +7 more.

flood_fillC

Flood fill a contiguous region starting at (x, y) with the given hex color (or null to erase).

Inputs: x (required), y (required), color (required), layerIndex.

get_app_stateA

Get the current LufiSprite Studio state: screen (splash/editor), active project name/dimensions, 3D enabled flag, active layer/frame, layers list, and 3D objects list.

Inputs: no named parameters.

get_canvas_screenshotA

Capture a PNG screenshot of the current 2D composite canvas (source="2d") or 3D viewport/layer (source="3d") so you can visually inspect your work.

Inputs: scale, source.

get_layer_pixelsC

Read non-empty pixels from a 2D layer (optionally within a bounding rectangle).

Inputs: x, y, width, height, +1 more.

import_3d_objC

Import a procedural or custom Wavefront .obj 3D mesh from raw OBJ text into the project 3D layer.

Inputs: objText (required), name, color, scale, +2 more.

list_3d_objectsB

List all objects (meshes, lights, cameras, groups, bones) in the project 3D layer with their transforms.

Inputs: no named parameters.

list_layersA

List all layers in the active project with their indices, IDs, names, types (2d/3d/group), visibility, and opacity.

Inputs: no named parameters.

list_projectsB

List saved projects stored in LufiSprite Studio IndexedDB.

Inputs: no named parameters.

manage_framesC

List, add, duplicate, select, delete animation frames, or change FPS.

Inputs: action (required), fps, frameIndex.

open_3d_viewportA

Ensure a 3D layer exists and open the interactive 3D viewport in LufiSprite Studio.

Inputs: no named parameters.

open_projectB

Open an existing saved project by id or name.

Inputs: id, name.

set_palette_colorsA

Set the active brush color and/or append hex colors to the active project palette.

Inputs: colors, activeColor.

transform_3d_objectB

Move, rotate (degrees), scale, recolor, rename, toggle visibility, or delete an existing 3D object by id, index, or name.

Inputs: id, name, color, index, +6 more.

undo_redoC

Undo or redo recent actions in LufiSprite Studio.

Inputs: action (required), steps.

update_layerC

Select, rename, toggle visibility/opacity/blendMode, or delete a layer.

Inputs: layerIndex (required), name, action, opacity, +2 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 23 tools

    Disambiguation4/5

    Each tool targets a fairly distinct resource and action: drawing (draw_pixels/flood_fill/draw_shape/draw_grid_ascii) is separated by method, and 2D vs 3D operations are clearly namespaced (add_3d_primitive vs create_layer). Minor ambiguity between add_3d_primitive, import_3d_obj, and add_3d_scene_item, and update_layer is a multi-purpose grab-bag, but descriptions disambiguate them well.

    Naming Consistency4/5

    Nearly all tools follow a verb_noun snake_case pattern (create_project, list_layers, transform_3d_object, get_canvas_screenshot). Small deviations exist: undo_redo lacks a noun, and manage_frames/update_layer are vague multi-action verbs, but overall the convention is predictable.

    Tool Count4/5

    23 tools is on the heavy side of the 3-15 sweet spot, but the domain genuinely spans 2D drawing, layers, frames, palette, 3D meshes, and screenshots, so most tools earn their place. It could be trimmed slightly (e.g. merging some 3D scene-item tools).

    Completeness4/5

    Core lifecycle is covered: project create/open/list, layer create/update/list, drawing primitives, frame management, undo/redo, and visual verification via screenshot. Minor gaps remain—no explicit project delete or export/save-to-file tool, and palette can be set but not read back—but these are workable.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers