Skip to main content
Glama
README.md
# After Effects 2024 MCP server (ae-mcp)

[![Version](https://img.shields.io/badge/version-2.0.1-blue.svg)](#tool-groups-105-tools)
[![After Effects](https://img.shields.io/badge/Adobe%20After%20Effects-2024%20(v24.6.1)-9999FF.svg)](./docs/01-audit-instalasi-dan-runtime.md)
[![MCP Tools](https://img.shields.io/badge/MCP%20Tools-105-success.svg)](#tool-groups-105-tools)
[![Bridge](https://img.shields.io/badge/Bridge-CEP%2011%2F12%20%2B%20Headless%20CLI-orange.svg)](#how-it-works)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)

[Before and after](#before-and-after) ·
[Remotion vs After Effects](#remotion-output-vs-native-after-effects) ·
[Rendered frames](#rendered-frames-and-live-bridge) ·
[How it works](#how-it-works) ·
[Tool groups](#tool-groups-105-tools) ·
[Quick start](#quick-start) ·
[Audit docs](./docs/README.md)

`ae-mcp` is a Model Context Protocol (MCP) server for Adobe After Effects 2024 (`v24.6.1`, Windows x64). An AI agent connected over stdio can build and edit real `.aep` projects with native compositions, shape layers, keyframes, expressions, audio tracks, and render queue jobs. Because everything lives as native AE layers, a human editor can open the project afterward and adjust any timing, path, or label by hand.

The server exposes 105 tools: 95 core DOM and CLI tools across 11 groups, plus 10 production macros in group 12 for 9:16 sketch explainers, 16:9 paper-cut callouts, atomic batching, and still-frame QA. It connects to a live After Effects GUI session through a local CEP 11/12 extension and falls back to headless `AfterFX.com` and `aerender.exe` when the GUI is closed. The repository also includes the [`ae-video-production`](./skills/ae-video-production/SKILL.md) agent skill and a reusable [`sketch_explainer_9x16_master.aep`](./templates/sketch_explainer_9x16_master.aep) template.

## Before and after

Building multi-scene animations with raw low-level calls hit several After Effects quirks: layout drift from null parenting, shrinking grid expressions, and broken font fallbacks. Wrapping those recurring patterns into v2.0 macros produced the final output on the right.

<table>
  <thead>
    <tr>
      <th width="33%">v1.0: raw primitive calls</th>
      <th width="33%">v1.5: parenting and grid bugs</th>
      <th width="33%">v2.0: macros with visual checks</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td align="center">
        <img src="./assets/showcase/before_v1_flat_caption.png" alt="v1.0 raw primitives render" width="260" />
      </td>
      <td align="center">
        <img src="./assets/showcase/before_v1_5_bugs.png" alt="v1.5 parenting offset and grid bug render" width="260" />
      </td>
      <td align="center">
        <img src="./assets/showcase/after_v2_scene1_hook.png" alt="v2.0 macro render" width="260" />
      </td>
    </tr>
    <tr>
      <td>
        <ul>
          <li>Static caption pill with no word-level timing or yellow marker boxes.</li>
          <li>Default sans-serif banners with no sketch feel.</li>
          <li>Dozens of sequential calls that broke easily whenever adding a layer shifted every existing <code>layerIndex</code> by +1.</li>
        </ul>
      </td>
      <td>
        <ul>
          <li>Parenting the whiteboard while the drop-in null sat off its resting frame threw the whole stage to the bottom right.</li>
          <li>Animating <code>ADBE Grid</code> <code>Anchor</code> without updating <code>Corner</code> shrank the 80px grid squares down to ~15px.</li>
          <li>Passing <code>SegoeUI-Black</code> (with a hyphen) fell back to Times New Roman, and centering each word by its own bounding box left baselines uneven.</li>
        </ul>
      </td>
      <td>
        <ul>
          <li><code>ae_sketch_create_stage_shelf</code> parents the whiteboard at the resting pose before writing keyframes, keeping the stage centered on the shelf.</li>
          <li><code>ae_sketch_create_paper_bg</code> moves <code>Corner</code> along with <code>Anchor</code> so the 80x80px grid stays constant during drift.</li>
          <li><code>ae_sketch_create_karaoke_captions</code> uses the real Windows PostScript name <code>SegoeUIBlack</code>, resets <code>baselineShift</code> to 0, and aligns every word to one cap-height baseline.</li>
        </ul>
      </td>
    </tr>
  </tbody>
</table>

## Remotion output vs native After Effects

To test visual parity, we recreated an existing 9:16 Remotion explainer (`rumah_cash_vs_kpr_explainer`) natively inside After Effects 2024 using the v2.0 macros. The left column is the original React/SVG render from Remotion; the right column is rendered straight from `templates/sketch_explainer_9x16_master.aep`.

<table>
  <thead>
    <tr>
      <th width="16%">Scene</th>
      <th width="42%">Remotion reference (React / SVG)</th>
      <th width="42%">After Effects 2024 (<code>ae-mcp</code> v2.0)</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Scene 1<br/>Hook: Cash vs KPR</td>
      <td align="center"><img src="./assets/showcase/ref_remotion_scene1.png" alt="Remotion Scene 1" width="240" /></td>
      <td align="center"><img src="./assets/showcase/after_v2_scene1_hook.png" alt="After Effects Scene 1" width="240" /></td>
    </tr>
    <tr>
      <td>Scene 2<br/>Line chart and live karaoke</td>
      <td align="center"><img src="./assets/showcase/ref_remotion_scene2.png" alt="Remotion Scene 2" width="240" /></td>
      <td align="center"><img src="./assets/showcase/after_v2_scene2_chart.png" alt="After Effects Scene 2" width="240" /></td>
    </tr>
    <tr>
      <td>Scene 3<br/>Stacked KPR bar chart</td>
      <td align="center"><img src="./assets/showcase/ref_remotion_scene3.png" alt="Remotion Scene 3" width="240" /></td>
      <td align="center"><img src="./assets/showcase/after_v2_scene3_bars.png" alt="After Effects Scene 3" width="240" /></td>
    </tr>
    <tr>
      <td>Scene 4<br/>30% rule and emergency fund</td>
      <td align="center"><img src="./assets/showcase/ref_remotion_scene4.png" alt="Remotion Scene 4" width="240" /></td>
      <td align="center"><img src="./assets/showcase/after_v2_scene4_rules.png" alt="After Effects Scene 4" width="240" /></td>
    </tr>
  </tbody>
</table>

## Rendered frames and live bridge

All six verification frames were exported from [`templates/sketch_explainer_9x16_master.aep`](./templates/sketch_explainer_9x16_master.aep) in one pass through `ae_qa_render_stills_batch`.

<table>
  <tbody>
    <tr>
      <td align="center" width="33%">
        <img src="./assets/showcase/after_v2_scene1_hook.png" alt="Scene 1 hook" width="240" /><br/>
        1. Hook stage and karaoke pill
      </td>
      <td align="center" width="33%">
        <img src="./assets/showcase/after_v2_transition_wipe.png" alt="Diagonal highlighter wipe" width="240" /><br/>
        2. Diagonal highlighter wipe (12 deg)
      </td>
      <td align="center" width="33%">
        <img src="./assets/showcase/after_v2_scene2_chart.png" alt="Scene 2 line chart" width="240" /><br/>
        3. Line chart with spoken vs upcoming words
      </td>
    </tr>
    <tr>
      <td align="center" width="33%">
        <img src="./assets/showcase/after_v2_scene3_bars.png" alt="Scene 3 stacked bar chart" width="240" /><br/>
        4. Stacked bar chart (1x vs 2x)
      </td>
      <td align="center" width="33%">
        <img src="./assets/showcase/after_v2_scene4_rules.png" alt="Scene 4 cashflow rules" width="240" /><br/>
        5. 30% bar and Trim Paths checkmark
      </td>
      <td align="center" width="33%">
        <img src="./assets/showcase/after_v2_scene5_outro.png" alt="Scene 5 outro" width="240" /><br/>
        6. Outro CTA stage
      </td>
    </tr>
  </tbody>
</table>

When working interactively, the CEP extension `com.ae.mcp.bridge` runs inside After Effects 2024 and listens on `http://127.0.0.1:49152` using a per-session token written to `%LOCALAPPDATA%\ae-mcp\session.json`:

<p align="center">
  <img src="./assets/showcase/ae_cep_bridge_live.png" alt="AE MCP Bridge panel running inside Adobe After Effects 2024" width="820" />
</p>

## How it works

### Dual-channel architecture

`ae-mcp` routes each tool call through the fastest available channel depending on whether it needs the live AE DOM, a headless batch process, or a local file scan.

```mermaid
flowchart LR
    AI["AI Agent / MCP Client"] <-->|"MCP over stdio (JSON-RPC)"| MCP["ae-mcp-server (Node.js, TypeScript, Zod, 105 tools)"]

    subgraph CH1["Channel A: Live GUI"]
        CEP["CEP Extension CSXS 11/12 (127.0.0.1:49152 + X-AE-MCP-Token)"]
        JSX["ExtendScript ES3 Dispatcher (json2 + helpers + 101 handlers)"]
        GUI["Adobe After Effects 2024 Active Project"]
        CEP -->|"CSInterface.evalScript"| JSX
        JSX -->|"Single UndoGroup"| GUI
    end

    subgraph CH2["Channel B: Headless CLI"]
        FXCOM["AfterFX.com -noui -m -s (101 handlers preloaded)"]
        AER["aerender.exe (22 CLI flags, MFR)"]
        OUT["Saved .aep, QA .png, final .mp4"]
        FXCOM --> OUT
        AER --> OUT
    end

    subgraph CH3["Channel C: Local reads"]
        LOCAL["Local scanner (702 .ffx presets, 23 scripts, 555 MenuIDs)"]
    end

    MCP -->|"HTTP JSON-RPC + token"| CEP
    MCP -->|"child_process.spawn"| FXCOM
    MCP -->|"child_process.spawn"| AER
    MCP -->|"Direct disk / static JSON"| LOCAL
```

### Video production flow

The `ae-video-production` skill guides the agent through a repeatable loop so layout or typography mistakes get caught before final render:

```mermaid
flowchart TD
    S0["1. Script, word timestamps, and audio assets (VO, BGM, SFX)"] --> S1["2. Load ae-video-production skill"]
    S1 --> S2["3. Create master comp and 80px grid paper (ae_sketch_create_paper_bg)"]
    S2 --> S3["4. Build each scene precomp with ae_batch_execute"]
    S3 --> S3A["Wooden shelf and zero-offset null (ae_sketch_create_stage_shelf)"]
    S3A --> S3B["Auto-fit comic banners (ae_sketch_create_banner)"]
    S3B --> S3C["Artwork and charts parented by layerId (ae_sketch_create_chart)"]
    S3C --> S4["5. Mount scenes, 6fps line boil, and 12 deg highlighter wipes"]
    S4 --> S5["6. Generate word-timed karaoke captions (ae_sketch_create_karaoke_captions)"]
    S5 --> S6["7. Import and mix VO, BGM, and SFX cues"]
    S6 --> S7["8. Render verification frames (ae_qa_render_stills_batch)"]
    S7 --> S8{"9. Visual check passed?"}
    S8 -->|"Layout, font, or timing issue"| S9["Patch target layer via layerId or macro args"]
    S9 --> S7
    S8 -->|"All frames clean"| S10["10. Save .aep and render MP4 via aerender.exe"]
```

### Safety and engine defaults

The CEP bridge binds strictly to `127.0.0.1:49152` and rejects requests that do not send the random `X-AE-MCP-Token` written to `%LOCALAPPDATA%\ae-mcp\session.json` on startup. Arbitrary ExtendScript execution (`ae_eval_extendscript_raw`) stays off unless `ALLOW_RAW_JSX=true` is set in the MCP environment.

Every mutating tool and every `ae_batch_execute` run wraps its work inside one `app.beginUndoGroup()` / `app.endUndoGroup()` pair, so `Ctrl+Z` rolls back an entire operation in one step. Inside the ES3 host layer, helper functions accept permanent `layerId` values to avoid index drift, reset `baselineShift = 0`, `fauxBold = false`, and `fauxItalic = false` on newly added text layers, place shape `Body` groups before `Shadow` groups, and poll until `saveFrameToPng()` finishes flushing each PNG to disk.

## Tool groups (105 tools)

| Group | Tools | Scope |
|---|---:|---|
| 1. App and environment | 8 | Health checks, AE version, installed effects (`app.effects`), fonts, preferences, viewer options |
| 2. Project and footage | 11 | New, open, save `.aep`, file and sequence import, folders, interpret footage, consolidate |
| 3. Compositions and timeline | 9 | Create and edit comps, work area, current time, markers, precompose, duplicate |
| 4. Layers and transform | 12 | Add AV, solid, null, text, shape, camera, and light layers; transforms, switches, parenting by `layerId`, track mattes |
| 5. Properties and animation | 9 | Get/set values, batch keyframes, temporal and spatial easing, expression get/set |
| 6. Shape vectors and masks | 8 | Vector groups, rectangles, ellipses, fills, strokes, Trim Paths, custom bezier paths, masks |
| 7. Text and typography | 5 | `TextDocument` styling, text animators, `sourceRectAtTime` bounds |
| 8. Effects and `.ffx` presets | 8 | Add, modify, and remove effects; apply 702 `.ffx` presets; list local presets and scripts |
| 9. Menu commands and scripts | 7 | Search and run 555 numeric MenuIDs, run `.jsx` scripts |
| 10. Render queue and stills | 8 | Queue management, RS/OM templates, `saveFrameToPng`, Media Encoder handoff |
| 11. Headless CLI and batch | 10 | `aerender.exe` (22 flags, decoded exit codes `0..15`), `AfterFX.com -noui -m -s` |
| 12. Production macros (v2.0) | 10 | Sketch explainer 9:16, documentary 16:9, atomic batch execute, batch still QA |

<details>
<summary>List of all 10 production macros in group 12</summary>

- `ae_batch_execute`: run multiple tool commands in one HTTP call and one UndoGroup, referencing prior outputs via `$prev.id` or `$0.stageNullId`.
- `ae_sketch_create_paper_bg`: graph-paper solid with constant 80x80px squares and synchronized `Anchor`/`Corner` parallax drift.
- `ae_sketch_create_banner`: rounded comic banner with auto-measured text padding, `Body` above `Shadow`, slight tilt, and spring pop-in.
- `ae_sketch_create_stage_shelf`: wooden shelf, brackets, whiteboard card, zero-offset SquashLand null, and optional landing dust puffs.
- `ae_sketch_add_line_boil`: 6fps hand-inked crinkly outline (`ADBE Turbulent Displace` with `Amount: 8.5, Size: 6.0, Complexity: 4.0` plus `ADBE Roughen Edges` `Border: 2.2, Scale: 26`, both stepped with `posterizeTime(6)`) and subtle scale breathing.
- `ae_sketch_add_highlighter_wipe`: 12-degree `ADBE Linear Wipe` synced to a sweeping highlighter bar.
- `ae_sketch_create_karaoke_captions`: word-timed caption precomp using `SegoeUIBlack`, uniform cap-height baseline alignment, `#a9a49c` upcoming words, `#16161a` spoken words, and `#fbc50f` pop-in marker boxes.
- `ae_sketch_create_chart`: animated line charts (Trim Paths, endpoint dots, callout pills) and stacked bar charts with top badges.
- `ae_doc_stabilo_follow_cam`: 16:9 clipping card with a `Multiply` Stabilo sweep and 2.5D camera pan/tilt.
- `ae_qa_render_stills_batch`: render a list of timestamps to PNG and wait until each file finishes writing before returning byte counts.

</details>

## Repository layout

```text
ae-mcp/
├── README.md                              # Project overview, visual comparisons, flows, and setup
├── CONTRIBUTING.md                        # Contributor setup and ExtendScript ES3 rules
├── LICENSE                                # MIT license
├── package.json                           # Build, start, CEP installer, and smoke test scripts
├── tsconfig.json
│
├── src/                                   # TypeScript MCP server (stdio, Zod, 105 tools)
│   ├── index.ts                           # Server entrypoint
│   ├── config.ts                          # AE 2024 paths, session.json path, ALLOW_RAW_JSX guard
│   ├── bridge/
│   │   ├── cepClient.ts                   # HTTP JSON-RPC client for live CEP panel
│   │   ├── cliClient.ts                   # aerender.exe and AfterFX.com -noui -m -s runners
│   │   └── localAudit.ts                  # Local scanner for .ffx presets, scripts, and MenuIDs
│   ├── data/menuIds.json                  # 555 numeric AE 2024 MenuIDs
│   └── tools/registerTools.ts             # Zod schemas and tool registrations
│
├── cep/com.ae.mcp.bridge/                 # CEP 11/12 extension bundle
│   ├── CSXS/manifest.xml
│   ├── index.html                         # Bridge panel UI (v2.0.0)
│   ├── client/main.js                     # Local HTTP server on 127.0.0.1:49152
│   └── host/                              # ES3 ExtendScript dispatcher (101 handlers)
│       ├── index.jsx
│       ├── json2.jsx
│       ├── helpers.jsx
│       ├── domains_1_5.jsx
│       ├── domains_6_11.jsx
│       └── domains_macros.jsx
│
├── templates/                             # Starter AE projects
│   ├── README.md
│   └── sketch_explainer_9x16_master.aep
│
├── skills/ae-video-production/            # Agent skill for native AE video workflows
│   └── SKILL.md
│
├── assets/showcase/                       # Before/after renders, Remotion comparisons, and panel capture
├── docs/                                  # Local AE 2024 installation audit and tool specs (Indonesian)
└── scripts/                               # install-cep.ps1 and test-mcp.mjs
```

## Quick start

1. Clone and build the TypeScript server:

```powershell
git clone https://github.com/aoisaki01/ae-mcp.git
cd ae-mcp
npm install
npm run build
```

2. Install the CEP extension. This sets `PlayerDebugMode = "1"` under `HKCU:\Software\Adobe\CSXS.11` and `CSXS.12`, then copies the bundle to `%APPDATA%\Adobe\CEP\extensions\com.ae.mcp.bridge`:

```powershell
npm run install:cep
```

3. Run the smoke test to check tool registration, local scanners, and `aerender.exe`:

```powershell
npm run test:smoke
```

Expected output:

```text
[ae-mcp-server] Ready on stdio (105 tools registered — v2.0)
Registered MCP tools: 105
ae_list_presets: ok=true, total=702
ae_list_scripts: ok=true, total=23
ae_list_render_templates: ok=true, RS=5, OM=3
ae_menu_find_command_id: ok=true, matches=2, firstId=3973
ae_cli_aerender -version: ok=true, exitCode=15, stdout="aerender version 24.6.1x2"
ALL SMOKE TESTS PASSED!
```

4. Open Adobe After Effects 2024 and launch `Window > Extensions > AE MCP Bridge`. Once the badge shows `Listening`, add the server to your MCP client configuration:

```json
{
  "mcpServers": {
    "after-effects": {
      "command": "node",
      "args": ["C:\\path\\to\\ae-mcp\\dist\\index.js"],
      "env": {
        "ALLOW_RAW_JSX": "false"
      }
    }
  }
}
```

If you want your AI agent to follow the same macro workflow and visual check loop, copy [`skills/ae-video-production`](./skills/ae-video-production/SKILL.md) into your agent's skills directory.

## Local audit docs

The [`docs/`](./docs/README.md) directory archives the original read-only audit of the local Adobe After Effects 2024 (`24.6.1.2`) installation (written in Indonesian):

| # | File | Contents |
|---:|---|---|
| 0 | [Audit index](./docs/README.md) | Summary of local findings and acceptance criteria |
| 1 | [01-audit-instalasi-dan-runtime.md](./docs/01-audit-instalasi-dan-runtime.md) | Build `24.6.1.2`, binaries, Windows Registry keys, `Prefs.txt`, Node and Python runtimes |
| 2 | [02-audit-kemampuan-bawaan-dan-api.md](./docs/02-audit-kemampuan-bawaan-dan-api.md) | ExtendScript DOM (`58+` classes, `59` enums), `1,242` MenuIDs, `javascript-1.0` expressions, CLI flags |
| 3 | [03-inventaris-efek-dan-plugin.md](./docs/03-inventaris-efek-dan-plugin.md) | `295` built-in effects, `108` `PresetEffects.xml` entries, `889+` third-party plugins |
| 4 | [04-inventaris-preset-skrip-ekstensi.md](./docs/04-inventaris-preset-skrip-ekstensi.md) | `702` `.ffx` presets, `29+` scripts, `12` CEP bundles, `5` UXP entries |
| 5 | [05-arsitektur-koneksi-dan-keamanan.md](./docs/05-arsitektur-koneksi-dan-keamanan.md) | Comparison of 8 connection methods, CEP + CLI architecture, UXP/COM findings, security model |
| 6 | [06-katalog-tool-mcp-after-effects.md](./docs/06-katalog-tool-mcp-after-effects.md) | Detailed parameter, output, and undo specs for the core `ae_*` tools |

## Contributing and license

See [CONTRIBUTING.md](./CONTRIBUTING.md) for local development steps and ExtendScript ES3 rules. Licensed under the [MIT License](./LICENSE).

TDQS

C2.2/5.0

Scored across 105 tools

Disambiguation3/5

Tools are mostly grouped by After Effects object, but several overlap in practice: ae_property_set_value, ae_effect_set_parameters, ae_layer_set_transform, and ae_text_set_document all mutate values on related objects. Compound tools such as ae_project_delete_or_xmp, ae_comp_renderer_and_mogrt, and ae_layer_reorder_duplicate_copy also bundle multiple actions, making selection less predictable.

Naming Consistency3/5

Most names follow ae_<domain>_<action> and use snake_case throughout, which is readable. However, there are deviations like ae_get_app_info, ae_list_fonts, ae_purge_cache, ae_cli_aerender, and several _or_/_and_ compound names, so the pattern is mixed.

Tool Count1/5

With 105 tools, the surface is far beyond a well-scoped MCP server and exceeds the 50+ threshold for extreme mismatch. While After Effects is broad, many tools are highly granular or compound, creating a large discovery and selection burden.

Completeness4/5

Coverage is very broad: project/comp/layer lifecycle, text, shapes, masks, effects, properties/keyframes, render queue, expressions, scripts, batch execution, and QA utilities are all represented. Some higher-level conveniences and explicit undo/redo-style operations are missing, but most workflows are achievable through existing tools.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues