2D Assets MCP

v0.1.4
io.github.crony-io/2d-assets-mcp Checked 3 days ago Published 5 months ago

MCP server for generating advanced mock 2D PNG assets for game prototypes.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

generate_mock_asset

Generates a single advanced custom mock 2D PNG asset (supports gradients, patterns, text rotation, transparency, and auto-scaling) for game prototypes. Embeds JSON metadata into the PNG (dimensions, color, shape, description) readable by read_image_metadata.

ParameterTypeDescription
color *stringBackground hex color code, e.g., '#FF5733'
directory *stringAbsolute path to the target project folder
filename *stringName of the file, e.g., 'player_idle.png'
text *stringText to display on the asset
assetDescriptionstringHuman-readable description of this asset stored as image metadata. Useful for models without vision to understand the asset later. E.g. 'Player idle placeholder, blue rectangle 128x128'
fillModestringBackground fill mode. Default is solid when missing.
fillPercentnumberPercentage of the asset to fill, useful for health or progress bars (0-100). Default is 100.
fontSizenumberOptional explicit font size in pixels. If omitted, it auto-scales to fit.
gradientAnglenumberAngle for linear gradients in degrees. Ignored for radial gradients. Default is 45 when missing.
heightnumberHeight in pixels. Default is 128 when missing.
opacitynumberOpacity of the background shape from 0.0 (transparent) to 1.0 (opaque). Default is 1.0 when missing.
patternstringOptional pattern overlay. Default is none when missing.
patternColorstringPattern color. If omitted, a derived contrast color will be used.
patternOpacitynumberPattern overlay opacity from 0.0 to 1.0. Default is 0.18 when missing.
patternScalenumberPattern tile size in pixels. Default is 16 when missing.
secondaryColorstringSecondary color used for gradients. If omitted, a derived variant of color will be used.
shapestringThe geometric shape of the asset. Default is rectangle when missing.
strokeColorstringColor of the asset border hex code. Default is #000000 when missing.
strokeWidthnumberWidth of the asset border in pixels. Set to 0 for no border. Default is 4 when missing.
textColorstringOptional hex color for the text. If omitted, a contrasting color (black or white) will be automatically calculated based on the background.
textPositionstringVertical alignment of the text. Default is center when missing.
textRotationnumberRotation angle for the text in degrees. Default is 0 when missing.
trackColorstringBackground color for the unfilled portion of the asset when fillPercent < 100. Hex code, e.g., '#333333'
widthnumberWidth in pixels. Default is 128 when missing.

generate_mock_asset_batch

Generates multiple mock 2D PNG assets at once. Can create individual files, a spritesheet, Each PNG has embedded JSON metadata readable by read_image_metadata.

ParameterTypeDescription
assets *arrayAn array of asset configuration objects to generate simultaneously
sheetDirectorystringOptional output directory for the spritesheet. Defaults to the first asset directory.
sheetFilenamestringFilename for the generated spritesheet. Default is spritesheet.png when missing.
sheetMarginnumberOuter margin around the spritesheet in pixels. Default is 8 when missing.
sheetSpacingnumberSpacing between spritesheet cells in pixels. Default is 8 when missing.
spritesheetModestringindividual = create separate PNGs only, spritesheet = create only a spritesheet PNG. Default is spritesheet when missing.

read_image_metadata

Reads the embedded JSON metadata from a PNG file generated by this MCP server. Returns the metadata object with dimensions, color, shape, description, etc.

ParameterTypeDescription
filepath *stringAbsolute path to the PNG file to read metadata from