Skip to main content
Glama
README.md
# animate4me-mcp

A small, open-source (MIT) **local stdio MCP server** for [Animate4Me](https://animate4me.com): turn a game symbol, object or character picture into a ready **Spine 4.2 animation** (`skeleton.json` + `skeleton.atlas` + PNG pages in one ZIP) from your AI coding assistant.

It forwards every tool call to the hosted Animate4Me MCP server at `https://animate4me.com/mcp` and adds your API key from an environment variable. Use it when your MCP client only starts local (stdio) servers, or when you want the key in your environment instead of in a config file.

> **Requires a paid Animate4Me plan with API access (Studio or Pro).** There is no free tier. Jobs cost the same tokens as in the web app. See [pricing](https://animate4me.com/pricing.html).

Then you can ask your assistant, for example:

> *"Animate assets/symbols/coin.png with idle and win and put the Spine export in assets/spine."*

The assistant asks for an upload link, uploads the picture, starts the job (after telling you the price), waits for it and saves the ZIP into your project.

## Tools

The tools come from the hosted server, so they are always current. Today:

| Tool | Cost | What it does |
| --- | --- | --- |
| `get_account` | free | Balance, plan, limits and token prices. |
| `list_options` | free | Categories, animations, win styles, free options. |
| `create_upload` | free | A one-time upload link for a local picture (15 minutes, up to 10 MB) and a ready `curl` command; the upload answers with an `upload_id`. |
| `create_job` | **paid** | Starts an animation from an `upload_id` or a public `https://` `image_url` (a symbol or object from an image: 20 tokens; a character: 60 tokens). |
| `get_job` | free | Status and versions; when done, a `download_url` (valid 1 hour) and a `download_command` that saves the ZIP. |
| `edit_job` | **paid** | Change a finished symbol animation in plain words ("jump higher, no spin"), 5 tokens. |
| `split_job` | **paid** | Split the picture into parts that move on their own, 50 tokens. |

Animations: symbols `idle`, `land`, `win`, `dissolve`, `anticipation`, `idle_shine`; objects `appear`, `open`, `open_idle`, `collect`, `explode`, `press`, `hit`, `float`, `coin_spin`, `shake`, `despawn`; characters an `idle` loop. Paid tools state their price, and the assistant is told to ask you before it spends tokens. A refused request charges nothing; a job that fails on the server side is refunded automatically.

## Get an API key

1. Have an Animate4Me account on the Studio or Pro plan.
2. Create a key in [My account > API keys](https://animate4me.com/account.html#apiKeys). It is shown once.
3. Put it in an environment variable, never in a file you commit:

```bash
export A4M_API_KEY=a4m_your_key_here
```

`A4M_KEY` works too. Optional: `A4M_MCP_URL` (default `https://animate4me.com/mcp`).

## Setup

You need Node.js 18 or newer. The server runs straight from GitHub with `npx` (no npm package to install):

```bash
A4M_API_KEY=a4m_your_key_here npx -y --allow-git=all github:axiosdevs/animate4me-mcp
```

It speaks MCP over stdin/stdout, so on its own it just waits; add it to your client as below. `--allow-git=all` is needed on npm 12 and newer, which refuse packages from git by default; older npm versions ignore it with a warning.

### Claude Code

```bash
claude mcp add animate4me -e A4M_API_KEY=a4m_your_key_here -- npx -y --allow-git=all github:axiosdevs/animate4me-mcp
```

Add `--scope user` to use it in every project. Check it with `claude mcp list` or `/mcp`.

### Cursor

`.cursor/mcp.json` in your project (or `~/.cursor/mcp.json` for all projects):

```json
{
  "mcpServers": {
    "animate4me": {
      "command": "npx",
      "args": ["-y", "--allow-git=all", "github:axiosdevs/animate4me-mcp"],
      "env": { "A4M_API_KEY": "${env:A4M_API_KEY}" }
    }
  }
}
```

### VS Code

`.vscode/mcp.json` in your project:

```json
{
  "servers": {
    "animate4me": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "--allow-git=all", "github:axiosdevs/animate4me-mcp"],
      "env": { "A4M_API_KEY": "${env:A4M_API_KEY}" }
    }
  }
}
```

### Claude Desktop

`claude_desktop_config.json` (Settings > Developer > Edit Config):

```json
{
  "mcpServers": {
    "animate4me": {
      "command": "npx",
      "args": ["-y", "--allow-git=all", "github:axiosdevs/animate4me-mcp"],
      "env": { "A4M_API_KEY": "a4m_your_key_here" }
    }
  }
}
```

Restart the app (or reload its MCP servers) after you add the server.

### Docker

```bash
docker build -t animate4me-mcp https://github.com/axiosdevs/animate4me-mcp.git
docker run -i --rm -e A4M_API_KEY=a4m_your_key_here animate4me-mcp
```

### From a clone

```bash
git clone https://github.com/axiosdevs/animate4me-mcp.git
cd animate4me-mcp && npm install
A4M_API_KEY=a4m_your_key_here node bin/animate4me-mcp.js
```

## Or skip this package: connect the remote server directly

Most current clients can talk to the hosted server themselves (Streamable HTTP), with an API key header or with an OAuth sign-in (no key needed):

```
Server URL: https://animate4me.com/mcp
Transport:  Streamable HTTP
Header:     Authorization: Bearer a4m_your_key_here
```

```bash
claude mcp add --transport http animate4me https://animate4me.com/mcp \
  --header "Authorization: Bearer $A4M_API_KEY"
```

Copy-paste setups for each assistant: [animate4me.com/api.html#mcp](https://animate4me.com/api.html#mcp).

## What you get

The ZIP holds Spine 4.2 data: `skeleton.json`, `skeleton.atlas`, PNG texture page(s) with straight alpha and a README. Each animation you picked is a named animation in the skeleton; idle loops are loop-perfect. It plays in any Spine 4.2 runtime (PixiJS, Phaser, Unity, Godot, Unreal, Cocos). A Spine runtime in your product needs your own Spine licence from Esoteric Software. Download an example export to inspect before you buy: [animate4me_witch_v2_spine42.zip](https://animate4me.com/download/animate4me_witch_v2_spine42.zip).

Loading the export in PixiJS v8 with the official runtime (`@esotericsoftware/spine-pixi-v8`):

```js
import { Application, Assets } from "pixi.js";
import { Spine } from "@esotericsoftware/spine-pixi-v8";

const app = new Application();
await app.init({ resizeTo: window, backgroundAlpha: 0 });
document.body.appendChild(app.canvas);

Assets.add({ alias: "coinData", src: "assets/spine/coin/skeleton.json" });
Assets.add({ alias: "coinAtlas", src: "assets/spine/coin/skeleton.atlas" });
await Assets.load(["coinData", "coinAtlas"]);

const coin = Spine.from({ skeleton: "coinData", atlas: "coinAtlas" });
coin.position.set(app.screen.width / 2, app.screen.height / 2);
app.stage.addChild(coin);
coin.state.setAnimation(0, "idle", true);
```

## Errors

Problems come back as readable messages with the API error code. Without a key, or with a wrong or revoked key, every call is refused with `401`:

```
No API key: set the environment variable A4M_API_KEY to an Animate4Me API key (401 unauthorized). ...
```

Other codes: `403 api_not_in_plan` (the account is not on Studio or Pro), `402 insufficient_tokens` (nothing was charged), `429 rate_limited` (60 requests a minute per key). Full list: [API reference](https://animate4me.com/api.html.md).

## Test

```bash
npm install
npm test                         # without a key: expects a clean 401 message
A4M_API_KEY=a4m_... npm test     # with a key: lists the tools and calls the free get_account
```

## Guides

- [Animate your game assets from Claude Code or Cursor with an MCP server](https://gist.github.com/axiosdevs/6e55db289a5be29c1f5e0ab29b06d1e1)
- [How to turn a PNG into a Spine 4.2 animation and load it in PixiJS, Unity and Godot](https://gist.github.com/axiosdevs/7256932664d8fe376ef8e933d1e07fa9)

## Links

- Animate4Me: https://animate4me.com
- API and MCP reference: https://animate4me.com/api.html
- Official MCP Registry entry: `com.animate4me/mcp`
- Contact: contact@animate4me.com

## License

MIT, see [LICENSE](LICENSE). The animations you make are covered by the [Animate4Me terms](https://animate4me.com/terms.html), not by this licence.