PitchHut logo
InDesign UXP MCP Server
Native AI control of Adobe InDesign via UXP – not AppleScript
Pitch

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.

Description

InDesign UXP MCP Server

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.

Key Advantages of Using UXP

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:

FeatureAppleScript (Original)UXP (This Fork)
PlatformmacOS onlymacOS + Windows
Execution PathNode → temp JSX file → AppleScript → InDesignNode → HTTP → WebSocket → InDesign plugin
SpeedSlow (multiple hops involved)Fast (direct in-process calls)
ReliabilityFlaky (affected by focus or dialogs)Stable (uninterrupted by system state)
Return ValuesStrings onlyStructured JSON objects
JavaScript VersionExtendScript (ES3)Modern JavaScript (ES2015+)
Error MessagesCryptic AppleScript errorsClear, structured JSON errors
String HandlingManual escaping requiredSafe and simple JSON.stringify() usage
Async SupportNot supportedNative support with await
Future-ProofingNot 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.

How It Functions

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).

Extensive Toolset

The server supports a comprehensive suite of tools categorized as follows:

  • Documents: Manage InDesign documents through commands like create_document, open_document, and export_document_xml.
  • Pages & Spreads: Commands include add_page, delete_page, and set_spread_properties.
  • Text & Tables: Functions for creating and editing text frames and tables are included.
  • Styles & Colors: Easily manage Paragraph and Character Styles, as well as Color Swatches.
  • Graphics & Shapes: Tools to place images and create various shapes such as rectangles and ellipses.
  • Master Spreads & Layers: Create and manipulate master spreads and layers effectively.
  • Export & Output: Export capabilities include PDF, images, and ePub formats.
  • Utility Functions: Supports executing custom InDesign code and managing session information.

Architecture Overview

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.

0 comments

No comments yet.

Sign in to be the first to comment.