PX-Art

GUIDE

How can Cursor generate sprites for a game?

Cursor does not draw pixels, and no plugin makes it. The workflow that works splits the job: you generate sprites in PX-Art, where they land in a structured game project, and Cursor connects over a read-only MCP endpoint to find them, pull them into your repo and write the loading code. Cursor handles code; PX-Art handles art.

Setting the expectation first

People ask this question expecting a plugin that makes Cursor emit sprite sheets. That does not exist here, and pretending otherwise wastes a day. Cursor is an editor with an agent in it: it edits files, runs commands and calls MCP tools. It has no pixel-art pipeline, and the PX-Art MCP surface is read-only — no generation tool, no write tool, no delete tool.

What you get instead is arguably more useful: the sprites are produced by a pipeline built for them, and Cursor stops guessing about them. Every frame width, animation length, panel inset and sampling mode it writes into your code is a value it read.

The loop

  1. Generate in PX-ArtCreate the game so the style is fixed at project level, generate the character base, then actions per facing. Effects, UI kits, cards and tilesets live in their own modules of the same game.
  2. Review and repair before wiring anythingThe results bench lets you step through frames, delete bad ones, redo a take, or locally repair a single frame. Fix it here — not later, in code, with an offset hack.
  3. Connect Cursor onceAdd an MCP server entry with the URL and the Authorization header. This is a one-time setup per machine.
  4. Ask Cursor to orient itselfStart every asset task by having it call list_games, then list_game_structure and list_characters. Its first turn should establish which project it is working in and what the ID fields mean.
  5. Shortlist, look, then pullsearch_assets narrows by kind, familyId or role; preview_assets shows up to 8 thumbnails so the choice is made by looking rather than by name; get_asset_downloads fetches the originals into the repo.
  6. Have it write the loader in the same turnDownload links are short-lived. Fetching and wiring belong in one pass, not two sessions.
  7. Run the game and go back to step 1If the walk cycle reads wrong, that is an art fix in PX-Art, not a code fix in Cursor.

The configuration

Cursor reads MCP servers from an mcp.json file — project-scoped at .cursor/mcp.json, or global for all projects. PX-Art is an HTTP server, so the entry is a URL plus a header:

{
  "mcpServers": {
    "px-art": {
      "url": "https://px-art.com/api/mcp",
      "headers": { "Authorization": "Bearer pxr_YOUR_TOKEN" }
    }
  }
}

If you use the project-scoped path, add .cursor/mcp.json to .gitignore. The token is a credential that reads your entire account's art; it must not end up in version control. Regenerating it in the PX-Art panel invalidates the old one immediately — which is also the fix if you think it leaked.

Before blaming Cursor for a failed connection, confirm the server side answers:

curl -X POST https://px-art.com/api/mcp \
  -H "Authorization: Bearer pxr_YOUR_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

Twelve tools in the response means the token, transport and protocol version are all fine and the problem is in the client config.

Prompts that actually land

Vague asks produce vague tool use. Constrain the path and the output:

"Call list_games and tell me the notebookId and design.styleKey for each
 project. Don't fetch anything else yet."

"In notebook 12, use list_asset_families to find a UI family with at least
 2 panels and 4 buttons. Show me the family description and styleKey before
 you pick one."

"search_assets in notebook 12 with familyId kit-wood and role button, then
 preview_assets on the top 3. I'll tell you which one."

"Download assets 88, 91 and 95 into src/assets/ui/, then write the HUD
 panel component. Read component.slice and nine-slice it — do not stretch
 the whole image."

"For the hero walk strip, read frameWidth, frames, stripKind and fps from
 the asset, then generate the animation config. If stripKind is not
 'animation', stop and tell me."

The last two encode the failure modes worth guarding against: stretched nine-slice panels, and playback code written for a strip that was never an animation.

Where files should land

Decide this before Cursor decides it for you, or you will get assets scattered across three directories:

src/assets/
  characters/hero-sprite-sheet.png
  characters/hero-sprite-sheet.json   # Aseprite-format atlas JSON
  ui/88-wood-panel.png
  tiles/atlas.png
  tiles/tileset.json

Whole scenes are different — get_scene_bundle already dictates its own layout, rooted at a directory like scene-42-r7/, with scene.json, an optional map.tmj and an assets/ folder whose paths the JSON already references. Let Cursor follow that layout instead of reorganising it; rewriting the paths only creates a diff to maintain.

What Cursor genuinely improves

  • Selection. search_assets matches names, tags and generation descriptions, so searching for "cake" finds a button whose auto-generated name is "button 01" but whose description mentions a cake.
  • Style checking. Each family reports its own style key, comparable against the game's design language — so a family generated months ago under a different style is visible as a mismatch instead of a surprise in the build.
  • Layout facts. analyze_layout returns node counts, bounds, layers and overlapping pairs as deterministic facts, and get_scene_region answers "what is in this rectangle" in draw order.
  • Reproducibility. A scene composition carries a revision; the same scene at the same revision returns byte-identical data, so Cursor can cache and diff safely.

Limits and caveats

  • Cursor cannot create or edit art here. The connection is read-only and consumes no credits.
  • It cannot see your scene rendered. Only per-asset thumbnails, capped at 220px on the longest side, are available. Visual acceptance happens when you run the game.
  • Read-only MCP requires a paid unlock. Any subscription payment or top-up purchase unlocks it permanently, and paid status is re-checked on every call. Formal checkout is still under review and not open yet.
  • One valid token per person. Regenerating it breaks whichever client is still holding the old one, immediately.
  • Every read is logged — time, method, what was read, outcome, the client's self-reported name and source IP. Visible only to you, and only through the web login, so a leaked token's damage can be assessed rather than guessed at.
  • The arrange workspace is desktop work. It needs a large canvas and precise mouse input; on a phone you can browse assets and take notes, not compose scenes.
  • Generation is probabilistic. Results are not guaranteed to match the description and need checking before production. Legitimately generated assets can be used commercially, but third-party rights, applicable law and the terms of the AI providers involved remain yours to verify.

For what the generator produces before Cursor ever sees it, see pixel art animation generator and characters & animation. For the connection itself, see Agent / MCP and AI game assets for coding agents.

FAQ

Can Cursor generate sprites by itself?

No. Cursor is a code editor with an agent; it has no pixel-art pipeline, and the PX-Art MCP connection is read-only with no generation tool. Sprites are generated in PX-Art. Cursor's role is to find the right asset, pull it into the repo and write correct loading code.

How do I add PX-Art to Cursor?

Add an entry to mcp.json — .cursor/mcp.json for one project, or the global file for all projects — with the url https://px-art.com/api/mcp and an Authorization header of Bearer pxr_ followed by your token. Add the project-scoped file to .gitignore so the token is never committed.

What should I ask Cursor to do first?

Have it call list_games and report the notebookId and design style key for each project, without fetching anything else. Establishing which project it is in, before any search, prevents an entire class of wasted turns where the agent invents a notebook ID.

How do I stop Cursor from stretching UI panels?

Tell it to read component.slice and nine-slice the panel. UI assets carry a component block; type panel9 with slice values l, r, t and b means corners must not scale, edges stretch along one axis and the centre stretches both ways. Stretching the whole image smears rounded corners and outlines.

Where should downloaded assets go in the repo?

Decide the layout yourself for loose assets — for example src/assets/characters, src/assets/ui and src/assets/tiles — and tell Cursor. Full scene bundles are the exception: get_scene_bundle dictates a root directory containing scene.json, an optional map.tmj and an assets folder whose paths the JSON already references, so that layout should be kept as-is.

If the animation looks wrong in the game, do I fix it in Cursor?

Usually not. If the motion itself is wrong, that is an art fix: use the PX-Art results bench to delete frames, redo the take or locally repair a single frame, since replacement frames share the strip's scale and baseline. Fix it in code only when the values Cursor wrote disagree with the asset metadata.

Related

Wire your sprites into your game from the editor

Generate in PX-Art, connect Cursor over a read-only token, and let it pull assets and write loaders with the real metadata.

Create a free accountSee pricing

New accounts start with 20 credits. Formal checkout is still under review and not open yet.