Skip to main content
Glama
README.md
# After Effects MCP Studio

**Let an AI agent drive Adobe After Effects — with eyes and ears.**
An MCP server + CEP panel for professional motion design: build comps, animate, wire expressions, sync to music, pull from your asset packs, and *look at the result* (contact sheets, onion skins, reference diffs, aerender previews) before calling it done.

![demo](docs/media/demo.gif)

> The promo above was assembled end-to-end by an AI agent through this tool (layout, kinetic type, beat sync, SFX, Deep Glow / BCC / Sapphire looks), then verified with its own contact sheets:
>
> ![contact sheet](docs/media/contact-sheet.jpg)

**Status:** v0.3.1 preview · Windows 11 + After Effects 2025–2027 tested · macOS code paths written but **not yet verified on hardware** · MIT

📖 **使用指南(中文):[docs/GUIDE.zh-CN.md](docs/GUIDE.zh-CN.md)**

---

## Why another AE MCP?

| | |
|---|---|
| **Visual closed loop** | `ae_render_visual`: single frames, multi-time **contact sheets**, 1:1 crops, pixel sampling, **onion skin**, alpha view, **reference compare / diff**, H.264 previews via frames or `aerender`. The agent checks its own work. |
| **Music & sound** | `ae_audio`: multi-band beat / BPM detection → markers, sparse audio-envelope keyframes, SRT/LRC subtitle import. |
| **Your asset library** | `ae_assets`: indexes Motion Bro `pack.json`, AEViewer packs and local folders (`.aep/.ffx/.wav/.mp4`), preview strips, one-call import. `ae_preset` searches user + built-in `.ffx`. |
| **Production-grade safety** | 4-second OS-level modal-dialog watchdog, non-hijacking `.aep` snapshots, single-undo batches, token-protected loopback bridge, coexists with other AE extensions. |
| **Third-party plugins** | Render-tree scan before GUI renders; plugins known to hang the GUI (default: Red Giant Universe) are refused or routed to `aerender` automatically. Deep Glow, BCC, Sapphire, Trapcode work normally. |
| **Agent craft knowledge** | `skills/ae-mcp-studio/`: a progressive-disclosure skill (hybrid 3D precomps, ES3 / AE 2027 gotchas, field notes) with a *propose-on-correction* loop so studio know-how accumulates. |
| **Compact tool surface** | 26 domain tools with `action` enums instead of 100+ tiny tools — less context, fewer wrong calls. |

## Tools (26)

`ae_status` `ae_dialog` `ae_eval_jsx` `ae_project` `ae_comp` `ae_effect` `ae_render_visual` · `ae_layer` `ae_property` `ae_keyframe` `ae_expression` `ae_shape` `ae_text` `ae_mask` `ae_3d` `ae_footage` `ae_item` `ae_marker` `ae_guide` `ae_render_queue` `ae_app` `ae_batch` · `ae_audio` `ae_assets` `ae_preset` `ae_library`

Highlights: Cubic-Bezier → AE speed/influence easing, all three text selectors + variable-font axes, `explode_groups` for shape layers, modern track mattes, Classic / Advanced 3D / Cinema 4D renderers with `hybrid_precomp` + world-space `link_camera`, stage-LED `slice_screens`, `probe_enum` for undocumented plugin dropdowns.

## Architecture

```
AI client ⇄ MCP (stdio | Streamable HTTP) ⇄ Node server ⇄ HTTP + token (127.0.0.1) ⇄ CEP panel ⇄ ExtendScript (strict ES3 modules)
                                   └─ sharp · ffmpeg · fft · aerender · OS dialog watchdog
```

## Quick start

**Requirements:** Node.js 18+ (tested 24), After Effects 2025+, `ffmpeg` on PATH (audio + previews). In AE enable *Preferences → Scripting & Expressions → Allow Scripts to Write Files and Access Network*.

```powershell
git clone https://github.com/panlus/ae-mcp-studio.git
cd ae-mcp-studio
npm install
powershell -ExecutionPolicy Bypass -File .\scripts\install.ps1   # macOS: bash ./scripts/install.sh
```

The installer enables CEP `PlayerDebugMode` (the panel is unsigned), links `cep/` into the CEP extensions folder and links the craft skill into `~/.agents/skills/`. Restart AE and open **Window → Extensions → AE MCP Studio** — the panel starts the bridge.

Add the server to your MCP client:

```json
{
  "mcpServers": {
    "ae-studio": {
      "command": "node",
      "args": ["/absolute/path/to/ae-mcp-studio/server/index.mjs"]
    }
  }
}
```

Streamable HTTP instead: `npm run start:http` → `http://127.0.0.1:47930/mcp`.

Then ask your agent: *"Check `ae_status`, build a 10-second kinetic title in the active comp and show me a contact sheet."*

## Third-party plugins

Some plugins can dead-lock After Effects when they are added or rendered inside the GUI from a script. On the reference machine this was **Red Giant Universe** (its licensing service connection fails), while Deep Glow 2, BCC, Sapphire and Trapcode were fine. The tool therefore:

- refuses to add hazard effects in the GUI (`GUI_HAZARD_EFFECT`, override with `allowHazard: true`),
- blocks GUI renders that contain them and lets `ae_render_visual` render those comps with **aerender** instead (save the project first),
- renders other third-party effects in the GUI with dialog suppression lifted.

Configure the hazard list per user in `%APPDATA%\ae-mcp-studio\config.json` (macOS: `~/Library/Application Support/ae-mcp-studio/config.json`):

```json
{ "guiHazardPatterns": ["^Universe_", "^RG_UNI_", "^MX_UNI_", "^uni\\."] }
```

`[]` disables the guard. Apply hazard plugins headlessly with the GUI closed: `AfterFX.com -noui -r your_pass.jsx` (Windows; `AfterFX.exe -noui -r` does nothing). See the guide for a full example.

## Security

- `ae_eval_jsx` executes arbitrary ExtendScript with your user rights — only connect agents you trust.
- The CEP bridge listens on `127.0.0.1` only and requires a random per-session token written to `%TEMP%/ae-mcp-studio-bridge.json`.
- The Streamable HTTP transport binds to `127.0.0.1` by default; do not expose it on a network interface.

## Development

```bash
npm test                     # unit + MCP handshake + strict-ES3 lint of every .jsx
node scripts/aerender-frames-smoke.mjs <project.aep> <comp> 0 0.5   # aerender frame path, no AE GUI needed
```

JSX changes hot-reload from the panel (**Reload JSX**) or via `ae_project(action="reload_jsx")`; server changes need an MCP client restart. Roadmap and pitfalls log (Chinese): [docs/ROADMAP.md](docs/ROADMAP.md).

## Acknowledgements

Created by Panlus Jing with AI pair-programming. Architecture and agent-workflow design were informed by studying the open-source MCP and After Effects automation community, including [Dakkshin/after-effects-mcp](https://github.com/Dakkshin/after-effects-mcp), [kumoproductions/mcp-aftereffects](https://github.com/kumoproductions/mcp-aftereffects), [Engine-Room-Games/after-effects-mcp](https://github.com/Engine-Room-Games/after-effects-mcp), and [figma/mcp-server-guide](https://github.com/figma/mcp-server-guide).

### Third-party notices
- [`cep/lib/CSInterface.js`](cep/lib/CSInterface.js) — Adobe [CEP-Resources](https://github.com/Adobe-CEP/CEP-Resources) (distributed under the Adobe license notice in its file header).
- [`cep/jsx/vendor/json2.js`](cep/jsx/vendor/json2.js) — Douglas Crockford (Public Domain).
- Core Node dependencies: `@modelcontextprotocol/sdk`, `zod`, `sharp`, `fft.js`, `music-tempo`, `srt-parser-2`.

## License

[MIT](LICENSE) © 2026 Panlus Jing

TDQS

B3.2/5.0

Scored across 26 tools

Disambiguation4/5

Tools are partitioned cleanly by AE domain object (comp, layer, property, keyframe, effect, mask, shape, text, 3D, footage, item, marker, guide, audio, assets, preset, render), so an agent can usually pick correctly. A few boundaries blur: ae_eval_jsx vs ae_batch vs ae_library (all 'run code' paths), ae_render_queue vs ae_render_visual (both rendering), and ae_property vs ae_keyframe vs ae_expression (all get/set on properties).

Naming Consistency5/5

Every tool uses the same ae_<noun> snake_case pattern with a single, uniform action vocabulary (list/info/get/set/add/remove) exposed via an Actions parameter. No camelCase or verb-style drift across the set.

Tool Count3/5

At 26 tools this is at the heavy end, and several top-level tools aggregate many actions each, making the surface feel broad. The count is defensible because each tool maps to a genuinely distinct After Effects subsystem rather than being redundant, but consolidation (e.g. merging render tools or escape hatches) would sharpen it.

Completeness5/5

Coverage across the AE domain is unusually thorough: project lifecycle, comps, layers, properties, keyframes, expressions, effects, masks, shapes, text, 3D, footage, markers, guides, presets, audio, rendering, visual verification, plus status/dialog/watchdog and JSX escape hatches. Only niche gaps remain (e.g. explicit undo/history or composition deletion, likely reachable via item/layer tools).

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues