@alisaitteke/photoshop-mcp 1.1.1 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (235) hide show
  1. package/README.md +179 -965
  2. package/dist/api/extendscript.d.ts +41 -3
  3. package/dist/api/extendscript.d.ts.map +1 -1
  4. package/dist/api/extendscript.js +705 -130
  5. package/dist/api/extendscript.js.map +1 -1
  6. package/dist/api/photoshop-api.js +25 -0
  7. package/dist/api/photoshop-api.js.map +1 -1
  8. package/dist/core/prompt-registry.d.ts +17 -0
  9. package/dist/core/prompt-registry.d.ts.map +1 -0
  10. package/dist/core/prompt-registry.js +34 -0
  11. package/dist/core/prompt-registry.js.map +1 -0
  12. package/dist/core/server.d.ts +3 -0
  13. package/dist/core/server.d.ts.map +1 -1
  14. package/dist/core/server.js +71 -97
  15. package/dist/core/server.js.map +1 -1
  16. package/dist/errors/envelope.d.ts +16 -0
  17. package/dist/errors/envelope.d.ts.map +1 -0
  18. package/dist/errors/envelope.js +76 -0
  19. package/dist/errors/envelope.js.map +1 -0
  20. package/dist/lib/export-paths.d.ts +12 -0
  21. package/dist/lib/export-paths.d.ts.map +1 -0
  22. package/dist/lib/export-paths.js +67 -0
  23. package/dist/lib/export-paths.js.map +1 -0
  24. package/dist/platform/capabilities.d.ts +19 -0
  25. package/dist/platform/capabilities.d.ts.map +1 -0
  26. package/dist/platform/capabilities.js +43 -0
  27. package/dist/platform/capabilities.js.map +1 -0
  28. package/dist/platform/detector.d.ts +2 -0
  29. package/dist/platform/detector.d.ts.map +1 -1
  30. package/dist/platform/detector.js +14 -0
  31. package/dist/platform/detector.js.map +1 -1
  32. package/dist/platform/macos-executor.d.ts.map +1 -1
  33. package/dist/platform/macos-executor.js +5 -8
  34. package/dist/platform/macos-executor.js.map +1 -1
  35. package/dist/platform/windows-executor.d.ts.map +1 -1
  36. package/dist/platform/windows-executor.js +5 -10
  37. package/dist/platform/windows-executor.js.map +1 -1
  38. package/dist/prompts/_shared.d.ts +23 -0
  39. package/dist/prompts/_shared.d.ts.map +1 -0
  40. package/dist/prompts/_shared.js +58 -0
  41. package/dist/prompts/_shared.js.map +1 -0
  42. package/dist/prompts/instructions.d.ts +7 -0
  43. package/dist/prompts/instructions.d.ts.map +1 -0
  44. package/dist/prompts/instructions.js +134 -0
  45. package/dist/prompts/instructions.js.map +1 -0
  46. package/dist/prompts/registry.d.ts +5 -0
  47. package/dist/prompts/registry.d.ts.map +1 -0
  48. package/dist/prompts/registry.js +47 -0
  49. package/dist/prompts/registry.js.map +1 -0
  50. package/dist/prompts/templates/apply-color-grade.d.ts +3 -0
  51. package/dist/prompts/templates/apply-color-grade.d.ts.map +1 -0
  52. package/dist/prompts/templates/apply-color-grade.js +46 -0
  53. package/dist/prompts/templates/apply-color-grade.js.map +1 -0
  54. package/dist/prompts/templates/batch-mockup-replace.d.ts +3 -0
  55. package/dist/prompts/templates/batch-mockup-replace.d.ts.map +1 -0
  56. package/dist/prompts/templates/batch-mockup-replace.js +35 -0
  57. package/dist/prompts/templates/batch-mockup-replace.js.map +1 -0
  58. package/dist/prompts/templates/color-correct.d.ts +3 -0
  59. package/dist/prompts/templates/color-correct.d.ts.map +1 -0
  60. package/dist/prompts/templates/color-correct.js +36 -0
  61. package/dist/prompts/templates/color-correct.js.map +1 -0
  62. package/dist/prompts/templates/composite-blend.d.ts +3 -0
  63. package/dist/prompts/templates/composite-blend.d.ts.map +1 -0
  64. package/dist/prompts/templates/composite-blend.js +60 -0
  65. package/dist/prompts/templates/composite-blend.js.map +1 -0
  66. package/dist/prompts/templates/dodge-burn-guide.d.ts +3 -0
  67. package/dist/prompts/templates/dodge-burn-guide.d.ts.map +1 -0
  68. package/dist/prompts/templates/dodge-burn-guide.js +38 -0
  69. package/dist/prompts/templates/dodge-burn-guide.js.map +1 -0
  70. package/dist/prompts/templates/dodge-burn.d.ts +3 -0
  71. package/dist/prompts/templates/dodge-burn.d.ts.map +1 -0
  72. package/dist/prompts/templates/dodge-burn.js +31 -0
  73. package/dist/prompts/templates/dodge-burn.js.map +1 -0
  74. package/dist/prompts/templates/enhance-portrait.d.ts +3 -0
  75. package/dist/prompts/templates/enhance-portrait.d.ts.map +1 -0
  76. package/dist/prompts/templates/enhance-portrait.js +45 -0
  77. package/dist/prompts/templates/enhance-portrait.js.map +1 -0
  78. package/dist/prompts/templates/export-social-variants.d.ts +3 -0
  79. package/dist/prompts/templates/export-social-variants.d.ts.map +1 -0
  80. package/dist/prompts/templates/export-social-variants.js +45 -0
  81. package/dist/prompts/templates/export-social-variants.js.map +1 -0
  82. package/dist/prompts/templates/frequency-separation.d.ts +3 -0
  83. package/dist/prompts/templates/frequency-separation.d.ts.map +1 -0
  84. package/dist/prompts/templates/frequency-separation.js +29 -0
  85. package/dist/prompts/templates/frequency-separation.js.map +1 -0
  86. package/dist/prompts/templates/gradient-blend.d.ts +3 -0
  87. package/dist/prompts/templates/gradient-blend.d.ts.map +1 -0
  88. package/dist/prompts/templates/gradient-blend.js +43 -0
  89. package/dist/prompts/templates/gradient-blend.js.map +1 -0
  90. package/dist/prompts/templates/gradient-fade.d.ts +3 -0
  91. package/dist/prompts/templates/gradient-fade.d.ts.map +1 -0
  92. package/dist/prompts/templates/gradient-fade.js +57 -0
  93. package/dist/prompts/templates/gradient-fade.js.map +1 -0
  94. package/dist/prompts/templates/organize-layers.d.ts +3 -0
  95. package/dist/prompts/templates/organize-layers.d.ts.map +1 -0
  96. package/dist/prompts/templates/organize-layers.js +43 -0
  97. package/dist/prompts/templates/organize-layers.js.map +1 -0
  98. package/dist/prompts/templates/prepare-for-web.d.ts +3 -0
  99. package/dist/prompts/templates/prepare-for-web.d.ts.map +1 -0
  100. package/dist/prompts/templates/prepare-for-web.js +42 -0
  101. package/dist/prompts/templates/prepare-for-web.js.map +1 -0
  102. package/dist/prompts/templates/remove-background.d.ts +3 -0
  103. package/dist/prompts/templates/remove-background.d.ts.map +1 -0
  104. package/dist/prompts/templates/remove-background.js +36 -0
  105. package/dist/prompts/templates/remove-background.js.map +1 -0
  106. package/dist/prompts/templates/remove-distraction.d.ts +3 -0
  107. package/dist/prompts/templates/remove-distraction.d.ts.map +1 -0
  108. package/dist/prompts/templates/remove-distraction.js +31 -0
  109. package/dist/prompts/templates/remove-distraction.js.map +1 -0
  110. package/dist/prompts/templates/sky-blend.d.ts +3 -0
  111. package/dist/prompts/templates/sky-blend.d.ts.map +1 -0
  112. package/dist/prompts/templates/sky-blend.js +61 -0
  113. package/dist/prompts/templates/sky-blend.js.map +1 -0
  114. package/dist/prompts/templates.d.ts +8 -0
  115. package/dist/prompts/templates.d.ts.map +1 -0
  116. package/dist/prompts/templates.js +162 -0
  117. package/dist/prompts/templates.js.map +1 -0
  118. package/dist/tools/action-tools.d.ts.map +1 -1
  119. package/dist/tools/action-tools.js +8 -1
  120. package/dist/tools/action-tools.js.map +1 -1
  121. package/dist/tools/adjustment-tools.d.ts.map +1 -1
  122. package/dist/tools/adjustment-tools.js +54 -2
  123. package/dist/tools/adjustment-tools.js.map +1 -1
  124. package/dist/tools/atomic-shared.d.ts +15 -0
  125. package/dist/tools/atomic-shared.d.ts.map +1 -0
  126. package/dist/tools/atomic-shared.js +42 -0
  127. package/dist/tools/atomic-shared.js.map +1 -0
  128. package/dist/tools/document-tools.d.ts.map +1 -1
  129. package/dist/tools/document-tools.js +10 -2
  130. package/dist/tools/document-tools.js.map +1 -1
  131. package/dist/tools/image-placement-tools.d.ts.map +1 -1
  132. package/dist/tools/image-placement-tools.js +10 -2
  133. package/dist/tools/image-placement-tools.js.map +1 -1
  134. package/dist/tools/layer-tools.d.ts.map +1 -1
  135. package/dist/tools/layer-tools.js +73 -5
  136. package/dist/tools/layer-tools.js.map +1 -1
  137. package/dist/tools/mask-tools.d.ts +4 -0
  138. package/dist/tools/mask-tools.d.ts.map +1 -0
  139. package/dist/tools/mask-tools.js +107 -0
  140. package/dist/tools/mask-tools.js.map +1 -0
  141. package/dist/tools/recipe-tools.d.ts +4 -0
  142. package/dist/tools/recipe-tools.d.ts.map +1 -0
  143. package/dist/tools/recipe-tools.js +265 -0
  144. package/dist/tools/recipe-tools.js.map +1 -0
  145. package/dist/tools/recipes/_shared.d.ts +37 -0
  146. package/dist/tools/recipes/_shared.d.ts.map +1 -0
  147. package/dist/tools/recipes/_shared.js +261 -0
  148. package/dist/tools/recipes/_shared.js.map +1 -0
  149. package/dist/tools/recipes/apply-color-grade.d.ts +4 -0
  150. package/dist/tools/recipes/apply-color-grade.d.ts.map +1 -0
  151. package/dist/tools/recipes/apply-color-grade.js +98 -0
  152. package/dist/tools/recipes/apply-color-grade.js.map +1 -0
  153. package/dist/tools/recipes/batch-mockup-replace.d.ts +4 -0
  154. package/dist/tools/recipes/batch-mockup-replace.d.ts.map +1 -0
  155. package/dist/tools/recipes/batch-mockup-replace.js +185 -0
  156. package/dist/tools/recipes/batch-mockup-replace.js.map +1 -0
  157. package/dist/tools/recipes/dodge-burn.d.ts +4 -0
  158. package/dist/tools/recipes/dodge-burn.d.ts.map +1 -0
  159. package/dist/tools/recipes/dodge-burn.js +84 -0
  160. package/dist/tools/recipes/dodge-burn.js.map +1 -0
  161. package/dist/tools/recipes/enhance-portrait.d.ts +4 -0
  162. package/dist/tools/recipes/enhance-portrait.d.ts.map +1 -0
  163. package/dist/tools/recipes/enhance-portrait.js +110 -0
  164. package/dist/tools/recipes/enhance-portrait.js.map +1 -0
  165. package/dist/tools/recipes/export-social-variants.d.ts +4 -0
  166. package/dist/tools/recipes/export-social-variants.d.ts.map +1 -0
  167. package/dist/tools/recipes/export-social-variants.js +180 -0
  168. package/dist/tools/recipes/export-social-variants.js.map +1 -0
  169. package/dist/tools/recipes/frequency-separation.d.ts +4 -0
  170. package/dist/tools/recipes/frequency-separation.d.ts.map +1 -0
  171. package/dist/tools/recipes/frequency-separation.js +77 -0
  172. package/dist/tools/recipes/frequency-separation.js.map +1 -0
  173. package/dist/tools/recipes/gradient-fade.d.ts +4 -0
  174. package/dist/tools/recipes/gradient-fade.d.ts.map +1 -0
  175. package/dist/tools/recipes/gradient-fade.js +121 -0
  176. package/dist/tools/recipes/gradient-fade.js.map +1 -0
  177. package/dist/tools/recipes/index.d.ts +5 -0
  178. package/dist/tools/recipes/index.d.ts.map +1 -0
  179. package/dist/tools/recipes/index.js +43 -0
  180. package/dist/tools/recipes/index.js.map +1 -0
  181. package/dist/tools/recipes/organize-layers.d.ts +4 -0
  182. package/dist/tools/recipes/organize-layers.d.ts.map +1 -0
  183. package/dist/tools/recipes/organize-layers.js +156 -0
  184. package/dist/tools/recipes/organize-layers.js.map +1 -0
  185. package/dist/tools/recipes/prepare-for-web.d.ts +4 -0
  186. package/dist/tools/recipes/prepare-for-web.d.ts.map +1 -0
  187. package/dist/tools/recipes/prepare-for-web.js +125 -0
  188. package/dist/tools/recipes/prepare-for-web.js.map +1 -0
  189. package/dist/tools/recipes/remove-background.d.ts +4 -0
  190. package/dist/tools/recipes/remove-background.d.ts.map +1 -0
  191. package/dist/tools/recipes/remove-background.js +106 -0
  192. package/dist/tools/recipes/remove-background.js.map +1 -0
  193. package/dist/tools/recipes/remove-distraction.d.ts +4 -0
  194. package/dist/tools/recipes/remove-distraction.d.ts.map +1 -0
  195. package/dist/tools/recipes/remove-distraction.js +74 -0
  196. package/dist/tools/recipes/remove-distraction.js.map +1 -0
  197. package/dist/tools/recipes/sky-blend.d.ts +4 -0
  198. package/dist/tools/recipes/sky-blend.d.ts.map +1 -0
  199. package/dist/tools/recipes/sky-blend.js +135 -0
  200. package/dist/tools/recipes/sky-blend.js.map +1 -0
  201. package/dist/tools/selection-tools.d.ts.map +1 -1
  202. package/dist/tools/selection-tools.js +104 -2
  203. package/dist/tools/selection-tools.js.map +1 -1
  204. package/dist/tools/state-tools.d.ts +4 -0
  205. package/dist/tools/state-tools.d.ts.map +1 -0
  206. package/dist/tools/state-tools.js +133 -0
  207. package/dist/tools/state-tools.js.map +1 -0
  208. package/dist/tools/text-tools.d.ts.map +1 -1
  209. package/dist/tools/text-tools.js +60 -2
  210. package/dist/tools/text-tools.js.map +1 -1
  211. package/dist/ui/agent.d.ts +1 -0
  212. package/dist/ui/agent.d.ts.map +1 -1
  213. package/dist/ui/agent.js +15 -9
  214. package/dist/ui/agent.js.map +1 -1
  215. package/dist/ui/server.d.ts.map +1 -1
  216. package/dist/ui/server.js +1 -0
  217. package/dist/ui/server.js.map +1 -1
  218. package/dist/utils/extendscript-file.d.ts +4 -0
  219. package/dist/utils/extendscript-file.d.ts.map +1 -0
  220. package/dist/utils/extendscript-file.js +6 -0
  221. package/dist/utils/extendscript-file.js.map +1 -0
  222. package/dist/utils/extendscript-result.d.ts +7 -0
  223. package/dist/utils/extendscript-result.d.ts.map +1 -0
  224. package/dist/utils/extendscript-result.js +42 -0
  225. package/dist/utils/extendscript-result.js.map +1 -0
  226. package/dist/utils/js-string.d.ts +2 -0
  227. package/dist/utils/js-string.d.ts.map +1 -0
  228. package/dist/utils/js-string.js +8 -0
  229. package/dist/utils/js-string.js.map +1 -0
  230. package/package.json +8 -2
  231. package/web/dist/assets/index-4AnFityQ.css +1 -0
  232. package/web/dist/assets/index-CFTrtoOu.js +138 -0
  233. package/web/dist/index.html +2 -2
  234. package/web/dist/assets/index-Kxyfap9w.js +0 -138
  235. package/web/dist/assets/index-Th6OF4IB.css +0 -1
package/README.md CHANGED
@@ -1,4 +1,7 @@
1
1
  # Photoshop MCP Server
2
+
3
+ *v1.1+ — recipe workflows, fewer round-trips, snappier sessions.*
4
+
2
5
  > **Note:** This is an unofficial, community-maintained project and is not affiliated with or endorsed by Adobe Inc.
3
6
 
4
7
  [![npm version](https://img.shields.io/npm/v/@alisaitteke/photoshop-mcp.svg)](https://www.npmjs.com/package/@alisaitteke/photoshop-mcp)
@@ -14,6 +17,8 @@ Don't want to wire this into Claude Desktop or Cursor? The same package ships a
14
17
  fully local web UI that lets you chat with an AI model and drive Photoshop
15
18
  through this MCP server underneath.
16
19
 
20
+ ![Standalone UI Screenshot](./images/frame_generic_light.png)
21
+
17
22
  ```bash
18
23
  npx -p @alisaitteke/photoshop-mcp photoshop-mcp-ui
19
24
  ```
@@ -61,9 +66,140 @@ photoshop-mcp-ui [--port 5174] [--host 127.0.0.1] [--no-open]
61
66
 
62
67
  ---
63
68
 
69
+ ## AI/Prompt Layer for Photoshop
70
+
71
+ On top of atomic `photoshop_*` tools, the server ships an opinionated AI/prompt
72
+ layer that helps host LLMs (Cursor, Claude Desktop, etc.) translate vague user
73
+ requests into reliable Photoshop actions:
74
+
75
+ - **Server `instructions`** — workflow contract advertised on MCP `initialize`
76
+ (ping once, state-before-action, prefer recipes, error recovery). See
77
+ [`src/prompts/instructions.ts`](src/prompts/instructions.ts).
78
+ - **MCP `prompts` primitive** — 16 pre-engineered templates (12 recipe + 4 guide:
79
+ `ps.enhance_portrait`, `ps.remove_background`, `ps.gradient_fade`, `ps.sky_blend`, …)
80
+ via `prompts/list` and `prompts/get`.
81
+ - **Recipe tools** — 12 outcome-oriented `photoshop_recipe_*` tools (remove
82
+ background, enhance portrait, prepare for web, export social variants, color
83
+ grade, frequency separation, batch mockup, organize layers, gradient fade,
84
+ sky blend, dodge & burn, remove distraction). Each wraps steps in a single
85
+ Photoshop history state (one Undo reverts all). **80 tools total** (68 atomic
86
+ + 12 recipe).
87
+ - **State & preview** — `photoshop_get_state` (cheap snapshot),
88
+ `photoshop_get_preview` (base64 JPEG for vision verification),
89
+ `photoshop_get_capabilities` (version-aware feature flags).
90
+ - **Structured errors** — failures return JSON envelopes with `code` and
91
+ `suggested_next_tool` for self-correction.
92
+
93
+ Full reference: [`docs/prompt-layer.md`](docs/prompt-layer.md).
94
+
95
+ Verify parity: `npm run verify:photoshop-prompts`. Latest results:
96
+ [`docs/development.md#integration-test-results`](docs/development.md#integration-test-results).
97
+
64
98
  ## Example Prompts
65
99
 
66
- Below are example prompts you can use with AI assistants (Claude, Cursor, etc.) when this MCP server is configured:
100
+ Below are example prompts you can use with AI assistants (Claude, Cursor, etc.)
101
+ when this MCP server is configured. Prefer **recipe tools** (`photoshop_recipe_*`)
102
+ for multi-step outcomes — each recipe is a single undo step. Use atomic
103
+ `photoshop_*` tools only for fine-grained edits no recipe covers.
104
+
105
+ <details>
106
+ <summary>🧠 State-aware session (recommended first step)</summary>
107
+
108
+ ```
109
+ Ping Photoshop and read capabilities for my installed version.
110
+ Get the current document state before changing anything.
111
+ Open portrait.jpg, get a downscaled preview so you can verify the subject.
112
+ After each major recipe, get another preview to confirm the result.
113
+ ```
114
+
115
+ </details>
116
+
117
+ <details>
118
+ <summary>👤 Portrait retouch (recipe)</summary>
119
+
120
+ ```
121
+ Enhance the portrait on the active layer at medium intensity with skin smoothing.
122
+ Use the enhance-portrait recipe — I want frequency separation + auto-tone in one undoable step.
123
+ If the active layer is text or a Smart Object, rasterize first or pick a raster layer.
124
+ Show me a preview when done.
125
+ ```
126
+
127
+ Equivalent MCP prompt template: `ps.enhance_portrait` with `{ intensity: "medium", skin_smoothing: "true" }`.
128
+
129
+ </details>
130
+
131
+ <details>
132
+ <summary>✂️ Background removal (recipe)</summary>
133
+
134
+ ```
135
+ Remove the background from the active portrait layer.
136
+ Use Select Subject + a layer mask with a 2px feather. Keep the original pixels behind the mask.
137
+ The subject must be on the active layer — not a flat color fill.
138
+ ```
139
+
140
+ Equivalent MCP prompt template: `ps.remove_background` with `{ feather_px: "2", keep_shadow: "false" }`.
141
+
142
+ </details>
143
+
144
+ <details>
145
+ <summary>🎨 Color grade (recipe)</summary>
146
+
147
+ ```
148
+ Apply a warm film color grade to the open document as non-destructive adjustment layers.
149
+ Use the apply-color-grade recipe with preset warm_film.
150
+ Preview the result when finished.
151
+ ```
152
+
153
+ </details>
154
+
155
+ <details>
156
+ <summary>🔬 Frequency separation setup (recipe)</summary>
157
+
158
+ ```
159
+ Set up frequency separation on the active raster layer with a 6px blur radius.
160
+ I will paint on the Low and High layers myself — do not apply extra smoothing.
161
+ Tell me which layers to edit when the stack is ready.
162
+ ```
163
+
164
+ Equivalent MCP prompt template: `ps.frequency_separation` with `{ radius_px: "6" }`.
165
+
166
+ </details>
167
+
168
+ <details>
169
+ <summary>🌐 Prepare for web + social export (recipes)</summary>
170
+
171
+ ```
172
+ Prepare the active document for web: sRGB, downscale, sharpen, export one optimized JPEG to ~/.photoshop-mcp/exports.
173
+ Then export Instagram post and X post variants as separate JPEGs from the same document.
174
+ List the output paths in a table.
175
+ ```
176
+
177
+ Equivalent templates: `ps.prepare_for_web`, `ps.export_social_variants`.
178
+
179
+ </details>
180
+
181
+ <details>
182
+ <summary>📦 Batch mockup replace (recipe)</summary>
183
+
184
+ ```
185
+ I have a mockup PSD open with a Smart Object layer named "Screen".
186
+ Replace it with every PNG/JPG in ~/assets/mockups/ and export one JPEG per asset.
187
+ Do not place flat layers — swap the Smart Object so perspective is preserved.
188
+ ```
189
+
190
+ Equivalent MCP prompt template: `ps.batch_mockup_replace`.
191
+
192
+ </details>
193
+
194
+ <details>
195
+ <summary>🗂️ Organize layers (recipe)</summary>
196
+
197
+ ```
198
+ Organize the layer stack: rename by kind, auto-group related layers, preserve originals.
199
+ Run the organize-layers recipe, then list layers so I can review the new structure.
200
+ ```
201
+
202
+ </details>
67
203
 
68
204
  <details>
69
205
  <summary>🎨 Basic Design Creation</summary>
@@ -98,10 +234,9 @@ Save as adventure.jpg with quality 10.
98
234
 
99
235
  ```
100
236
  Open photo.jpg from my Desktop in Photoshop.
101
- Apply auto levels and auto contrast.
102
- Apply unsharp mask with amount 120%, radius 1.5, threshold 0.
103
- Increase saturation by 15.
104
- Crop to remove 100px from each edge.
237
+ Get state, then run the enhance-portrait recipe at low intensity.
238
+ If I only need quick tone fixes, apply auto levels, auto contrast, and unsharp mask (120%, 1.5, 0) on the active layer instead.
239
+ Adjust hue +15 and saturation +15, or use prepare-for-web when I'm ready to export.
105
240
  Save as enhanced-photo.jpg with quality 12.
106
241
  ```
107
242
 
@@ -239,28 +374,38 @@ Redo 1 step to bring back one operation.
239
374
  ```
240
375
 
241
376
  </details>
242
- ---
243
- > **🎨 50+ Tools** | **🖥️ Cross-Platform** | **📦 NPX Ready** | **🔧 ExtendScript API** | **⏮️ Undo/Redo**
377
+
378
+ <details>
379
+ <summary>🔁 Error recovery (structured envelopes)</summary>
380
+
381
+ ```
382
+ If a recipe returns version_unsupported or generative_unavailable, call get_capabilities and tell me which Photoshop feature is missing.
383
+ If a tool fails with suggested_next_tool, follow that hint (e.g. rasterize_layer before a raster-only recipe).
384
+ Never guess — read get_state after a failure and propose the next single step.
385
+ ```
386
+
387
+ </details>
244
388
 
245
389
  ## Features
246
390
 
247
- - ✅ **Works on both Windows and macOS**
248
- - ✅ **Supports Photoshop 2012-2025+**
249
- - ✅ **ExtendScript API**: Universal compatibility via AppleScript/COM automation
250
- - ✅ **Auto-Detection**: Automatically finds Photoshop installation on your system
251
- - ✅ **50+ Tools**: Comprehensive Photoshop automation
252
- - ✅ **Document Management**: Create, open, save, close, crop documents
253
- - ✅ **Layer Operations**: Create, delete, duplicate, merge, transform layers
254
- - ✅ **Layer Properties**: Opacity, blend modes, visibility, locking
255
- - ✅ **Text Formatting**: Font, size, color, alignment controls
256
- - ✅ **Image Placement**: Place images, open files, fit to document
257
- - ✅ **Filters**: Gaussian Blur, Sharpen, Noise, Motion Blur
258
- - ✅ **Color Adjustments**: Brightness/Contrast, Hue/Saturation, Auto Levels/Contrast
259
- - ✅ **Selections & Masks**: Rectangular selections, layer masks
260
- - ✅ **History Control**: Undo/Redo operations, view history states
261
- - ✅ **Actions**: Play recorded actions, execute custom scripts
262
- - ✅ **Auto-Rasterize**: Automatically converts layers when needed for filters
263
- - ✅ **Context Tracking**: Returns document/layer state after each operation for AI context awareness
391
+ - **Works on both Windows and macOS**
392
+ - **Supports Photoshop 2012-2025+**
393
+ - **ExtendScript API**: Universal compatibility via AppleScript/COM automation
394
+ - **Auto-Detection**: Automatically finds Photoshop installation on your system
395
+ - **78 Tools**: 66 atomic `photoshop_*` + 12 recipe `photoshop_recipe_*`
396
+ - **AI/Prompt Layer**: 16 MCP prompt templates (12 recipe + 4 guide), server instructions, state/preview/capabilities tools
397
+ - **Document Management**: Create, open, save, close, crop documents
398
+ - **Layer Operations**: Create, delete, duplicate, merge, transform layers
399
+ - **Layer Properties**: Opacity, blend modes, visibility, locking
400
+ - **Text Formatting**: Font, size, color, alignment controls
401
+ - **Image Placement**: Place images, open files, fit to document
402
+ - **Filters**: Gaussian Blur, Sharpen, Noise, Motion Blur
403
+ - **Color Adjustments**: Brightness/Contrast, Hue/Saturation, Curves, Auto Levels/Contrast
404
+ - **Selections & Masks**: Rectangular selections, select subject, content-aware fill, gradient mask, layer masks
405
+ - **History Control**: Undo/Redo operations, view history states
406
+ - **Actions**: Play recorded actions, execute custom scripts
407
+ - **Auto-Rasterize**: Automatically converts layers when needed for filters
408
+ - **Context Tracking**: Returns document/layer state after each operation for AI context awareness
264
409
 
265
410
  ## Installation
266
411
 
@@ -272,14 +417,7 @@ No installation required! Just configure your MCP client:
272
417
  npx @alisaitteke/photoshop-mcp
273
418
  ```
274
419
 
275
- ### From Source
276
-
277
- ```bash
278
- git clone https://github.com/alisaitteke/photoshop-mcp.git
279
- cd photoshop-mcp
280
- npm install
281
- npm run build
282
- ```
420
+ To hack on the repo locally, see [From Source](docs/development.md#from-source) in the development guide.
283
421
 
284
422
  ## Configuration
285
423
 
@@ -326,832 +464,9 @@ Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_
326
464
 
327
465
  ## Available Tools
328
466
 
329
- ### Connection & Info
330
-
331
- #### `photoshop_ping`
332
- Test connection to Photoshop.
333
-
334
- ```javascript
335
- // Example: Check if Photoshop is accessible
336
- photoshop_ping()
337
- ```
338
-
339
- #### `photoshop_get_version`
340
- Get Photoshop version information.
341
-
342
- ```javascript
343
- // Example: Get version details
344
- photoshop_get_version()
345
- ```
346
-
347
- ### Document Management
348
-
349
- #### `photoshop_create_document`
350
- Create a new Photoshop document.
351
-
352
- **Parameters:**
353
- - `width` (number, required): Document width in pixels
354
- - `height` (number, required): Document height in pixels
355
- - `resolution` (number, optional): DPI resolution (default: 72)
356
- - `colorMode` (string, optional): Color mode - RGB, CMYK, or Grayscale (default: RGB)
357
-
358
- ```javascript
359
- // Example: Create a 1920x1080 RGB document
360
- photoshop_create_document({
361
- width: 1920,
362
- height: 1080,
363
- resolution: 72,
364
- colorMode: "RGB"
365
- })
366
- ```
367
-
368
- #### `photoshop_get_document_info`
369
- Get information about the active document.
370
-
371
- ```javascript
372
- // Example: Get current document details
373
- photoshop_get_document_info()
374
- ```
375
-
376
- #### `photoshop_save_document`
377
- Save the active document.
378
-
379
- **Parameters:**
380
- - `path` (string, required): Full path where to save
381
- - `format` (string, optional): PSD, JPEG, or PNG (default: PSD)
382
- - `quality` (number, optional): JPEG quality 1-12 (default: 8)
383
-
384
- ```javascript
385
- // Example: Save as JPEG
386
- photoshop_save_document({
387
- path: "/Users/username/Desktop/output.jpg",
388
- format: "JPEG",
389
- quality: 10
390
- })
391
- ```
392
-
393
- #### `photoshop_close_document`
394
- Close the active document.
395
-
396
- **Parameters:**
397
- - `save` (boolean, optional): Save before closing (default: false)
398
-
399
- ```javascript
400
- // Example: Close without saving
401
- photoshop_close_document({ save: false })
402
- ```
403
-
404
- ### Layer Operations
405
-
406
- #### `photoshop_create_layer`
407
- Create a new layer.
408
-
409
- **Parameters:**
410
- - `name` (string, optional): Layer name
411
-
412
- ```javascript
413
- // Example: Create a named layer
414
- photoshop_create_layer({ name: "Background" })
415
- ```
416
-
417
- #### `photoshop_delete_layer`
418
- Delete the active layer.
419
-
420
- ```javascript
421
- // Example: Delete current layer
422
- photoshop_delete_layer()
423
- ```
424
-
425
- #### `photoshop_create_text_layer`
426
- Create a text layer.
427
-
428
- **Parameters:**
429
- - `text` (string, required): Text content
430
- - `x` (number, optional): X position in pixels (default: 100)
431
- - `y` (number, optional): Y position in pixels (default: 100)
432
- - `fontSize` (number, optional): Font size in points (default: 24)
433
-
434
- ```javascript
435
- // Example: Create a text layer
436
- photoshop_create_text_layer({
437
- text: "Hello World",
438
- x: 200,
439
- y: 150,
440
- fontSize: 48
441
- })
442
- ```
443
-
444
- #### `photoshop_fill_layer`
445
- Fill the active layer with a solid color.
446
-
447
- **Parameters:**
448
- - `red` (number, required): Red component (0-255)
449
- - `green` (number, required): Green component (0-255)
450
- - `blue` (number, required): Blue component (0-255)
451
-
452
- ```javascript
453
- // Example: Fill with blue
454
- photoshop_fill_layer({
455
- red: 0,
456
- green: 100,
457
- blue: 255
458
- })
459
- ```
460
-
461
- #### `photoshop_get_layers`
462
- Get list of all layers in the active document.
463
-
464
- ```javascript
465
- // Example: List all layers
466
- photoshop_get_layers()
467
- ```
468
-
469
- #### `photoshop_set_layer_opacity`
470
- Set the opacity of the active layer.
471
-
472
- **Parameters:**
473
- - `opacity` (number, required): Opacity value (0-100)
474
-
475
- ```javascript
476
- // Example: Set opacity to 75%
477
- photoshop_set_layer_opacity({ opacity: 75 })
478
- ```
479
-
480
- #### `photoshop_set_layer_blend_mode`
481
- Set the blend mode of the active layer.
482
-
483
- **Parameters:**
484
- - `blendMode` (string, required): Blend mode (NORMAL, MULTIPLY, SCREEN, OVERLAY, etc.)
485
-
486
- ```javascript
487
- // Example: Set blend mode to multiply
488
- photoshop_set_layer_blend_mode({ blendMode: "MULTIPLY" })
489
- ```
490
-
491
- Available blend modes: NORMAL, DISSOLVE, DARKEN, MULTIPLY, COLORBURN, LINEARBURN, DARKERCOLOR, LIGHTEN, SCREEN, COLORDODGE, LINEARDODGE, LIGHTERCOLOR, OVERLAY, SOFTLIGHT, HARDLIGHT, VIVIDLIGHT, LINEARLIGHT, PINLIGHT, HARDMIX, DIFFERENCE, EXCLUSION, SUBTRACT, DIVIDE, HUE, SATURATION, COLOR, LUMINOSITY
492
-
493
- #### `photoshop_set_layer_visibility`
494
- Show or hide the active layer.
495
-
496
- **Parameters:**
497
- - `visible` (boolean, required): Visibility state
498
-
499
- ```javascript
500
- // Example: Hide layer
501
- photoshop_set_layer_visibility({ visible: false })
502
- ```
503
-
504
- #### `photoshop_set_layer_locked`
505
- Lock or unlock the active layer.
506
-
507
- **Parameters:**
508
- - `locked` (boolean, required): Lock state
509
-
510
- ```javascript
511
- // Example: Lock layer
512
- photoshop_set_layer_locked({ locked: true })
513
- ```
514
-
515
- #### `photoshop_rename_layer`
516
- Rename the active layer.
517
-
518
- **Parameters:**
519
- - `name` (string, required): New layer name
520
-
521
- ```javascript
522
- // Example: Rename layer
523
- photoshop_rename_layer({ name: "Hero Image" })
524
- ```
525
-
526
- #### `photoshop_duplicate_layer`
527
- Duplicate the active layer.
528
-
529
- **Parameters:**
530
- - `newName` (string, optional): Name for duplicated layer
531
-
532
- ```javascript
533
- // Example: Duplicate layer with new name
534
- photoshop_duplicate_layer({ newName: "Background Copy" })
535
- ```
536
-
537
- #### `photoshop_merge_visible_layers`
538
- Merge all visible layers into one.
539
-
540
- ```javascript
541
- // Example: Merge visible layers
542
- photoshop_merge_visible_layers()
543
- ```
544
-
545
- #### `photoshop_flatten_image`
546
- Flatten all layers into a single background layer.
547
-
548
- ```javascript
549
- // Example: Flatten image
550
- photoshop_flatten_image()
551
- ```
552
-
553
- #### `photoshop_rasterize_layer`
554
- Rasterize the active layer (convert text/smart object to normal layer).
555
-
556
- ```javascript
557
- // Example: Rasterize layer
558
- photoshop_rasterize_layer()
559
- ```
560
-
561
- ### Layer Ordering
562
-
563
- #### `photoshop_move_layer_to_position`
564
- Move the active layer relative to another layer.
565
-
566
- **Parameters:**
567
- - `targetLayerName` (string, required): Name of the reference layer
568
- - `position` (string, required): ABOVE, BELOW, TOP, or BOTTOM
569
-
570
- ```javascript
571
- // Example: Move layer above "Background"
572
- photoshop_move_layer_to_position({
573
- targetLayerName: "Background",
574
- position: "ABOVE"
575
- })
576
- ```
577
-
578
- #### `photoshop_move_layer_to_top`
579
- Move the active layer to the top of the layer stack.
580
-
581
- ```javascript
582
- // Example: Move to top
583
- photoshop_move_layer_to_top()
584
- ```
585
-
586
- #### `photoshop_move_layer_to_bottom`
587
- Move the active layer to the bottom of the layer stack.
588
-
589
- ```javascript
590
- // Example: Move to bottom
591
- photoshop_move_layer_to_bottom()
592
- ```
593
-
594
- #### `photoshop_move_layer_up`
595
- Move the active layer up one position.
596
-
597
- ```javascript
598
- // Example: Move up
599
- photoshop_move_layer_up()
600
- ```
601
-
602
- #### `photoshop_move_layer_down`
603
- Move the active layer down one position.
604
-
605
- ```javascript
606
- // Example: Move down
607
- photoshop_move_layer_down()
608
- ```
609
-
610
- ### Layer Transformations
611
-
612
- #### `photoshop_fit_layer_to_document`
613
- Scale the active layer to fit the document canvas while maintaining aspect ratio.
614
-
615
- **Parameters:**
616
- - `fillDocument` (boolean, optional): If true, fills entire canvas (may crop). If false, fits within canvas (may have margins). Default: false
617
-
618
- ```javascript
619
- // Example: Fit layer within canvas
620
- photoshop_fit_layer_to_document({ fillDocument: false })
621
-
622
- // Example: Fill entire canvas (cropping if needed)
623
- photoshop_fit_layer_to_document({ fillDocument: true })
624
- ```
625
-
626
- #### `photoshop_scale_layer`
627
- Scale the active layer by a percentage.
628
-
629
- **Parameters:**
630
- - `scalePercent` (number, required): Scale percentage (e.g., 50 for 50%, 200 for 200%)
631
- - `centerAnchor` (boolean, optional): Scale from center (true) or top-left (false). Default: true
632
-
633
- ```javascript
634
- // Example: Scale to 150%
635
- photoshop_scale_layer({
636
- scalePercent: 150,
637
- centerAnchor: true
638
- })
639
- ```
640
-
641
- #### `photoshop_move_layer`
642
- Move the active layer by specified offset.
643
-
644
- **Parameters:**
645
- - `deltaX` (number, required): Horizontal offset in pixels
646
- - `deltaY` (number, required): Vertical offset in pixels
647
-
648
- ```javascript
649
- // Example: Move layer 100px right and 50px down
650
- photoshop_move_layer({
651
- deltaX: 100,
652
- deltaY: 50
653
- })
654
- ```
655
-
656
- #### `photoshop_rotate_layer`
657
- Rotate the active layer.
658
-
659
- **Parameters:**
660
- - `degrees` (number, required): Rotation angle in degrees (positive = clockwise)
661
-
662
- ```javascript
663
- // Example: Rotate 45 degrees clockwise
664
- photoshop_rotate_layer({ degrees: 45 })
665
- ```
666
-
667
- ### Filters
668
-
669
- #### `photoshop_apply_gaussian_blur`
670
- Apply Gaussian Blur filter to the active layer.
671
-
672
- **Parameters:**
673
- - `radius` (number, required): Blur radius in pixels (0.1-250)
674
-
675
- ```javascript
676
- // Example: Apply 10px blur
677
- photoshop_apply_gaussian_blur({ radius: 10 })
678
- ```
679
-
680
- #### `photoshop_apply_sharpen`
681
- Apply Unsharp Mask (sharpen) filter.
682
-
683
- **Parameters:**
684
- - `amount` (number, required): Sharpening amount in percent (1-500)
685
- - `radius` (number, required): Radius in pixels (0.1-250)
686
- - `threshold` (number, optional): Threshold levels (0-255, default: 0)
687
-
688
- ```javascript
689
- // Example: Sharpen image
690
- photoshop_apply_sharpen({
691
- amount: 100,
692
- radius: 1.5,
693
- threshold: 0
694
- })
695
- ```
696
-
697
- #### `photoshop_apply_noise`
698
- Apply Add Noise filter.
699
-
700
- **Parameters:**
701
- - `amount` (number, required): Noise amount in percent (0.1-400)
702
- - `distribution` (string, optional): UNIFORM or GAUSSIAN (default: UNIFORM)
703
- - `monochromatic` (boolean, optional): Monochromatic noise (default: false)
704
-
705
- ```javascript
706
- // Example: Add noise
707
- photoshop_apply_noise({
708
- amount: 10,
709
- distribution: "GAUSSIAN",
710
- monochromatic: false
711
- })
712
- ```
713
-
714
- #### `photoshop_apply_motion_blur`
715
- Apply Motion Blur filter.
716
-
717
- **Parameters:**
718
- - `angle` (number, required): Blur angle in degrees (-360 to 360)
719
- - `radius` (number, required): Blur distance in pixels (1-999)
720
-
721
- ```javascript
722
- // Example: Apply motion blur
723
- photoshop_apply_motion_blur({
724
- angle: 45,
725
- radius: 20
726
- })
727
- ```
728
-
729
- ### Color Adjustments
730
-
731
- #### `photoshop_adjust_brightness_contrast`
732
- Adjust brightness and contrast.
733
-
734
- **Parameters:**
735
- - `brightness` (number, required): Brightness adjustment (-100 to 100)
736
- - `contrast` (number, required): Contrast adjustment (-100 to 100)
737
-
738
- ```javascript
739
- // Example: Increase brightness and contrast
740
- photoshop_adjust_brightness_contrast({
741
- brightness: 20,
742
- contrast: 15
743
- })
744
- ```
745
-
746
- #### `photoshop_adjust_hue_saturation`
747
- Adjust hue, saturation, and lightness.
748
-
749
- **Parameters:**
750
- - `hue` (number, required): Hue shift (-180 to 180)
751
- - `saturation` (number, required): Saturation adjustment (-100 to 100)
752
- - `lightness` (number, required): Lightness adjustment (-100 to 100)
753
-
754
- ```javascript
755
- // Example: Adjust colors
756
- photoshop_adjust_hue_saturation({
757
- hue: 30,
758
- saturation: 20,
759
- lightness: 0
760
- })
761
- ```
762
-
763
- #### `photoshop_auto_levels`
764
- Apply auto levels adjustment.
765
-
766
- ```javascript
767
- // Example: Auto levels
768
- photoshop_auto_levels()
769
- ```
770
-
771
- #### `photoshop_auto_contrast`
772
- Apply auto contrast adjustment.
773
-
774
- ```javascript
775
- // Example: Auto contrast
776
- photoshop_auto_contrast()
777
- ```
778
-
779
- #### `photoshop_desaturate`
780
- Desaturate the layer (convert to grayscale).
781
-
782
- ```javascript
783
- // Example: Desaturate
784
- photoshop_desaturate()
785
- ```
786
-
787
- #### `photoshop_invert`
788
- Invert colors of the layer.
789
-
790
- ```javascript
791
- // Example: Invert colors
792
- photoshop_invert()
793
- ```
794
-
795
- ### Text Formatting
796
-
797
- #### `photoshop_set_text_font`
798
- Set font family and size for active text layer.
799
-
800
- **Parameters:**
801
- - `fontName` (string, required): Font family name
802
- - `fontSize` (number, optional): Font size in points
803
-
804
- ```javascript
805
- // Example: Change font
806
- photoshop_set_text_font({
807
- fontName: "Helvetica",
808
- fontSize: 48
809
- })
810
- ```
811
-
812
- #### `photoshop_set_text_color`
813
- Set color for active text layer.
814
-
815
- **Parameters:**
816
- - `red` (number, required): Red component (0-255)
817
- - `green` (number, required): Green component (0-255)
818
- - `blue` (number, required): Blue component (0-255)
819
-
820
- ```javascript
821
- // Example: Set text to blue
822
- photoshop_set_text_color({
823
- red: 0,
824
- green: 100,
825
- blue: 255
826
- })
827
- ```
828
-
829
- #### `photoshop_set_text_alignment`
830
- Set text alignment.
831
-
832
- **Parameters:**
833
- - `alignment` (string, required): LEFT, CENTER, RIGHT, LEFTJUSTIFIED, CENTERJUSTIFIED, RIGHTJUSTIFIED, FULLYJUSTIFIED
834
-
835
- ```javascript
836
- // Example: Center align text
837
- photoshop_set_text_alignment({ alignment: "CENTER" })
838
- ```
839
-
840
- #### `photoshop_update_text_content`
841
- Update text content of active text layer.
842
-
843
- **Parameters:**
844
- - `text` (string, required): New text content
845
-
846
- ```javascript
847
- // Example: Update text
848
- photoshop_update_text_content({ text: "New Text" })
849
- ```
850
-
851
- ### Selections & Masks
852
-
853
- #### `photoshop_select_rectangle`
854
- Create a rectangular selection.
855
-
856
- **Parameters:**
857
- - `left`, `top`, `right`, `bottom` (number, required): Selection bounds in pixels
858
-
859
- ```javascript
860
- // Example: Select area
861
- photoshop_select_rectangle({
862
- left: 100,
863
- top: 100,
864
- right: 500,
865
- bottom: 400
866
- })
867
- ```
868
-
869
- #### `photoshop_select_all`
870
- Select the entire document.
871
-
872
- ```javascript
873
- // Example: Select all
874
- photoshop_select_all()
875
- ```
876
-
877
- #### `photoshop_deselect`
878
- Clear all selections.
879
-
880
- ```javascript
881
- // Example: Deselect
882
- photoshop_deselect()
883
- ```
884
-
885
- #### `photoshop_invert_selection`
886
- Invert the current selection.
887
-
888
- ```javascript
889
- // Example: Invert selection
890
- photoshop_invert_selection()
891
- ```
892
-
893
- #### `photoshop_create_layer_mask`
894
- Create a layer mask from the current selection.
895
-
896
- ```javascript
897
- // Example: Create mask
898
- photoshop_create_layer_mask()
899
- ```
900
-
901
- #### `photoshop_delete_layer_mask`
902
- Delete the layer mask from active layer.
903
-
904
- ```javascript
905
- // Example: Delete mask
906
- photoshop_delete_layer_mask()
907
- ```
908
-
909
- #### `photoshop_apply_layer_mask`
910
- Apply (merge) the layer mask to the layer.
911
-
912
- ```javascript
913
- // Example: Apply mask
914
- photoshop_apply_layer_mask()
915
- ```
916
-
917
- ### History & Undo/Redo
918
-
919
- #### `photoshop_undo`
920
- Undo the last operation(s) - equivalent to Ctrl/Cmd+Z.
921
-
922
- **Parameters:**
923
- - `steps` (number, optional): Number of steps to undo (default: 1)
924
-
925
- ```javascript
926
- // Example: Undo last operation
927
- photoshop_undo()
928
-
929
- // Example: Undo last 3 operations
930
- photoshop_undo({ steps: 3 })
931
- ```
932
-
933
- #### `photoshop_redo`
934
- Redo previously undone operation(s) - equivalent to Ctrl/Cmd+Shift+Z.
935
-
936
- **Parameters:**
937
- - `steps` (number, optional): Number of steps to redo (default: 1)
938
-
939
- ```javascript
940
- // Example: Redo last undone operation
941
- photoshop_redo()
942
-
943
- // Example: Redo last 2 undone operations
944
- photoshop_redo({ steps: 2 })
945
- ```
946
-
947
- #### `photoshop_get_history`
948
- Get the history states of the active document.
949
-
950
- ```javascript
951
- // Example: View history
952
- photoshop_get_history()
953
- ```
954
-
955
- ### Actions & Automation
956
-
957
- #### `photoshop_play_action`
958
- Play a recorded action from the Actions palette.
959
-
960
- **Parameters:**
961
- - `actionName` (string, required): Action name
962
- - `actionSetName` (string, required): Action set name
963
-
964
- ```javascript
965
- // Example: Play action
966
- photoshop_play_action({
967
- actionName: "My Action",
968
- actionSetName: "Default Actions"
969
- })
970
- ```
971
-
972
- #### `photoshop_execute_script`
973
- Execute custom ExtendScript code (advanced).
974
-
975
- **Parameters:**
976
- - `code` (string, required): ExtendScript code
977
-
978
- ```javascript
979
- // Example: Execute custom code
980
- photoshop_execute_script({
981
- code: "app.beep();"
982
- })
983
- ```
984
-
985
- ### Image Manipulation
986
-
987
- #### `photoshop_resize_image`
988
- Resize the active image.
989
-
990
- **Parameters:**
991
- - `width` (number, required): New width in pixels
992
- - `height` (number, required): New height in pixels
993
-
994
- ```javascript
995
- // Example: Resize to Instagram post size
996
- photoshop_resize_image({
997
- width: 1080,
998
- height: 1080
999
- })
1000
- ```
1001
-
1002
- #### `photoshop_crop_document`
1003
- Crop the document to specified bounds.
1004
-
1005
- **Parameters:**
1006
- - `left` (number, required): Left edge in pixels
1007
- - `top` (number, required): Top edge in pixels
1008
- - `right` (number, required): Right edge in pixels
1009
- - `bottom` (number, required): Bottom edge in pixels
1010
-
1011
- ```javascript
1012
- // Example: Crop document
1013
- photoshop_crop_document({
1014
- left: 100,
1015
- top: 100,
1016
- right: 1820,
1017
- bottom: 980
1018
- })
1019
- ```
1020
-
1021
- #### `photoshop_place_image`
1022
- Place an image file as a layer in the active document.
1023
-
1024
- **Parameters:**
1025
- - `filePath` (string, required): Full path to the image file
1026
- - `x` (number, optional): X position offset in pixels (default: 0)
1027
- - `y` (number, optional): Y position offset in pixels (default: 0)
1028
-
1029
- ```javascript
1030
- // Example: Place an image at specific position
1031
- photoshop_place_image({
1032
- filePath: "/Users/username/Pictures/photo.jpg",
1033
- x: 100,
1034
- y: 200
1035
- })
1036
- ```
1037
-
1038
- #### `photoshop_open_image`
1039
- Open an image file as a new document.
1040
-
1041
- **Parameters:**
1042
- - `filePath` (string, required): Full path to the image file
1043
-
1044
- ```javascript
1045
- // Example: Open an image
1046
- photoshop_open_image({
1047
- filePath: "/Users/username/Pictures/photo.jpg"
1048
- })
1049
- ```
1050
-
467
+ Full reference for all atomic `photoshop_*` tools (parameters, examples, and usage):
468
+ [`docs/available-tools.md`](docs/available-tools.md).
1051
469
 
1052
- ---
1053
-
1054
- ## Usage Examples
1055
-
1056
- ### Create a Simple Design
1057
-
1058
- ```javascript
1059
- // 1. Create a new document
1060
- photoshop_create_document({
1061
- width: 800,
1062
- height: 600,
1063
- colorMode: "RGB"
1064
- })
1065
-
1066
- // 2. Create a background layer
1067
- photoshop_create_layer({ name: "Background" })
1068
-
1069
- // 3. Fill it with a color
1070
- photoshop_fill_layer({
1071
- red: 240,
1072
- green: 240,
1073
- blue: 255
1074
- })
1075
-
1076
- // 4. Add a text layer
1077
- photoshop_create_text_layer({
1078
- text: "My Design",
1079
- x: 400,
1080
- y: 300,
1081
- fontSize: 64
1082
- })
1083
-
1084
- // 5. Save the result
1085
- photoshop_save_document({
1086
- path: "/Users/username/Desktop/design.psd",
1087
- format: "PSD"
1088
- })
1089
- ```
1090
-
1091
- ### Batch Process Images
1092
-
1093
- ```javascript
1094
- // 1. Open existing document (manual step)
1095
- // 2. Resize image
1096
- photoshop_resize_image({ width: 1920, height: 1080 })
1097
-
1098
- // 3. Save as JPEG
1099
- photoshop_save_document({
1100
- path: "/Users/username/Desktop/resized.jpg",
1101
- format: "JPEG",
1102
- quality: 12
1103
- })
1104
-
1105
- // 4. Close document
1106
- photoshop_close_document({ save: false })
1107
- ```
1108
-
1109
- ### Create Design with Stock Images (using Pexels MCP)
1110
-
1111
- This example shows how to combine Photoshop MCP with Pexels MCP:
1112
-
1113
- ```javascript
1114
- // 1. Search for images on Pexels (using Pexels MCP server)
1115
- // Note: You need to have Pexels MCP server configured
1116
- pexels_photos_search({
1117
- query: "nature landscape",
1118
- per_page: 5
1119
- })
1120
-
1121
- // 2. Download the image you want (manually or via script)
1122
- // 3. Create a new Photoshop document
1123
- photoshop_create_document({
1124
- width: 1920,
1125
- height: 1080,
1126
- colorMode: "RGB"
1127
- })
1128
-
1129
- // 4. Place the downloaded image
1130
- photoshop_place_image({
1131
- filePath: "/Users/username/Downloads/pexels-photo.jpg",
1132
- x: 0,
1133
- y: 0
1134
- })
1135
-
1136
- // 5. Fit the image to document (NEW!)
1137
- photoshop_fit_layer_to_document({
1138
- fillDocument: true // Fill entire canvas
1139
- })
1140
-
1141
- // 6. Add text overlay
1142
- photoshop_create_text_layer({
1143
- text: "Beautiful Nature",
1144
- x: 960,
1145
- y: 100,
1146
- fontSize: 72
1147
- })
1148
-
1149
- // 7. Save the final design
1150
- photoshop_save_document({
1151
- path: "/Users/username/Desktop/nature-design.psd",
1152
- format: "PSD"
1153
- })
1154
- ```
1155
470
 
1156
471
  ## Context Tracking
1157
472
 
@@ -1225,123 +540,22 @@ This context helps AI assistants remember what document and layer they're workin
1225
540
 
1226
541
  ## Troubleshooting
1227
542
 
1228
- ### "Photoshop not found"
1229
-
1230
- 1. Make sure Photoshop is installed in the default location
1231
- 2. Or set `PHOTOSHOP_PATH` environment variable to custom installation path
1232
-
1233
- ```json
1234
- {
1235
- "env": {
1236
- "PHOTOSHOP_PATH": "C:\\Custom\\Path\\Adobe Photoshop 2025\\Photoshop.exe"
1237
- }
1238
- }
1239
- ```
1240
-
1241
- ### "Failed to connect to Photoshop"
1242
-
1243
- 1. Ensure Photoshop is running (the server will try to launch it if not)
1244
- 2. Check that scripting is enabled in Photoshop preferences
1245
- 3. On Windows, verify COM automation is not blocked by security settings
1246
-
1247
- ### "Script execution timeout"
1248
-
1249
- - Some operations may take longer on large documents
1250
- - The default timeout is 30 seconds
1251
- - For complex operations, consider breaking them into smaller steps
1252
-
1253
- ### Debug Logging
1254
-
1255
- Enable detailed logging by setting `LOG_LEVEL=0`:
1256
-
1257
- ```json
1258
- {
1259
- "env": {
1260
- "LOG_LEVEL": "0"
1261
- }
1262
- }
1263
- ```
543
+ Common connection, scripting, and logging issues:
544
+ [`docs/troubleshooting.md`](docs/troubleshooting.md).
1264
545
 
1265
546
  ## Development
1266
547
 
1267
- ### Build
1268
-
1269
- ```bash
1270
- npm run build
1271
- ```
1272
-
1273
- ### Watch Mode
1274
-
1275
- ```bash
1276
- npm run dev
1277
- ```
1278
-
1279
- ### Lint & Format
1280
-
1281
- ```bash
1282
- npm run lint
1283
- npm run format
1284
- ```
1285
-
1286
- ## Quick Start Examples
1287
-
1288
- ### 💡 Common Use Cases
1289
-
1290
- | Task | Prompt Example |
1291
- |------|----------------|
1292
- | **Basic Design** | "Create 1920x1080 document, add blue background, center text 'Hello'" |
1293
- | **Photo Edit** | "Open photo.jpg, apply auto levels, sharpen 100%, save as edited.jpg" |
1294
- | **Stock Image** | "Place image.jpg, fit to fill canvas, add overlay text 'Summer 2026'" |
1295
- | **Layer Effects** | "Set active layer blend mode to MULTIPLY, opacity 80%" |
1296
- | **Filters** | "Apply 10px Gaussian blur to current layer" |
1297
- | **Text Styling** | "Change text to Helvetica 64pt, color red, center aligned" |
1298
- | **Batch Work** | "Resize to 1080x1080, auto contrast, save as square.jpg, close" |
1299
- | **Masks** | "Select rectangle 100,100 to 500,500, create layer mask" |
1300
-
1301
- ---
548
+ From-source setup, build, lint, integration tests (with latest results), and usage examples:
549
+ [`docs/development.md`](docs/development.md).
1302
550
 
1303
551
  ## Architecture
1304
552
 
1305
- ```
1306
- photoshop-mcp/
1307
- ├── src/
1308
- │ ├── core/ # MCP server core
1309
- │ │ ├── server.ts # Main MCP server
1310
- │ │ ├── session.ts # Session management
1311
- │ │ └── tool-registry.ts # Tool registration system
1312
- │ ├── platform/ # Platform-specific detection & execution
1313
- │ │ ├── detector.ts # Main detector
1314
- │ │ ├── connection.ts # Connection manager
1315
- │ │ ├── windows-detector.ts # Windows registry detection
1316
- │ │ ├── windows-executor.ts # Windows COM automation
1317
- │ │ ├── macos-detector.ts # macOS Spotlight detection
1318
- │ │ └── macos-executor.ts # macOS AppleScript execution
1319
- │ ├── api/ # Photoshop API abstractions
1320
- │ │ ├── photoshop-api.ts # API factory
1321
- │ │ ├── batch-play.ts # UXP batchPlay helpers (legacy)
1322
- │ │ └── extendscript.ts # ExtendScript snippets library
1323
- │ ├── tools/ # MCP tool implementations (42+ tools)
1324
- │ │ ├── document-tools.ts # Document operations
1325
- │ │ ├── layer-tools.ts # Layer creation/deletion
1326
- │ │ ├── layer-properties-tools.ts # Opacity, blend modes, etc.
1327
- │ │ ├── layer-transform-tools.ts # Scale, rotate, move
1328
- │ │ ├── image-tools.ts # Resize, crop
1329
- │ │ ├── image-placement-tools.ts # Place/open images
1330
- │ │ ├── filter-tools.ts # Blur, sharpen, noise
1331
- │ │ ├── adjustment-tools.ts # Color adjustments
1332
- │ │ ├── text-tools.ts # Text formatting
1333
- │ │ ├── selection-tools.ts # Selections & masks
1334
- │ │ └── action-tools.ts # Actions & custom scripts
1335
- │ └── utils/ # Utilities
1336
- │ └── logger.ts # Logging system (stderr-based)
1337
- └── examples/ # Configuration examples
1338
- ├── cursor-config.json
1339
- └── claude-desktop-config.json
1340
- ```
553
+ Repository layout and module map:
554
+ [`docs/architecture.md`](docs/architecture.md).
1341
555
 
1342
556
  ## Contributing
1343
557
 
1344
- Contributions are welcome! Please feel free to submit a Pull Request.
558
+ Contributions are welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md) before opening a PR.
1345
559
 
1346
560
  ## License
1347
561