Adobe Illustrator has had a scripting language since 2002: ExtendScript, a dialect of JavaScript frozen at ES3. If you want an AI agent to design in Illustrator, that's the door you have to go through. And the door is slow.

Claude builds a 12-page 2027 wall calendar in Illustrator through Chandelier

The problem: 330 ms of plumbing for 3 ms of work

The obvious way to expose Illustrator over MCP is one tool per action: each call starts osascript, writes a temp .jsx file, has Illustrator load a helper library, runs, and reads the result back. I measured it. Creating one rectangle took ~330 ms, and Illustrator's share of that was a few milliseconds.

That adds up fast. An agent building a 12-page calendar this way made 365 tool calls, used 13.3 M input tokens and took 21 minutes.

Fix 1: one process, kept alive

Chandelier starts one bridge process and keeps it: a JXA script on macOS and PowerShell with COM on Windows. The MCP server talks to it over stdin and stdout. No process spawns, no temp files.

Fix 2: load the runtime once

The helper library (selection, colours, text, coordinates) goes into Illustrator once per session as $.global.AIA. After that, each call sends only a one-line command with its JSON arguments. Overhead per call: ~5 ms.

Script files One tool per call Chandelier
Read artboards 150 ms 320 ms 5 ms
200 objects 226 ms (1 call) 66 s (200 calls) 96 ms (1 call)

Fix 3: fewer calls, smaller replies

Speed per call matters less than the number of calls, because an agent re-reads the whole conversation on every turn. So:

  • batch runs up to 1 000 steps in one round trip, and steps can refer to earlier results (@3).
  • Replies are brief by default: a create step lists its first 20 items, which takes 100 items from 2 178 tokens to 271.
  • An optional "lean" tool profile cuts the tool list from 16.2 k to 4.9 k tokens per request.

The calendar went from 365 calls and 21 minutes to 17 calls and 2 minutes.

Fix 4: let the agent see

An agent that can't see its output guesses. preview returns a picture of the artboard. Given a reference image, it also reports how far the content is shifted or scaled and lists each difference (moved, missing, extra, changed) with the items involved. The agent fixes those, then checks once more.

ES3 archaeology

Some things I learned the hard way:

  • No JSON, Array#indexOf or String#trim. The runtime is ES3, enforced by a lint step.
  • Reading ParagraphStyle.characterAttributes crashes Illustrator.
  • Every ExtendScript object already has reflect, watch and toSource, so an option named watch breaks in strange ways.
  • Nested ternaries need brackets, or the parser picks the wrong branch.
  • Iterating doc.pageItems over 5 000 items takes 1.7 s. A recursive walk takes 9 ms.

Try it

/plugin install chandelier --marketplace acidka/chandelier # Claude Code npx -y chandelier-mcp # any MCP client 

Then ask for "a 2027 wall calendar, 12 A4 landscape pages, Monday first, weekends in red".

Code, benchmarks and their caveats: https://github.com/acidka/chandelier