
mc-asset — Minecraft Pixel Asset Engine
io.github.smile-minecraft由 GitHub 帳號 smile-minecraft 發布v0.5.0更新於 Nov 1, 2026
Deterministic Minecraft pixel-art engine: textures, animation sheets, and pack validation.
概覽
確定性的 Minecraft Java 資源包像素畫引擎,讓助理繪製、轉換、驗證並打包貼圖、模型與資源包。
- 可以做什麼
- 繪製與建構貼圖:算繪字元網格、建構可編輯來源檔、批次像素操作、匯入與變換點陣圖
- 轉換與換色:將參考圖像素化、調色盤量化、瑕疵清理、依材質重新上色並批次產生材質變體
- 產生與平鋪:帶種子的程序化圖樣、接縫偵測、GUI 九宮格縮放、動畫圖集打包與 mcmeta 中繼資料
- 檢查與比較:指標分析、調色盤報告、結構或合成檢視、逐像素 PNG 差異、無損 PNG 最佳化
- 驗證與打包:單張貼圖與整包驗證、Java 方塊模型建立/驗證/預覽、資源包骨架、編目與可重現壓縮檔
- 適用情境
- 適合製作或審查 Minecraft Java 資源包與像素畫時使用,尤其是需要助理依文字產生精確、可重現的貼圖,而非憑肉眼擺放像素,或需要檢查資源包中的失效參照與命名問題。
- 執行需求
- 以 stdio 在本機執行,通常用 npx -y mc-asset mcp 啟動,因此需要 Node.js(已在 Node.js 22 測試,Bun 1.3 亦可)。未宣告需要帳號、API 金鑰或環境變數。僅支援桌面用戶端。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 mc-asset — Minecraft Pixel Asset Engine,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
mc-asset
[CI] [Release] [License] [npm]
mc-asset is a texture and model tool for Minecraft Java Edition resource packs, built for both creators and AI agents over the command line (CLI) or MCP.
Language models can't place pixels by eye, so mc-asset turns texture work into text and commands: draw a sprite as a character grid, pixelize reference art, generate tiling textures, pack animation sheets, preview cuboid models, and validate a whole resource pack, from a shell or over MCP. The same input and seed always produce identical files.
[A sword, pickaxe, apple, potion, sapphire, and key, each a 16×16 sprite in the vanilla style]
Six 16×16 items, each written as a text grid and drawn by mc-asset render (shown ×6), following the vanilla style rules in the minecraft-pixel-art skill. The grids are in docs/assets/showcase/items/.
Contents
- What It Does
- Highlights
- Showcase
- Installation
- For AI agents
- Quickstart
- Practical Recipes
- MCP Server
- Command Reference
- Batch Operations (
--operations) - Architecture & Reliability Guarantees
- Development
- License
What It Does
- Draw textures from text character grids (
render) - Downsample reference art into pixel art (
pixelize) and reduce colors (quantize) - Fan one sprite out into material variants (
variant) - Generate and seam-check tiling textures (
generate,tile) - Pack animation sprite sheets and write
.mcmetafiles (animate,mcmeta) - Scale GUI sprites with nine-slice borders (
gui-scale) - Compare two PNGs pixel by pixel (
compare) - Validate a single texture or a whole resource pack (
validate,validate-pack) - Losslessly compress PNGs (
optimize) - Create, validate, and preview Java block models (
model) - Author complete resource packs from declarative recipes, audit styles, catalog vanilla assets, and export reproducible zips (
pack,style) - Expose all capabilities to AI agents over an MCP server (
mcp)
Highlights
- Text in, texture out. Sprites are character grids (
.grid) or editable multi-layer sources (.mcpx) that build to PNG. Seedocs/mcpx-format.md. - Identical output. No unseeded randomness and integer-only color blending, so PNG and
.mcpxoutput is identical run to run and between Bun and Node. - One engine, two front ends. The CLI and the stdio MCP server call the same core, so an agent gets the exact same result as a shell script.
- Uniform JSON output.
--jsonalways returns{ success, result, error }with a stable error code, and logs never mix into stdout data. - No surprise writes. Every output path is explicit, existing files need
--force, and each file is written to a temp file before being renamed into place.
Showcase
Every image below is produced by mc-asset itself, with fixed seeds for the generated textures, so the whole set is reproducible. The commands live in docs/assets/showcase/README.md.
Material variants — the sword from the top of this page fanned out into all nine built-in materials (copper, crystal, diamond, gold, iron, netherite, oxidized_copper, stone, wood, shown ×5). Its palette gives each color a role, so the blade and guard take the new ramp while the darkest outline, the white glint, the wooden grip, and the guard's gem keep their colors:
[the sword recolored into nine materials]
Generated patterns — every generate pattern as a 16px swatch from a fixed seed (shown ×4):
Seamless tiling — a 16px brick block face (left, ×8) and a 4×4 wall of it (right, ×4); the mortar lines continue across every edge:
[tile source] [4x4 tiled wall]
Block textures — stone, dirt, and oak planks as 16×16 textures (left, ×8) that tile cleanly across all four edges. On the right is a 4×4 wall of the planks texture (×4):
[three block faces] [4x4 planks wall]
Animation sheet — four frames of a glowing ore block packed into one vertical strip (×4), the layout Minecraft reads with an .mcmeta animation:
Potion variants and compare — the potion recolored into crystal, gold, and iron (×5) while the glass bottle, wooden cork, and white glint keep their colors; compare of the iron and gold variants finds 72 changed liquid pixels, marked in magenta on the diagnostic (×8):
[the potion recolored into three materials] [compare diagnostic of two potion variants]
Button nine-slice — a 16px button frame (left, ×4) scaled to 48×16 with nine-slice (middle, ×4) and with plain stretch (right, ×4); the nine-slice keeps the corners and bevels crisp while the stretch smears them:
[button source] [button nine-slice result] [button stretched result]
Java model three-view preview — a five-cuboid stepped shrine model (model-shrine.json) using the brick, planks, stone, and glowing ore textures shown above. model preview --size 128 looks at it three times: from the front (north, front), from the side (east, right), and from above (top):
[three-view diagnostic preview of a stepped shrine block model]
Installation
Via npm (recommended)
Run the server straight from the registry — no local install needed:
Install the CLI globally to get the mc-asset command on your PATH:
Via Homebrew (macOS / Linux)
Via Bun or Node.js (From Source)
Prerequisites: tested with Node.js 22 and Bun 1.3. bun run build needs Bun and ./bin/mc-asset.js needs Node.js; with Bun alone, run bun ./bin/mc-asset.js.
For AI agents
llms.txt— a compact index of the repository for agents.llms-full.txt— the same material as a single file: install, the twenty-five MCP tools, batch operations, the error model, and the limits.docs/cli-surface.md— the frozen CLI commands, the batch operations specification, and the exit-code registry.docs/mcpx-format.md— the editable multi-layer.mcpxand.gridgrammar and specification.docs/mcp-guide.md— registration, one verbatim capture per MCP tool, and the error model.docs/mcp-surface.md— the frozen MCP surface: tool names, inputs, and the read/write contract.AGENTS.md— the rules for changing this repository.
Agent skills
The repository ships two Agent Skills in skills/, installable with the skills CLI:
mc-asset— the draw → render → preview → measure → validate loop with this tool, the CLI/MCP command map, and how palette roles drive recoloring.minecraft-pixel-art— the vanilla style rules for items, blocks, GUI sprites, and animations: palettes and hue-shifted ramps, material outlines, top-left light, tiling, and an anti-pattern review checklist.
Add --skill mc-asset or --skill minecraft-pixel-art to install only one.
Quickstart
From a Text Grid to a Validated Texture
Draw a 16×16 gem as a character grid, one character per pixel:
Render the grid into a PNG texture and save the editable .mcpx source:
The rendered gem.png, shown ×8:
Check its colors and alpha:
Validate it as a Minecraft item texture:
Practical Recipes
Recipe 1: Downsampling Reference Art (pixelize)
Turn a high-resolution reference image into a 16×16 item texture. The same image and preset always give the same pixels:
--preset itemsets a 16-color budget and turns on the crop, background, subject, edge, and cluster stages.- The other presets are
block,gui,particle, andgeneric.
Recipe 2: Procedural Textures & Seam Tiling (generate & tile)
Generate a stone texture from a fixed seed, then check whether it tiles:
Recipe 3: Palette Quantization & Artifact Cleanup (quantize & cleanup)
Cut a sprite down to 8 colors, then remove the stray pixels left behind:
These fix classes can change alpha, and with it the render pass the texture needs, so cleanup refuses them without --allow-render-pass-change.
Recipe 4: Material Variants (variant & recolor)
Fan one source out into several material tiers, or recolor it to a single
material. The source can be an editable .mcpx or a flat PNG (a PNG
carries no palette roles, so its pixels map by integer luminance bands
with no invented layer roles):
Recipe 5: Animated Sprite Sheets (animate)
Pack a folder of frames into a vertical sheet, then check it against its .mcmeta:
Recipe 6: Full Resource Pack Validation (validate-pack)
Scan a whole resource pack for missing textures, bad namespaces, orphaned textures, broken model references, and reference cycles. --minecraft-version picks the pack format to check against:
Recipe 7: Batch Edits with Visual Feedback (build & apply_asset_operations)
Edit the Quickstart gem in one batch: a 4×4 gold square framed by a 6×6 black outline. The CLI applies the batch and writes a PNG:
Before and after the batch (both ×8):
[gem before the batch] → [gem after the batch]
Over MCP, apply_asset_operations runs the same batch and can send back a picture of what changed:
With feedback, the result keeps its usual fields and adds a PNG image block cropped to the changed area and upscaled by scale (1–16), plus a diff summary (raw, composited, structural, outsideSelectionUnchanged). An edit with no visible change returns noVisibleChange instead of an image. The agent sees its edit without pulling the whole canvas. The output path differs from the CLI run because MCP tools never overwrite an existing file.
Recipe 8: Nine-Slice GUI Scaling (gui-scale)
Resize a GUI frame without smearing its border. With nine_slice, the corners copy 1:1 and the edges and center tile (or stretch, with stretch_inner: true). The 16×16 dialog.png declares a 4px border in dialog.png.mcmeta:
gui-scale never picks up a sibling .mcmeta on its own; without --mcmeta it stretches the whole sprite.
All three are shown ×4. With the mcmeta the cut corners and the 2px bevels copy 1:1 and keep their width; the plain stretch thickens the bevels unevenly and smears the corners.
Recipe 9: Lossless PNG Optimization & Java Models (optimize & model)
optimize re-encodes PNGs into the smallest encoding that holds the same pixels exactly, or keeps the source when nothing is smaller. It takes explicit PNG paths (up to 256 files) or a whole directory (--input-dir, up to 4096 PNGs, optional --recursive, preserving relative paths). It never rewrites its inputs; pick --output, --output-dir, --stdout, or --dry-run.
model works on Java block/item model JSON (cuboid elements only). Create a model, edit it with typed operations, and validate it against a pack:
model apply takes --operations and applies all of them or none; model export places the model and, with --binding, writes an item definition and a blockstate next to it. The checks cover structure and reference validity. No Minecraft client renders the result, so appearance and in-game behavior are not verified.
model preview renders a fixed diagnostic image from cuboid elements: three square panels side by side (front = north face, right = east face, top = up face with north at the top), each --size pixels (64, 128, or 256; default 64):
[three-view diagnostic preview of a stepped shrine block model]
Exactly one of --output or --stdout is required. The report carries panel names and coordinates, the input range, coverage, and warnings. A missing texture renders as a fixed checkerboard with a warning; element rotation, non-1/256 coordinates, translucent faces, and unresolvable textures are listed as partial coverage. display transforms and game lighting are not applied: this is a diagnostic view, not a game renderer.
MCP Server
mc-asset mcp starts a stdio MCP server on the same core as the CLI, so a tool call and the matching command return the same result. It exposes 27 tools.
Exposed MCP Tools
inspect_asset has two modes: structure reports layers, regions, color usage, and overlaps; view returns the composited canvas as a PNG image block, with optional crop and scale (1–16). A view wider than 1024px is refused with a crop hint instead of being downscaled. apply_asset_operations takes an optional feedback object (Recipe 7); without it the result is unchanged. docs/mcp-guide.md has one captured call per tool.
Configuration
Every client runs the same stdio command, npx -y mc-asset mcp. Config file locations change between client versions, so check the client's own docs if one below has moved.
Claude Code
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
Cursor
Add to .cursor/mcp.json:
OpenCode
Add to opencode.json or opencode.jsonc:
Command Reference
Generate animation and GUI metadata (mcmeta)
animation- Required:
--frame-size <N|WxH>(a single row or column of equal frames dividing the PNG; grids are not accepted). - Optional:
--frametime <int>(default1),--frames <json>(frame indices or{index,time}objects with positive integer times),--interpolate.
- Required:
gui- Required:
--type <stretch|tile|nine_slice>;nine_slicealso requires--border <N|json>with non-negativeleft,top,right,bottomand a positive center. - Optional:
--stretch-inner(nine_sliceonly). GUI scaling requires pack format16.0(stretch_innerrequires42.0); seedocs/cli-surface.mdfor version gates and output options.
- Required:
Compare PNG changes (compare)
Compares two same-size PNGs and reports rawChangedPixels, visibleChangedPixels, rawBounds, and visibleBounds. With --output or --stdout (--scale 1..16, longest edge at most 1024px), it writes a diagnostic marker PNG where visible changes are magenta (255,0,255,255), raw-only alpha-zero RGB changes are cyan (0,255,255,255), and unchanged pixels are transparent.
Batch Operations (--operations)
The import, render, and build commands support batch pixel edits via --operations <path> or --operations - (stdin).
- Atomicity: Execution is all-or-nothing. If an operation fails (e.g. out of bounds), all preceding operations in the batch roll back.
- Color Values: Accepts
transparent,#RRGGBB, or#RRGGBBAA. - Vocabulary: 25 typed variants, including 9 pixel operations (
setPixel,clearPixel,drawLine,drawRect,fillRect,floodFill,ellipse,polygonFill,strokeMask) plus layer, region,stampRect, andregionFromSelectionoperations. The full per-type table lives indocs/cli-surface.md. - Shapes:
ellipsefills or outlines the ellipse inside arect;polygonFilltakes up to 4096 integer[x, y]points (more isRESOURCE_LIMIT_EXCEEDED; a self-intersecting ring isSELF_INTERSECTING_POLYGON; no holes);strokeMaskoutlines asourceselection on one layer. - Selection: Pixel operations accept an optional
selectionexpression; an empty match refuses the write withEMPTY_SELECTIONand rolls the batch back.
Architecture & Reliability Guarantees
Determinism Model
- Byte-Identical PNG Encoding: Uses fixed deflate levels and filter strategies (
src/io/png.ts) with pure integer color blending. Output files do not embed timestamps or host metadata. - Seed-Driven PRNG: Procedural generation relies exclusively on an integer xorshift32 PRNG initialized via
--seed. - Cross-Runtime Consistency: Output bytes produced under Bun match bytes produced under Node.js byte for byte for the commands covered by the
scripts/compare-runtime.mjsmatrix.
File & Channel Safety
- Atomic Writes: Every output file is written to a unique temporary file (
.tmp-<pid>-<counter>-<randomhex>-<original name>) in the target directory and committed via atomic rename. - Collision Protection: Paths are resolved to absolute normalized paths folded with Unicode NFC and case-folding. Aliasing the input without
--in-placeor defining duplicate output targets fails before any bytes land on disk. - Channel Isolation:
- Without
--stdout: Human logs route to stdout. With--json, a structured{ success, result, error }envelope routes to stdout and logs route to stderr. - With
--stdout: Raw artifact bytes exclusively own stdout. Envelope and logs route to stderr.
- Without
Standardized Exit Codes
Development
License
MIT © 2026 Smile Minecraft Project
來源:README.md,提交 a6c46dc
工具
0版本歷史
4- v0.5.0最新Oct 18, 2026
- v0.4.0Oct 15, 2026
- v0.3.2Sep 23, 2026
- v0.3.1Sep 21, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分