@alisaitteke/photoshop-mcp 1.1.2 → 1.2.0
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.
- package/README.md +244 -981
- package/dist/api/extendscript.d.ts +41 -3
- package/dist/api/extendscript.d.ts.map +1 -1
- package/dist/api/extendscript.js +705 -130
- package/dist/api/extendscript.js.map +1 -1
- package/dist/api/photoshop-api.js +25 -0
- package/dist/api/photoshop-api.js.map +1 -1
- package/dist/core/prompt-registry.d.ts +17 -0
- package/dist/core/prompt-registry.d.ts.map +1 -0
- package/dist/core/prompt-registry.js +34 -0
- package/dist/core/prompt-registry.js.map +1 -0
- package/dist/core/server.d.ts +3 -0
- package/dist/core/server.d.ts.map +1 -1
- package/dist/core/server.js +71 -97
- package/dist/core/server.js.map +1 -1
- package/dist/errors/envelope.d.ts +16 -0
- package/dist/errors/envelope.d.ts.map +1 -0
- package/dist/errors/envelope.js +76 -0
- package/dist/errors/envelope.js.map +1 -0
- package/dist/lib/export-paths.d.ts +12 -0
- package/dist/lib/export-paths.d.ts.map +1 -0
- package/dist/lib/export-paths.js +67 -0
- package/dist/lib/export-paths.js.map +1 -0
- package/dist/platform/capabilities.d.ts +19 -0
- package/dist/platform/capabilities.d.ts.map +1 -0
- package/dist/platform/capabilities.js +43 -0
- package/dist/platform/capabilities.js.map +1 -0
- package/dist/platform/detector.d.ts +2 -0
- package/dist/platform/detector.d.ts.map +1 -1
- package/dist/platform/detector.js +14 -0
- package/dist/platform/detector.js.map +1 -1
- package/dist/platform/macos-executor.d.ts.map +1 -1
- package/dist/platform/macos-executor.js +5 -8
- package/dist/platform/macos-executor.js.map +1 -1
- package/dist/platform/windows-executor.d.ts.map +1 -1
- package/dist/platform/windows-executor.js +5 -10
- package/dist/platform/windows-executor.js.map +1 -1
- package/dist/prompts/_shared.d.ts +23 -0
- package/dist/prompts/_shared.d.ts.map +1 -0
- package/dist/prompts/_shared.js +58 -0
- package/dist/prompts/_shared.js.map +1 -0
- package/dist/prompts/instructions.d.ts +7 -0
- package/dist/prompts/instructions.d.ts.map +1 -0
- package/dist/prompts/instructions.js +134 -0
- package/dist/prompts/instructions.js.map +1 -0
- package/dist/prompts/registry.d.ts +5 -0
- package/dist/prompts/registry.d.ts.map +1 -0
- package/dist/prompts/registry.js +47 -0
- package/dist/prompts/registry.js.map +1 -0
- package/dist/prompts/templates/apply-color-grade.d.ts +3 -0
- package/dist/prompts/templates/apply-color-grade.d.ts.map +1 -0
- package/dist/prompts/templates/apply-color-grade.js +46 -0
- package/dist/prompts/templates/apply-color-grade.js.map +1 -0
- package/dist/prompts/templates/batch-mockup-replace.d.ts +3 -0
- package/dist/prompts/templates/batch-mockup-replace.d.ts.map +1 -0
- package/dist/prompts/templates/batch-mockup-replace.js +35 -0
- package/dist/prompts/templates/batch-mockup-replace.js.map +1 -0
- package/dist/prompts/templates/color-correct.d.ts +3 -0
- package/dist/prompts/templates/color-correct.d.ts.map +1 -0
- package/dist/prompts/templates/color-correct.js +36 -0
- package/dist/prompts/templates/color-correct.js.map +1 -0
- package/dist/prompts/templates/composite-blend.d.ts +3 -0
- package/dist/prompts/templates/composite-blend.d.ts.map +1 -0
- package/dist/prompts/templates/composite-blend.js +60 -0
- package/dist/prompts/templates/composite-blend.js.map +1 -0
- package/dist/prompts/templates/dodge-burn-guide.d.ts +3 -0
- package/dist/prompts/templates/dodge-burn-guide.d.ts.map +1 -0
- package/dist/prompts/templates/dodge-burn-guide.js +38 -0
- package/dist/prompts/templates/dodge-burn-guide.js.map +1 -0
- package/dist/prompts/templates/dodge-burn.d.ts +3 -0
- package/dist/prompts/templates/dodge-burn.d.ts.map +1 -0
- package/dist/prompts/templates/dodge-burn.js +31 -0
- package/dist/prompts/templates/dodge-burn.js.map +1 -0
- package/dist/prompts/templates/enhance-portrait.d.ts +3 -0
- package/dist/prompts/templates/enhance-portrait.d.ts.map +1 -0
- package/dist/prompts/templates/enhance-portrait.js +45 -0
- package/dist/prompts/templates/enhance-portrait.js.map +1 -0
- package/dist/prompts/templates/export-social-variants.d.ts +3 -0
- package/dist/prompts/templates/export-social-variants.d.ts.map +1 -0
- package/dist/prompts/templates/export-social-variants.js +45 -0
- package/dist/prompts/templates/export-social-variants.js.map +1 -0
- package/dist/prompts/templates/frequency-separation.d.ts +3 -0
- package/dist/prompts/templates/frequency-separation.d.ts.map +1 -0
- package/dist/prompts/templates/frequency-separation.js +29 -0
- package/dist/prompts/templates/frequency-separation.js.map +1 -0
- package/dist/prompts/templates/gradient-blend.d.ts +3 -0
- package/dist/prompts/templates/gradient-blend.d.ts.map +1 -0
- package/dist/prompts/templates/gradient-blend.js +43 -0
- package/dist/prompts/templates/gradient-blend.js.map +1 -0
- package/dist/prompts/templates/gradient-fade.d.ts +3 -0
- package/dist/prompts/templates/gradient-fade.d.ts.map +1 -0
- package/dist/prompts/templates/gradient-fade.js +57 -0
- package/dist/prompts/templates/gradient-fade.js.map +1 -0
- package/dist/prompts/templates/organize-layers.d.ts +3 -0
- package/dist/prompts/templates/organize-layers.d.ts.map +1 -0
- package/dist/prompts/templates/organize-layers.js +43 -0
- package/dist/prompts/templates/organize-layers.js.map +1 -0
- package/dist/prompts/templates/prepare-for-web.d.ts +3 -0
- package/dist/prompts/templates/prepare-for-web.d.ts.map +1 -0
- package/dist/prompts/templates/prepare-for-web.js +42 -0
- package/dist/prompts/templates/prepare-for-web.js.map +1 -0
- package/dist/prompts/templates/remove-background.d.ts +3 -0
- package/dist/prompts/templates/remove-background.d.ts.map +1 -0
- package/dist/prompts/templates/remove-background.js +36 -0
- package/dist/prompts/templates/remove-background.js.map +1 -0
- package/dist/prompts/templates/remove-distraction.d.ts +3 -0
- package/dist/prompts/templates/remove-distraction.d.ts.map +1 -0
- package/dist/prompts/templates/remove-distraction.js +31 -0
- package/dist/prompts/templates/remove-distraction.js.map +1 -0
- package/dist/prompts/templates/sky-blend.d.ts +3 -0
- package/dist/prompts/templates/sky-blend.d.ts.map +1 -0
- package/dist/prompts/templates/sky-blend.js +61 -0
- package/dist/prompts/templates/sky-blend.js.map +1 -0
- package/dist/prompts/templates.d.ts +8 -0
- package/dist/prompts/templates.d.ts.map +1 -0
- package/dist/prompts/templates.js +162 -0
- package/dist/prompts/templates.js.map +1 -0
- package/dist/tools/action-tools.d.ts.map +1 -1
- package/dist/tools/action-tools.js +8 -1
- package/dist/tools/action-tools.js.map +1 -1
- package/dist/tools/adjustment-tools.d.ts.map +1 -1
- package/dist/tools/adjustment-tools.js +54 -2
- package/dist/tools/adjustment-tools.js.map +1 -1
- package/dist/tools/atomic-shared.d.ts +15 -0
- package/dist/tools/atomic-shared.d.ts.map +1 -0
- package/dist/tools/atomic-shared.js +42 -0
- package/dist/tools/atomic-shared.js.map +1 -0
- package/dist/tools/document-tools.d.ts.map +1 -1
- package/dist/tools/document-tools.js +10 -2
- package/dist/tools/document-tools.js.map +1 -1
- package/dist/tools/image-placement-tools.d.ts.map +1 -1
- package/dist/tools/image-placement-tools.js +10 -2
- package/dist/tools/image-placement-tools.js.map +1 -1
- package/dist/tools/layer-tools.d.ts.map +1 -1
- package/dist/tools/layer-tools.js +73 -5
- package/dist/tools/layer-tools.js.map +1 -1
- package/dist/tools/mask-tools.d.ts +4 -0
- package/dist/tools/mask-tools.d.ts.map +1 -0
- package/dist/tools/mask-tools.js +107 -0
- package/dist/tools/mask-tools.js.map +1 -0
- package/dist/tools/recipe-tools.d.ts +4 -0
- package/dist/tools/recipe-tools.d.ts.map +1 -0
- package/dist/tools/recipe-tools.js +265 -0
- package/dist/tools/recipe-tools.js.map +1 -0
- package/dist/tools/recipes/_shared.d.ts +37 -0
- package/dist/tools/recipes/_shared.d.ts.map +1 -0
- package/dist/tools/recipes/_shared.js +261 -0
- package/dist/tools/recipes/_shared.js.map +1 -0
- package/dist/tools/recipes/apply-color-grade.d.ts +4 -0
- package/dist/tools/recipes/apply-color-grade.d.ts.map +1 -0
- package/dist/tools/recipes/apply-color-grade.js +98 -0
- package/dist/tools/recipes/apply-color-grade.js.map +1 -0
- package/dist/tools/recipes/batch-mockup-replace.d.ts +4 -0
- package/dist/tools/recipes/batch-mockup-replace.d.ts.map +1 -0
- package/dist/tools/recipes/batch-mockup-replace.js +185 -0
- package/dist/tools/recipes/batch-mockup-replace.js.map +1 -0
- package/dist/tools/recipes/dodge-burn.d.ts +4 -0
- package/dist/tools/recipes/dodge-burn.d.ts.map +1 -0
- package/dist/tools/recipes/dodge-burn.js +84 -0
- package/dist/tools/recipes/dodge-burn.js.map +1 -0
- package/dist/tools/recipes/enhance-portrait.d.ts +4 -0
- package/dist/tools/recipes/enhance-portrait.d.ts.map +1 -0
- package/dist/tools/recipes/enhance-portrait.js +110 -0
- package/dist/tools/recipes/enhance-portrait.js.map +1 -0
- package/dist/tools/recipes/export-social-variants.d.ts +4 -0
- package/dist/tools/recipes/export-social-variants.d.ts.map +1 -0
- package/dist/tools/recipes/export-social-variants.js +180 -0
- package/dist/tools/recipes/export-social-variants.js.map +1 -0
- package/dist/tools/recipes/frequency-separation.d.ts +4 -0
- package/dist/tools/recipes/frequency-separation.d.ts.map +1 -0
- package/dist/tools/recipes/frequency-separation.js +77 -0
- package/dist/tools/recipes/frequency-separation.js.map +1 -0
- package/dist/tools/recipes/gradient-fade.d.ts +4 -0
- package/dist/tools/recipes/gradient-fade.d.ts.map +1 -0
- package/dist/tools/recipes/gradient-fade.js +121 -0
- package/dist/tools/recipes/gradient-fade.js.map +1 -0
- package/dist/tools/recipes/index.d.ts +5 -0
- package/dist/tools/recipes/index.d.ts.map +1 -0
- package/dist/tools/recipes/index.js +43 -0
- package/dist/tools/recipes/index.js.map +1 -0
- package/dist/tools/recipes/organize-layers.d.ts +4 -0
- package/dist/tools/recipes/organize-layers.d.ts.map +1 -0
- package/dist/tools/recipes/organize-layers.js +156 -0
- package/dist/tools/recipes/organize-layers.js.map +1 -0
- package/dist/tools/recipes/prepare-for-web.d.ts +4 -0
- package/dist/tools/recipes/prepare-for-web.d.ts.map +1 -0
- package/dist/tools/recipes/prepare-for-web.js +125 -0
- package/dist/tools/recipes/prepare-for-web.js.map +1 -0
- package/dist/tools/recipes/remove-background.d.ts +4 -0
- package/dist/tools/recipes/remove-background.d.ts.map +1 -0
- package/dist/tools/recipes/remove-background.js +106 -0
- package/dist/tools/recipes/remove-background.js.map +1 -0
- package/dist/tools/recipes/remove-distraction.d.ts +4 -0
- package/dist/tools/recipes/remove-distraction.d.ts.map +1 -0
- package/dist/tools/recipes/remove-distraction.js +74 -0
- package/dist/tools/recipes/remove-distraction.js.map +1 -0
- package/dist/tools/recipes/sky-blend.d.ts +4 -0
- package/dist/tools/recipes/sky-blend.d.ts.map +1 -0
- package/dist/tools/recipes/sky-blend.js +135 -0
- package/dist/tools/recipes/sky-blend.js.map +1 -0
- package/dist/tools/selection-tools.d.ts.map +1 -1
- package/dist/tools/selection-tools.js +104 -2
- package/dist/tools/selection-tools.js.map +1 -1
- package/dist/tools/state-tools.d.ts +4 -0
- package/dist/tools/state-tools.d.ts.map +1 -0
- package/dist/tools/state-tools.js +133 -0
- package/dist/tools/state-tools.js.map +1 -0
- package/dist/tools/text-tools.d.ts.map +1 -1
- package/dist/tools/text-tools.js +60 -2
- package/dist/tools/text-tools.js.map +1 -1
- package/dist/ui/agent/api-key.d.ts +19 -0
- package/dist/ui/agent/api-key.d.ts.map +1 -0
- package/dist/ui/agent/api-key.js +113 -0
- package/dist/ui/agent/api-key.js.map +1 -0
- package/dist/ui/agent/claude-account.d.ts +16 -0
- package/dist/ui/agent/claude-account.d.ts.map +1 -0
- package/dist/ui/agent/claude-account.js +150 -0
- package/dist/ui/agent/claude-account.js.map +1 -0
- package/dist/ui/agent/gemini-account.d.ts +15 -0
- package/dist/ui/agent/gemini-account.d.ts.map +1 -0
- package/dist/ui/agent/gemini-account.js +212 -0
- package/dist/ui/agent/gemini-account.js.map +1 -0
- package/dist/ui/agent/mcp-transport.d.ts +9 -0
- package/dist/ui/agent/mcp-transport.d.ts.map +1 -0
- package/dist/ui/agent/mcp-transport.js +34 -0
- package/dist/ui/agent/mcp-transport.js.map +1 -0
- package/dist/ui/agent/shared.d.ts +30 -0
- package/dist/ui/agent/shared.d.ts.map +1 -0
- package/dist/ui/agent/shared.js +60 -0
- package/dist/ui/agent/shared.js.map +1 -0
- package/dist/ui/agent.d.ts +11 -26
- package/dist/ui/agent.d.ts.map +1 -1
- package/dist/ui/agent.js +58 -173
- package/dist/ui/agent.js.map +1 -1
- package/dist/ui/config.d.ts +7 -0
- package/dist/ui/config.d.ts.map +1 -1
- package/dist/ui/config.js +22 -0
- package/dist/ui/config.js.map +1 -1
- package/dist/ui/providers/anthropic.d.ts.map +1 -1
- package/dist/ui/providers/anthropic.js +24 -0
- package/dist/ui/providers/anthropic.js.map +1 -1
- package/dist/ui/providers/cli-utils.d.ts +12 -0
- package/dist/ui/providers/cli-utils.d.ts.map +1 -0
- package/dist/ui/providers/cli-utils.js +46 -0
- package/dist/ui/providers/cli-utils.js.map +1 -0
- package/dist/ui/providers/google.d.ts.map +1 -1
- package/dist/ui/providers/google.js +18 -0
- package/dist/ui/providers/google.js.map +1 -1
- package/dist/ui/providers/openai.d.ts.map +1 -1
- package/dist/ui/providers/openai.js +1 -0
- package/dist/ui/providers/openai.js.map +1 -1
- package/dist/ui/providers/openrouter.d.ts.map +1 -1
- package/dist/ui/providers/openrouter.js +1 -0
- package/dist/ui/providers/openrouter.js.map +1 -1
- package/dist/ui/providers/registry.d.ts +1 -1
- package/dist/ui/providers/registry.d.ts.map +1 -1
- package/dist/ui/providers/types.d.ts +11 -0
- package/dist/ui/providers/types.d.ts.map +1 -1
- package/dist/ui/server.d.ts.map +1 -1
- package/dist/ui/server.js +73 -11
- package/dist/ui/server.js.map +1 -1
- package/dist/utils/extendscript-file.d.ts +4 -0
- package/dist/utils/extendscript-file.d.ts.map +1 -0
- package/dist/utils/extendscript-file.js +6 -0
- package/dist/utils/extendscript-file.js.map +1 -0
- package/dist/utils/extendscript-result.d.ts +7 -0
- package/dist/utils/extendscript-result.d.ts.map +1 -0
- package/dist/utils/extendscript-result.js +42 -0
- package/dist/utils/extendscript-result.js.map +1 -0
- package/dist/utils/js-string.d.ts +2 -0
- package/dist/utils/js-string.d.ts.map +1 -0
- package/dist/utils/js-string.js +8 -0
- package/dist/utils/js-string.js.map +1 -0
- package/package.json +11 -3
- package/web/dist/assets/index-BN0tu4e6.css +1 -0
- package/web/dist/assets/index-Cf7sH5RM.js +138 -0
- package/web/dist/index.html +2 -2
- package/web/dist/assets/index-Kxyfap9w.js +0 -138
- 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
|
[](https://www.npmjs.com/package/@alisaitteke/photoshop-mcp)
|
|
@@ -6,13 +9,15 @@
|
|
|
6
9
|
[](https://www.typescriptlang.org/)
|
|
7
10
|
[]()
|
|
8
11
|
|
|
9
|
-
A Model Context Protocol (MCP) server that enables AI assistants like Claude and Cursor to control Adobe Photoshop programmatically. This allows you to create designs, manipulate images, and automate Photoshop workflows through natural language commands while working in your IDE.
|
|
12
|
+
A Model Context Protocol (MCP) server that enables AI assistants like Claude and Cursor to control Adobe Photoshop programmatically. This allows you to create designs, manipulate images, and automate Photoshop workflows through natural language commands while working in your IDE — or through the bundled **standalone web UI**, which supports both API keys and CLI subscription accounts (Claude Code / Gemini CLI).
|
|
10
13
|
|
|
11
14
|
## 🖥️ Standalone UI (no IDE required)
|
|
12
15
|
|
|
13
16
|
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
|
-
through this MCP server underneath.
|
|
18
|
+
through this MCP server underneath. Connect with a provider API key **or**, for
|
|
19
|
+
Anthropic and Google, reuse the OAuth session from **Claude Code** or **Gemini
|
|
20
|
+
CLI** — no separate API key required.
|
|
16
21
|
|
|
17
22
|

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