# adhosk/indesign-local-mcp architecture

> Architecture diagram of the GitHub repository adhosk/indesign-local-mcp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/adhosk/indesign-local-mcp
- Repository: https://github.com/adhosk/indesign-local-mcp

## Overview

InDesign Desktop MCP exposes document automation over MCP stdio. A client invokes a registered tool; the tool builds ExtendScript, shared helpers wrap and submit it to a serialized executor, and the executor selects COM or the optional file queue to run it in an open InDesign desktop instance. The domain tools cover system state/history, documents, pages/layers, typography, graphics/tables, and export/preflight. The README documents both bridge modes and the startup-script heartbeat; unsampled tool internals are represented by their documented capabilities, not inferred call details.

Main entry points: [`src/tools/common.ts`](https://github.com/adhosk/indesign-local-mcp/blob/main/src/tools/common.ts) (Tool Helpers), [`src/index.ts`](https://github.com/adhosk/indesign-local-mcp/blob/main/src/index.ts) (MCP Server), [`src/bridge/file-bridge.ts`](https://github.com/adhosk/indesign-local-mcp/blob/main/src/bridge/file-bridge.ts) (File Queue Bridge), [`src/bridge/executor.ts`](https://github.com/adhosk/indesign-local-mcp/blob/main/src/bridge/executor.ts) (FIFO Executor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["MCP Interface"]
  node_server["MCP Server<br/>[index.ts]"]
end

subgraph group_domains["InDesign Tools"]
  node_system["System Tools<br/>[system.ts]"]
  node_documents["Document Tools<br/>[documents.ts]"]
  node_pages["Pages And Layers<br/>[pages.ts]"]
  node_text["Text And Typography<br/>[text.ts]"]
  node_graphics["Graphics And Tables<br/>[graphics.ts]"]
  node_export["Export And Preflight<br/>[export.ts]"]
end

subgraph group_runtime["Script Runtime"]
  node_common["Tool Helpers<br/>[common.ts]"]
  node_jsx["ExtendScript Wrapper<br/>[jsx.ts]"]
  node_executor["FIFO Executor<br/>[executor.ts]"]
end

subgraph group_bridges["Execution Bridges"]
  node_com["COM Bridge<br/>[com-bridge.ts]"]
  node_file["File Queue Bridge<br/>[file-bridge.ts]"]
  node_startup["Startup Poller"]
end

node_client(("MCP Client"))
node_indesign(("Adobe InDesign"))

node_client -->|"calls over stdio"| node_server
node_server -->|"registers tools"| node_system
node_server -->|"registers tools"| node_documents
node_server -->|"registers tools"| node_pages
node_server -->|"registers tools"| node_text
node_server -->|"registers tools"| node_graphics
node_server -->|"registers tools"| node_export
node_system -->|"runs scripts via"| node_common
node_documents -->|"runs scripts via"| node_common
node_pages -->|"runs scripts via"| node_common
node_text -->|"runs scripts via"| node_common
node_graphics -->|"runs scripts via"| node_common
node_export -->|"runs scripts via"| node_common
node_common -->|"wraps script"| node_jsx
node_common -->|"submits script"| node_executor
node_executor -->|"dispatches script"| node_com
node_executor -->|"dispatches script"| node_file
node_com -->|"parses response"| node_jsx
node_file -->|"parses response"| node_jsx
node_com -->|"executes ExtendScript"| node_indesign
node_file -->|"queues requests for"| node_startup
node_startup -->|"polls idle tasks"| node_indesign
node_file -.->|"executes ExtendScript"| node_indesign

click node_server "https://github.com/adhosk/indesign-local-mcp/blob/main/src/index.ts"
click node_system "https://github.com/adhosk/indesign-local-mcp/blob/main/src/tools/system.ts"
click node_documents "https://github.com/adhosk/indesign-local-mcp/blob/main/src/tools/documents.ts"
click node_pages "https://github.com/adhosk/indesign-local-mcp/blob/main/src/tools/pages.ts"
click node_text "https://github.com/adhosk/indesign-local-mcp/blob/main/src/tools/text.ts"
click node_graphics "https://github.com/adhosk/indesign-local-mcp/blob/main/src/tools/graphics.ts"
click node_export "https://github.com/adhosk/indesign-local-mcp/blob/main/src/tools/export.ts"
click node_common "https://github.com/adhosk/indesign-local-mcp/blob/main/src/tools/common.ts"
click node_jsx "https://github.com/adhosk/indesign-local-mcp/blob/main/src/bridge/jsx.ts"
click node_executor "https://github.com/adhosk/indesign-local-mcp/blob/main/src/bridge/executor.ts"
click node_com "https://github.com/adhosk/indesign-local-mcp/blob/main/src/bridge/com-bridge.ts"
click node_file "https://github.com/adhosk/indesign-local-mcp/blob/main/src/bridge/file-bridge.ts"
click node_startup "https://github.com/adhosk/indesign-local-mcp/blob/main/scripts/indesign_bridge_startup.jsx"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_server,node_client toneBlue
class node_system,node_documents,node_pages,node_text,node_graphics,node_export toneAmber
class node_common,node_jsx,node_executor toneMint
class node_com,node_file,node_startup toneRose
class node_indesign toneIndigo
```

## Components

### MCP Interface

- [MCP Server](https://github.com/adhosk/indesign-local-mcp/blob/main/src/index.ts): `src/index.ts`

### InDesign Tools

- [System Tools](https://github.com/adhosk/indesign-local-mcp/blob/main/src/tools/system.ts): `src/tools/system.ts`
- [Document Tools](https://github.com/adhosk/indesign-local-mcp/blob/main/src/tools/documents.ts): `src/tools/documents.ts`
- [Pages And Layers](https://github.com/adhosk/indesign-local-mcp/blob/main/src/tools/pages.ts): `src/tools/pages.ts`
- [Text And Typography](https://github.com/adhosk/indesign-local-mcp/blob/main/src/tools/text.ts): `src/tools/text.ts`
- [Graphics And Tables](https://github.com/adhosk/indesign-local-mcp/blob/main/src/tools/graphics.ts): `src/tools/graphics.ts`
- [Export And Preflight](https://github.com/adhosk/indesign-local-mcp/blob/main/src/tools/export.ts): `src/tools/export.ts`

### Script Runtime

- [Tool Helpers](https://github.com/adhosk/indesign-local-mcp/blob/main/src/tools/common.ts): `src/tools/common.ts`
- [ExtendScript Wrapper](https://github.com/adhosk/indesign-local-mcp/blob/main/src/bridge/jsx.ts): `src/bridge/jsx.ts`
- [FIFO Executor](https://github.com/adhosk/indesign-local-mcp/blob/main/src/bridge/executor.ts): `src/bridge/executor.ts`

### Execution Bridges

- [COM Bridge](https://github.com/adhosk/indesign-local-mcp/blob/main/src/bridge/com-bridge.ts): `src/bridge/com-bridge.ts`
- [File Queue Bridge](https://github.com/adhosk/indesign-local-mcp/blob/main/src/bridge/file-bridge.ts): `src/bridge/file-bridge.ts`
- [Startup Poller](https://github.com/adhosk/indesign-local-mcp/blob/main/scripts/indesign_bridge_startup.jsx): `scripts/indesign_bridge_startup.jsx`

### Other components

- **MCP Client**
- **Adobe InDesign**

## Connections

- MCP Client → MCP Server: calls over stdio (evidence: `README.md`)
- MCP Server → System Tools: registers tools (evidence: `src/index.ts`)
- MCP Server → Document Tools: registers tools (evidence: `src/index.ts`)
- MCP Server → Pages And Layers: registers tools (evidence: `src/index.ts`)
- MCP Server → Text And Typography: registers tools (evidence: `src/index.ts`)
- MCP Server → Graphics And Tables: registers tools (evidence: `src/index.ts`)
- MCP Server → Export And Preflight: registers tools (evidence: `src/index.ts`)
- System Tools → Tool Helpers: runs scripts via (evidence: `src/tools/system.ts`)
- Document Tools → Tool Helpers: runs scripts via (evidence: `src/tools/documents.ts`)
- Pages And Layers → Tool Helpers: runs scripts via (evidence: `src/tools/pages.ts`)
- Text And Typography → Tool Helpers: runs scripts via (evidence: `src/tools/text.ts`)
- Graphics And Tables → Tool Helpers: runs scripts via (evidence: `src/tools/graphics.ts`)
- Export And Preflight → Tool Helpers: runs scripts via (evidence: `src/tools/export.ts`)
- Tool Helpers → ExtendScript Wrapper: wraps script (evidence: `src/tools/common.ts`)
- Tool Helpers → FIFO Executor: submits script (evidence: `src/tools/common.ts`)
- FIFO Executor → COM Bridge: dispatches script (evidence: `src/bridge/executor.ts`)
- FIFO Executor → File Queue Bridge: dispatches script (evidence: `src/bridge/executor.ts`)
- COM Bridge → ExtendScript Wrapper: parses response (evidence: `src/bridge/com-bridge.ts`)
- File Queue Bridge → ExtendScript Wrapper: parses response (evidence: `src/bridge/file-bridge.ts`)
- COM Bridge → Adobe InDesign: executes ExtendScript (evidence: `README.md`)
- File Queue Bridge → Startup Poller: queues requests for (evidence: `README.md`)
- Startup Poller → Adobe InDesign: polls idle tasks (evidence: `README.md`)
- File Queue Bridge → Adobe InDesign: executes ExtendScript
