
2D Assets MCP
io.github.crony-io由 GitHub 帳號 crony-io 發布v0.1.4更新於 Oct 24, 2026
MCP server for generating advanced mock 2D PNG assets for game prototypes.
概覽
產生佔位用的 2D PNG 遊戲素材(精靈、UI 元素、血條、精靈表)並寫入專案資料夾,還能讀回素材內嵌的中繼資料。
- 可以做什麼
- 產生單一 PNG 佔位素材,可設定形狀、尺寸、顏色、漸層、圖樣、透明度、描邊以及旋轉或自動縮放文字
- 一次批次產生多個素材,可輸出為獨立 PNG,也可合成為單列動畫精靈表
- 讀取產生 PNG 的 EXIF 中內嵌的 JSON 中繼資料,讓沒有視覺能力的模型也能了解素材內容
- 輸出檔名自動附上像素尺寸
- 適用情境
- 適合在遊戲原型階段需要快速佔位美術時使用,例如精靈、UI 按鈕、血條或動畫序列影格,也適合讓無視覺模型檢查產生素材的內容。
- 執行需求
- 以 npm 套件形式透過 stdio 在本機執行(npx 2d-assets-mcp、全域安裝或建置後的儲存庫副本)。需要 Node.js 18 或更新版本。未宣告需要帳號、API 金鑰或環境變數。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 2D Assets MCP,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
2d-assets-mcp
Design your game's feel before you design its art.
[圖片] [npm version] [npm downloads] [License: MIT] [TypeScript]
Just like wireframing helps designers visualize user flows before start sketching, 2d-assets-mcp helps game developers visualize timing, frames-per-second (FPS), collision boundaries, and UI layouts before spending hours on final artwork.
This MCP (Model Context Protocol) server lets any AI assistant (Antigravity, Claude Code, Codex, Devin, or any of them as long as it's MCP-compatible) generate advanced 2D mock/placeholder assets in PNG format right into your project folder. Save time and prototype faster, nail your game's feel with 2d-assets-mcp, and then replace the mockups with original artwork when you are ready.
This MCP is engine-agnostic and it works flawlessly with any game engine that supports PNG import, like:
- Godot
- Unity
- Unreal Engine
- GameMaker
- Construct
- RPG Maker
- And many more!
Save time and create placeholder health bars, spritesheets, and whatever UI elements you can think of with full support for gradients, patterns, transparency, text rotation, and auto-scaling, all via chat and without ever opening an image editor. The idea behind it is to help you test and iterate how your game feels first by prototiping scale, jump arcs, and animation timing without waiting on final art assets, and also with zero friction: Need that placeholder button to be 20% larger? Just ask your AI client to regenerate it.
[!TIP] 2d-assets-mcp has AI-Friendly Metadata → meaning each generated PNG embeds rich JSON metadata (dimensions, color, shape, gradient properties, pattern details, text properties, stroke properties, description) directly in its EXIF data, so AI models without vision can still understand what an asset contains.
Generated Assets Examples
Here are some example assets generated by this MCP server:
Character Sprites & Animations
Hero Idle Animation (8 frames, 512x64)
8-frame idle animation spritesheet with effect
UI Elements
Attack Button (128×48)
Button with red gradient, rounded corners, and "ATTACK" label
Health Bar (200×24)
Health bar at 75% fill with green color and dark gray track
Game Items
Gold Coin (32×32)
Circular coin with radial gradient, dot pattern overlay, and "COIN" label
Grass and water
[tile_grass.png] [tile_water.png]
Trees
Animation Spritesheets
Fire animation (4 frames, 192x48)
4-frame spritesheet
Security Considerations
Asset Content
- Generated assets are pure placeholder graphics and they do not contain malicious code.
- Embedded metadata is plain JSON and is not executable.
Because this MCP server writes files directly to your machine to save you time, please review these security best practices:
File System Access
- The server can write files to any path specified by the AI assistant.
- Recommendation: Configure your AI client to restrict access strictly to your game's project directories.
- Warning: Be cautious when asking the AI to generate assets outside your project directory.
Path Traversal
- This server validates paths, but you should always be aware of potential path traversal attempts when dealing with MCP servers, and review generated file paths before confirming operations.
Overall Best Practices
- Use absolute paths in configurations to prevent ambiguity.
- Restrict AI access to your game project directory only.
- Review generated assets before committing to version control.
- Keep your Node.js dependencies updated.
Core Features
- Instant asset generation: one tool call, one PNG, full visual configuration.
- Spritesheet & Batch mode: generate multiple frames or composite them into a single animation-strip spritesheet in one request.
- Rich visuals: support for solid fills, linear/radial gradients, stripe/dot/grid pattern overlays, rounded corners, circles, opacity, and stroke control.
- Dynamic UI Elements: create partially filled progress/health bars using
fillPercentandtrackColorfor partially-filled assets. - Auto-scaling labels: text automatically scales to fit the asset, or you can override it with explicit
fontSizeif needed. - Non-vision AI friendly: embedded JSON metadata readable back via
read_image_metadata, without loading image pixels, ideal for non-vision AI workflows. - Smart naming: output files are automatically named with their dimensions (e.g.
player_idle_128x128.png) to help models with no vision know the dimensions when using the asset.
Tools Reference
This MCP server equips your AI with 3 tools to generate and read 2D asset metadata.
1. generate_mock_asset
Generates a single PNG asset and writes it to the disk. It supports gradients, patterns, transparency, text rotation, and embedded metadata.
Parameters (press to expand)
Required parameters
Optional parameters: shape & size
Optional parameters: fill & gradient
Optional parameters: progress/health bar
Optional parameters: pattern overlay
Optional parameters: text
Optional parameters: metadata
[!NOTE] Output filename format
The server automatically appends the dimensions to the filename before writing:
2. generate_mock_asset_batch
Generates multiple assets in one request. Supports individual PNGs or a single composed spritesheet.
Parameters (press to expand)
Required parameters
Optional parameters
[!NOTE] Spritesheet layout
All assets are arranged in a single row (traditional animation strip). Each frame cell is sized to the largest asset in the batch; smaller assets are centered within their cell. The output filename includes the total sheet dimensions:
3. read_image_metadata
Reads the JSON metadata embedded in the EXIF ImageDescription field of any PNG generated by this server. Useful for AI models that lack vision, because they can understand what an asset contains without decoding the image.
Parameters (press to expand)
Required parameters
How metadata embedding works
Metadata is stored as a JSON string in the PNG's EXIF IFD0.ImageDescription field using the sharp library's withMetadata API.
Reading it back uses a deliberate bypass of standard TIFF byte-walking: instead of parsing the binary TIFF structure, the raw EXIF buffer is scanned as a UTF-8 string for the known "generator":"2d-assets-mcp" key, then the surrounding JSON object is extracted. This makes the reader immune to TIFF padding, byte-order variations, and unusual IFD layouts across different PNG writers.
Example response (press to expand)
Spritesheet metadata fields (additional fields returned for spritesheet files)
Example Prompts for Your AI
Once connected to an AI coding assistant, try these prompts to speed up your workflow:
Single asset
"Create a 128×128 blue rounded-rectangle placeholder for my player character at
C:\Users\me\project\assets\sprites\(Windows) or/home/me/project/assets/sprites/(Linux) or/Users/me/project/assets/sprites/(macOS). Label it 'Player' and give it a radial gradient."
Health bar
"Generate a health bar PNG at 200×24 pixels, filled 65%, thin stroke, red fill color, dark gray track, at your project's UI folder. Call the file
health_bar.png."
Spritesheet
"Create a 4-frame run cycle spritesheet for my player. Each frame should be 64×64, different shades of blue, labeled Frame 1 through Frame 4. Save it to my project's sprites folder."
Read metadata
"Read the metadata from my project's sprites folder, file
player_idle_128x128.png."
Installation
Option 1: Use directly with npx (no install required)
The fastest way to connect it to any AI coding assistant:
Option 2: Manual installation with package manager (pnpm, npm, yarn)
1. Clone the repository
2. Install dependencies
3. Build the project
4. Configure your MCP client
Option 3: Install globally with pnpm or npm
This project works with any Node.js package manager. Choose your preferred one:
npm
pnpm
Then reference the installed binary:
Claude Code / Claude Desktop
Add to your Claude Code/Claude Desktop MCP settings:
Devin
Add to your Devin MCP settings (mcp_config.json):
Cursor
Create .cursor/mcp.json in your project:
Development
Prerequisites
- Node.js 18 or later
- pnpm 8 or later or npm 9 or later (any package manager works)
Setup
Scripts
Adding a new tool
- Create
src/tools/yourTool.tsand export aregisterYourTool(server: McpServer)function - Import and call it in
src/server.ts - Add any new Zod schemas to
src/schemas.tsand types tosrc/types.ts
License
MIT — see LICENSE for full text.
Contributing
Issues and pull requests are always welcome. Just please, before you open a PR make sure to:
- Run
pnpm run checkornpm run check(zero errors required). - Keep new tools in their own file under
src/tools/. - Export new types from
src/types.tsand schemas fromsrc/schemas.ts. - Update this README's Tools Reference section for any new or changed parameters.
來源:README.md,提交 49e6c76
工具
0版本歷史
1- v0.1.4最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分