Skip to main content
Glama
InDesign MCP Server

InDesign MCP Server

by 2bj
README.md
# InDesign MCP Server

> **Fork of [chris-enea/indesign-mcp](https://github.com/chris-enea/indesign-mcp)** โ€” extended MCP server for Adobe InDesign via ExtendScript API.

> [๐Ÿ‡ฐ๐Ÿ‡ฌ ะšั‹ั€ะณั‹ะทั‡ะฐ README](README.kg.md)

Model Context Protocol (MCP) server for controlling Adobe InDesign from AI assistants (Claude Desktop, Cursor, etc.). Supports text manipulation, frames, styles, images, master pages, and automatic layout.

## Requirements

- Python 3.10+
- Adobe InDesign (tested with 2023โ€“2026)
- macOS (uses osascript for InDesign communication)
- Active InDesign document

## Installation

```bash
pip install -r requirements.txt
```

Ensure the `scripts/` directory contains the required `.jsx` ExtendScript files (see `scripts/README.md`). Clone from upstream if missing.

## Configuration

### Claude Desktop

Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "indesign": {
      "command": "python3",
      "args": ["/path/to/indesign-mcp/server.py"]
    }
  }
}
```

### Cursor

Add to `.cursor/mcp.json` in your project (or `~/.cursor/mcp.json` globally):

```json
{
  "mcpServers": {
    "indesign": {
      "command": "python3",
      "args": ["/path/to/indesign-mcp/server.py"]
    }
  }
}
```

Launch Adobe InDesign and open a document.

---

## MCP Tools

### Status & Text

| Tool | Description |
|------|-------------|
| `indesign_status` | InDesign application status and document info |
| `get_document_text` | All text from the active document |
| `add_text` | Add text at start, end, or after selection |
| `update_text` | Find and replace text (all occurrences or first only) |
| `remove_text` | Remove text (all occurrences or first only) |

---

### Frames

| Tool | Description |
|------|-------------|
| `create_text_frame` | Create text frame on a page (bounds, layer, initial text) |
| `create_rectangle_frame` | Create rectangle frame |
| `set_frame_bounds` | Set frame geometry (item_id, bounds) |
| `thread_text_frames` | Link two text frames in a flow |
| `list_frames` | List page items and frame metadata |
| `list_pages` | List document pages |
| `list_layers` | List document layers |

---

### Styles

| Tool | Description |
|------|-------------|
| `create_paragraph_style` | Create or update paragraph style |
| `create_character_style` | Create or update character style |
| `apply_paragraph_style` | Apply paragraph style to frame text |
| `apply_character_style` | Apply character style |
| `set_text_format` | Direct formatting (font, size, leading, justification) |
| `list_styles` | List paragraph and character styles |

---

### Images

| Tool | Description |
|------|-------------|
| `place_image` | Place image in existing or new frame |
| `fit_image` | Fit image in frame (proportionally, frame_to_content, content_to_frame) |
| `replace_image` | Replace image in frame |

---

### Word Documents

| Tool | Description |
|------|-------------|
| `place_word_document` | Place .docx/.doc in a frame with formatting preserved |
| `place_word_document_flow` | Place .docx in linked flow across page margins (auto-pages, auto-frames) |

---

### Master Pages & Pages

| Tool | Description |
|------|-------------|
| `list_master_spreads` | List master spreads |
| `insert_page` | Insert page (before/after/end), optionally apply master |
| `delete_page` | Delete page by index |
| `delete_pages_range` | Delete page range |
| `move_page` | Move page before or after another |
| `apply_master_to_pages` | Apply master to specified pages |
| `create_page_from_master` | Create page and apply master |
| `get_page_margin_bounds` | Page margins and resolved margin frame bounds |
| `get_page_grid_info` | Page margins and column grid info |
| `set_page_margins` | Set page margins |
| `set_page_columns` | Set columns and gutter |
| `override_master_item` | Override master item on target page |
| `clear_page_body_frames` | Clear body text frames on page/range |

---

### Layout & Flow

| Tool | Description |
|------|-------------|
| `auto_layout_story` | Auto-flow story text across frames/pages |
| `auto_layout_assets` | Place images in simple grid on page |
| `compose_article_block` | Compose block: title, lead, image, body text |
| `reflow_story` | Link frames and optionally set story text |
| `rebuild_text_flow_by_margins` | Rebuild flow by page margin bounds |
| `validate_overflow` | Find frames with overset text |
| `preflight_text_overflow_report` | Detailed overflow report for all text frames |

---

## Tool Parameters

### `add_text`
- `text` โ€” text to add
- `position` โ€” `"start"`, `"end"`, `"after_selection"` (default: `"end"`)

### `update_text`
- `find_text` โ€” text to find
- `replace_text` โ€” replacement text
- `all_occurrences` โ€” replace all occurrences (default: `false`)

### `remove_text`
- `text` โ€” text to remove
- `all_occurrences` โ€” remove all occurrences (default: `false`)

### `place_word_document`
- `docx_path` โ€” path to .docx/.doc
- `frame_id` โ€” text frame ID (optional)
- `page_index` โ€” page index for creating frame
- `bounds` โ€” `[x1, y1, x2, y2]` for new frame
- `normalize_typography`, `font_family`, `font_style`, `point_size`, `leading`, `justification`, `clear_overrides`, `showing_options`

### `place_word_document_flow`
- `docx_path` โ€” path to .docx
- `start_page_index`, `end_page_index`
- `clear_existing` โ€” clear existing frames (default: `true`)
- `auto_add_pages` โ€” add pages when needed (default: `true`)
- `max_auto_pages` โ€” max pages to auto-add (default: 120)
- same typography options as `place_word_document`

### `create_text_frame` / `create_rectangle_frame`
- `page_index` โ€” page index
- `bounds` โ€” `[x1, y1, x2, y2]`
- `layer_name` โ€” layer name (optional)
- `text` โ€” initial text (text frame only)

### `place_image`
- `image_path` โ€” path to image
- `frame_id` โ€” frame ID (if existing)
- `page_index` + `bounds` โ€” for new frame
- `fit_mode` โ€” `"proportionally"`, `"frame_to_content"`, `"content_to_frame"`

### `insert_page`
- `location` โ€” `"before"`, `"after"`, `"end"`
- `reference_page_index` โ€” for before/after
- `master_name` / `master_id` โ€” master spread

### `apply_master_to_pages`
- `page_indices` โ€” array of page indices
- `master_name` / `master_id`

---

## Architecture

The server uses ExtendScript (.jsx) via macOS `osascript`: sends JavaScript to InDesign and receives JSON responses. Scripts are split by domain (`text`, `frames`, `styles`, `images`, `masters`, `layout`) and loaded from the `scripts/` folder.

## Attribution

Fork of [chris-enea/indesign-mcp](https://github.com/chris-enea/indesign-mcp).

## License

[MIT](LICENSE)