MCP for AI agents

Your AI agent makes the assets

Connect Claude Code, Codex, Cursor or any MCP client to SpriteHatch. Describe what the game needs in your own words: the agent creates characters, animations, effects, items, UI, scenes and tilesets, shows you the result and writes the files straight into your game project.

MCP (Model Context Protocol) is an open standard that lets AI agents use outside tools. The SpriteHatch MCP server gives your agent everything the app does, plus the knowledge of which path fits each need, so it does not waste your credits on the wrong kind of asset.

What your agent can do

You ask forThe agent
A hero, NPC or monster, from a description or from your artCreates candidates, shows them side by side and keeps the one you choose
Another outfit, color, armor or elite versionMakes a skin of the same character (same shape and pose), not a new one
Idle, walk, run, jump, attack, hurt, death or any specific moveAnimates it, reviews it for free and shows you the frames
A power: "the dragon breathes fire at the player"Animates the charge with the effect on the body and creates what flies to the target (projectile, impact, effect on the enemy) as separate effects the game moves
Explosion, hit spark, aura, heal, portal, torch fireCreates the effect and checks it for frames cut by the edge or empty frames
Inventory icons, weapons, potions, propsCreates the item, or extracts the exact object your character holds
Buttons, bars, panels, slotsCreates the piece and its hover, pressed and disabled states
A level background or a top-down mapCreates a seamless scene with parallax layers, or an auto-tile tileset with a Tiled map
"Put it in the game"Exports for your engine, writes the files into the project and uses the manifest (frame size, pivot, fps, timings) to write the code

The right path every time

The server tells the agent, from the first message, how SpriteHatch works best. It also has a free planner the agent calls when it is unsure.

Your credits under control

Before you start

  1. Have the Pro or Studio plan.
  2. Create an API key in the app: avatar → My account and statement → API keys. Copy it now; it is shown in full only once.
  3. For the local server, install uv (it runs uvx): curl -LsSf https://astral.sh/uv/install.sh | sh on macOS/Linux, or winget install astral-sh.uv on Windows. The hosted server needs nothing.
Keep your key secret. It goes in your agent's settings on your machine, never in your game's code or in a public repository. If it leaks, delete it in your account and it stops working immediately.

Local or hosted

Local (recommended)Hosted
Installuvx spritehatch-mcp, started by your agentNothing: just the address and your key
Exported filesWritten straight into your game projectDownload link valid for 30 minutes
Reference imagesFile path, link or base64Public link or base64
Best forCoding agents working inside your game's folderChat apps and machines where you cannot install anything

Install in your agent

Replace sg_live_... with your key. After installing, open a new session of your agent so it loads the tools.

Claude Code

claude mcp add --scope user spritehatch \
  -e SPRITEHATCH_API_KEY=sg_live_... \
  -- uvx spritehatch-mcp
claude mcp add --scope user --transport http spritehatch {{ORIGIN}}/mcp \
  --header "Authorization: Bearer sg_live_..."

--scope user makes it available in every folder; drop it to install only in the current project. Check with claude mcp list.

Codex

In ~/.codex/config.toml:

[mcp_servers.spritehatch]
command = "uvx"
args = ["spritehatch-mcp"]
tool_timeout_sec = 300

[mcp_servers.spritehatch.env]
SPRITEHATCH_API_KEY = "sg_live_..."
# export SG_KEY=sg_live_... in your shell
[mcp_servers.spritehatch]
url = "{{ORIGIN}}/mcp"
bearer_token_env_var = "SG_KEY"
tool_timeout_sec = 300

tool_timeout_sec lets the agent wait for longer generations (premium animations take a few minutes).

Cursor

In ~/.cursor/mcp.json (every project) or .cursor/mcp.json (this project):

{
  "mcpServers": {
    "spritehatch": {
      "command": "uvx",
      "args": ["spritehatch-mcp"],
      "env": { "SPRITEHATCH_API_KEY": "sg_live_..." }
    }
  }
}
{
  "mcpServers": {
    "spritehatch": {
      "url": "{{ORIGIN}}/mcp",
      "headers": { "Authorization": "Bearer sg_live_..." }
    }
  }
}

VS Code (GitHub Copilot)

In .vscode/mcp.json:

{
  "servers": {
    "spritehatch": {
      "type": "stdio",
      "command": "uvx",
      "args": ["spritehatch-mcp"],
      "env": { "SPRITEHATCH_API_KEY": "sg_live_..." }
    }
  }
}
{
  "servers": {
    "spritehatch": {
      "type": "http",
      "url": "{{ORIGIN}}/mcp",
      "headers": { "Authorization": "Bearer sg_live_..." }
    }
  }
}

Windsurf

In ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "spritehatch": {
      "command": "uvx",
      "args": ["spritehatch-mcp"],
      "env": { "SPRITEHATCH_API_KEY": "sg_live_..." }
    }
  }
}
{
  "mcpServers": {
    "spritehatch": {
      "serverUrl": "{{ORIGIN}}/mcp",
      "headers": { "Authorization": "Bearer sg_live_..." }
    }
  }
}

Claude Desktop and other clients

Most clients use the same format: a command for the local server (uvx spritehatch-mcp with SPRITEHATCH_API_KEY in the environment) or an address for the hosted one ({{ORIGIN}}/mcp with the Authorization: Bearer header). In Claude Desktop, the local server goes in claude_desktop_config.json under mcpServers, like the Cursor example.

Settings

Local server: environment variables. Hosted server: request headers.

LocalHostedDefaultWhat it does
SPRITEHATCH_API_KEYAuthorization: Bearer—Your API key (required).
SPRITEHATCH_BUDGETX-SpriteHatch-Budget300Credits a session can spend in total.
SPRITEHATCH_CONFIRM_ABOVEX-SpriteHatch-Confirm-Above60Credits spent without your approval before the agent must ask. 0 = always ask.
SPRITEHATCH_EXPORT_DIR—spritehatch-assetsFolder for exports when the agent does not choose one.

First requests

Talk to the agent as you would to an artist on the team. A few examples:

The agent works inside a SpriteHatch project. The project's style kit (pixel art, character height, 2, 4 or 8 directions, palette) keeps every asset of the game consistent, so tell it the kind of game on the first request.

Every project, asset, skin, ability, animation and job has an id. The agent names things with their id and a link to the panel; in the panel the same id sits next to each item (click to copy), and the sidebar search opens anything the agent mentions by id.

Into the game

Exports come with a manifest the agent reads to write the code: the frame size and the foot pivot, every clip with its frames, fps and loop, the release frame and emitter point of attacks, and the blend mode and pivot of each effect. The same formats as the app: Godot 4, Unity, GameMaker, RPG Maker, atlas JSON (Phaser, PixiJS and others), strips, single frames and GIFs.

Tools

You do not need to call them yourself; this is what the agent sees.

NeedTools
Plan (5 credits)spritehatch_guide, plan_animation
Account and projectsget_account, list_projects, setup_project
What already existslist_assets, get_asset, get_preview
Characters and monsterscreate_character, choose_candidate, add_skin, add_directions
Animationgenerate_animation, review_animation, improve_animation
Attacks and effectscreate_vfx, improve_vfx, create_ability
Items, UI, scenes, tilesetscreate_item, create_ui, add_ui_states, create_scene, add_parallax_layers, create_tileset
Fix and chooseedit_asset, apply_edit, use_version
Wait and deliverwait_for_jobs, export_asset

Troubleshooting

The agent says the key is invalid or the plan has no API

Check that the key was copied in full (it starts with sg_live_) and was not deleted, and that your plan is Pro or Studio.

The tools do not show up

Open a new session of the agent after installing. For the local server, check that uvx works in a terminal (uvx --version).

The agent stopped and asked me to approve

That is the approval limit working: the credits spent since your last OK passed the limit. Say yes and it continues, or change SPRITEHATCH_CONFIRM_ABOVE.

"Session budget reached"

The session spent its budget. Raise SPRITEHATCH_BUDGET (or the header) and open a new session; the agent cannot raise it by itself.

Generation takes long or the agent times out

Generations keep running on SpriteHatch even if the agent stops waiting; ask it to wait for the jobs again. In Codex, raise tool_timeout_sec.

Where do my assets go?

To your SpriteHatch library, in the project the agent used, just like the ones you make in the app. The local server also writes the exports into your game folder.

Create an API key API reference