Native AI control of Adobe InDesign via UXP – not AppleScript
Project details
An MCP server that gives Claude direct, native control of Adobe InDesign through a UXP plugin running inside InDesign. 130+ tools covering documents, pages, text, graphics, styles, master spreads, books, and export. Returns structured JSON, supports async/await, works on macOS and Windows. Built with Claude Code.
The InDesign UXP MCP Server provides a robust solution for integrating AI assistants directly with Adobe InDesign through a Model Context Protocol (MCP) server. This server empowers developers to utilize ~130 tools that span the entire InDesign feature set, enabling functionalities related to documents, pages, text, graphics, styles, master spreads, books, and exports.
This project represents a complete rewrite of the original AppleScript-based InDesign MCP server, transitioning to Adobe's modern UXP plugin platform. Here are compelling reasons to leverage UXP:
| Feature | AppleScript (Original) | UXP (This Fork) |
|---|---|---|
| Platform | macOS only | macOS + Windows |
| Execution Path | Node → temp JSX file → AppleScript → InDesign | Node → HTTP → WebSocket → InDesign plugin |
| Speed | Slow (multiple hops involved) | Fast (direct in-process calls) |
| Reliability | Flaky (affected by focus or dialogs) | Stable (uninterrupted by system state) |
| Return Values | Strings only | Structured JSON objects |
| JavaScript Version | ExtendScript (ES3) | Modern JavaScript (ES2015+) |
| Error Messages | Cryptic AppleScript errors | Clear, structured JSON errors |
| String Handling | Manual escaping required | Safe and simple JSON.stringify() usage |
| Async Support | Not supported | Native support with await |
| Future-Proofing | Not recommended (deprecation imminent) | Recommended (official Adobe platform) |
In essence, while the AppleScript version interacts with InDesign externally via macOS automation, the UXP version operates seamlessly within InDesign itself. This results in improved speed, reliability, and cross-platform compatibility.
The architecture is built on a client-server model:
Claude / MCP Client
│
▼
MCP Server (Node.js)
│ POST /execute
▼
Bridge HTTP Server (port 3000)
│ WebSocket
▼
UXP Plugin (inside InDesign)
│ runs as async IIFE with `app` in scope
▼
InDesign DOM
The plugin maintains a persistent WebSocket connection to the bridge, allowing dynamic execution of JavaScript code which interacts with the InDesign Document Object Model (DOM).
The server supports a comprehensive suite of tools categorized as follows:
create_document, open_document, and export_document_xml.add_page, delete_page, and set_spread_properties.The project's core architecture comprises several components:
src/
├── core/
│ ├── InDesignMCPServer.js # MCP server, tool registration
│ ├── scriptExecutor.js # Executes code via UXP
│ └── sessionManager.js # Manages dimensions and positioning
├── handlers/
│ ├── documentHandlers.js
│ ├── pageHandlers.js
│ └── exportHandlers.js
├── types/ # MCP tool schema definitions
└── utils/stringUtils.js
bridge/
└── server.js # HTTP + WebSocket bridge
plugin/
├── index.js # UXP plugin integrates with InDesign
└── manifest.json # Plugin configuration
tests/
├── test-uxp-handlers.js # Core handler tests
└── test-all-handlers.js # Comprehensive tests
The repository is positioned as a state-of-the-art tool to enhance the development experience within Adobe InDesign, leveraging modern capabilities and offering a sustainable future as Adobe transitions away from older technologies. Developers interested in AI integration with InDesign will find this tool invaluable.
Comments
0Start the conversation
Share the first comment.