Token导航 LogoToken导航TokenDH.com
Photoshop MCP logo
设计创作stdio官方级别未说明来源级核验

Photoshop MCP

MCP Server

@alisaitteke/photoshop-mcp

一个通过MCP协议实现AI助手程序化控制Adobe Photoshop的服务,支持通过自然语言命令进行设计创建、图像处理和自动化工作流。

工具数

59

提示词数

0

GitHub Stars

44

资源数

0
图像处理TypeScriptClaude工作流优化Claude DesktopClaudeCursor

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

alisaitteke

提供方

alisaitteke

最后核验

2026/5/17 20:50

运行时

Node.js

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

npx -p @alisaitteke/photoshop-mcp photoshop-mcp-ui

详细介绍

Photoshop MCP服务器

注: 这是一个非官方的、社区维护的项目,不隶属于Adobe股份有限公司或由其认可。

](https://www.npmjs.com/package/@alisaitteke/photoshop-mcp) ![License: MIT](https://opensource.org/licenses/MIT) ![TypeScript](https://www.typescriptlang.org/) ![Platform](<>)

一个模型上下文协议(MCP)服务器,使Claude和Cursor等AI助手能够以编程方式控制Adobe Photoshop。这允许您在IDE中工作时通过自然语言命令创建设计、操纵图像和自动化Photoshop工作流程。

🖥️ 独立用户界面(无需IDE)

不想将此连接到Claude Desktop或Cursor?同一包裹运送 完全本地的web UI,允许您与AI模型聊天并驱动Photoshop 通过下面的MCP服务器。

Standalone UI Screenshot

npx -p @alisaitteke/photoshop-mcp photoshop-mcp-ui

就是这样。本地服务器启动 127.0.0.1 (随机自由端口)和您的 默认浏览器会自动打开聊天UI。

支持的提供商

在首次发布时选择以下任意一项-带上您自己的API密钥:

提供者模型获取密钥
人类克劳德十四行诗/歌剧/俳句console.anthropic.com
开放人工智能GPT-5、GPT-4.1、o系列platform.openai.com
谷歌Gemini 2.5 Pro/Flash/Flash Liteaistudio.google.com
开放路由来自任何供应商的100多种型号openrouter.ai

首次发射时会发生什么

  1. 选择一个提供者并粘贴您的API密钥。
  2. 密钥根据提供者进行验证,然后存储在本地

~/.photoshop-mcp/data.db (SQLite, chmod 600).它永远不会离开你 机器。

  1. 键入自然语言提示。UI流式传输模型的回复,运行

Photoshop工具实时调用,并将每个工具调用渲染为 可检查卡(输入+结果)。

  1. 随时从型号选择器切换供应商或型号——聊天、成本和

工具历史记录在会话之间持久化。

CLI标志

photoshop-mcp-ui [--port 5174] [--host 127.0.0.1] [--no-open]

备注

  • 该代理仅限于Photoshop MCP工具——内置shell、文件

并且禁用网络工具。

在前端; 荣誉 +the Vercel AI SDK 在后端。代理循环通过以下方式与同一Photoshop MCP服务器进行通信 STDIO——与IDE集成相同的代码路径。

______________________________________________________________________

示例提示

以下是配置此MCP服务器时,您可以与AI助手(Claude、Cursor等)一起使用的示例提示:

🎨 Basic Design Creation

Create a 1920x1080 Photoshop document with RGB color mode.
Add a light blue background layer and fill it with RGB(240, 248, 255).
Add centered text "Welcome" in 64pt font.
Save as welcome.psd to my Desktop.

🖼️ Stock Image Design (with Pexels MCP)

Search Pexels for "mountain sunset" images.
Create a 1920x1080 Photoshop document.
Place the downloaded image and fit it to fill the entire canvas.
Apply a subtle Gaussian blur of 3px.
Increase brightness by 15 and contrast by 10.
Add white text "Adventure Awaits" centered at the top in 72pt.
Set the text opacity to 90% and blend mode to OVERLAY.
Save as adventure.jpg with quality 10.

✨ Photo Enhancement

Open photo.jpg from my Desktop in Photoshop.
Apply auto levels and auto contrast.
Apply unsharp mask with amount 120%, radius 1.5, threshold 0.
Increase saturation by 15.
Crop to remove 100px from each edge.
Save as enhanced-photo.jpg with quality 12.

🎭 Layer Effects & Blending

Create a 1200x800 document.
Add a new layer named "Background" and fill with RGB(50, 50, 50).
Place logo.png at position (100, 100).
Fit the logo layer to 50% of its current size.
Set blend mode to SCREEN and opacity to 85%.
Add another layer, fill with RGB(255, 100, 50).
Set this layer's blend mode to MULTIPLY and opacity to 60%.
Merge all visible layers.
Save as composite.psd.

📝 Text Poster Design

Create a 1080x1350 portrait document (Instagram story size).
Add a layer and fill with gradient-like color RGB(120, 40, 200).
Add text "SUMMER" at (540, 300) in 96pt.
Change text color to white RGB(255, 255, 255).
Set text alignment to CENTER.
Add another text "2026" at (540, 450) in 128pt, white color.
Apply Gaussian blur 2px to the background layer.
Save as summer-poster.png.

🎬 Batch Processing

Open image1.jpg.
Resize to 1920x1080.
Apply auto contrast.
Apply subtle sharpen (amount 80%, radius 1.0).
Save as processed-1.jpg with quality 10.
Close without saving changes to original.

Repeat for image2.jpg and image3.jpg.

🖌️ Creative Manipulation

Create a 2000x2000 square document.
Place abstract-pattern.jpg and fit to fill document.
Duplicate the layer.
On the duplicate, apply motion blur at 45 degrees, radius 50px.
Set blend mode to OVERLAY and opacity to 70%.
Add centered text "MOTION" in 120pt white.
Apply a rectangular selection from (200, 200) to (1800, 1800).
Invert the selection and delete (to create a border effect).
Flatten the image.
Save as motion-art.jpg.

🎯 Advanced Workflow

Create a 3000x2000 document at 300 DPI for print.
Place hero-image.jpg and fit to fill the canvas.
Duplicate the image layer.
On the duplicate, desaturate it completely.
Set blend mode to LUMINOSITY and opacity to 50%.
Create a new layer named "Overlay".
Fill with RGB(255, 150, 0) and set blend mode to SOFTLIGHT at 30% opacity.
Add text "PORTFOLIO" at top center (1500, 200) in 96pt.
Set text color to white.
Add subtext "2026 Collection" at (1500, 320) in 36pt.
Create a rectangular selection around the text area.
Create a layer mask on the overlay layer.
Merge visible layers.
Save as portfolio-cover.psd.
Export as portfolio-cover.jpg at quality 12.

🔄 Using Actions

Open my-photo.jpg.
Play the "Vintage Look" action from "My Actions" set.
Adjust brightness by -10 to darken slightly.
Save as vintage-photo.jpg.

⚡ Custom Script Execution

Execute this custom ExtendScript code:
app.beep();
alert('Processing started!');

⏮️ Undo/Redo Operations

Apply Gaussian blur 15px to the active layer.
[Wait for result]
Actually, that's too much blur. Undo that.
Apply Gaussian blur 5px instead.

或者:

Get the history states to see what operations were performed.
Undo the last 3 operations.
Redo 1 step to bring back one operation.

🎨 50+ Tools | 🖥️ Cross-Platform | 📦 NPX Ready | 🔧 ExtendScript API | ⏮️ Undo/Redo

特性

  • 适用于Windows和macOS
  • 支持Photoshop 2012-2025+
  • ExtendeScript API:通过AppleScript/COM自动化实现通用兼容性
  • 自动检测:自动查找系统上的Photoshop安装
  • 50+工具:全面的Photoshop自动化
  • 文档管理:创建、打开、保存、关闭、裁剪文档
  • 图层操作:创建、删除、复制、合并、变换图层
  • 图层属性:不透明度、混合模式、可见性、锁定
  • 文本格式:字体、大小、颜色、对齐控制
  • 图像放置:放置图像、打开文件、适应文档
  • 过滤器:高斯模糊、锐化、噪波、运动模糊
  • 色彩调整:亮度/对比度、色调/饱和度、自动级别/对比度
  • 选择和口罩:矩形选择、图层遮罩
  • 历史控制:撤消/恢复操作,查看历史状态
  • 行动:播放录制的动作,执行自定义脚本
  • 自动光栅化:过滤器需要时自动转换图层
  • 上下文跟踪:每次操作后返回文档/图层状态,以实现AI上下文感知

安装

使用NPX(推荐)

无需安装!只需配置您的MCP客户端:

npx @alisaitteke/photoshop-mcp

源自

git clone https://github.com/alisaitteke/photoshop-mcp.git
cd photoshop-mcp
npm install
npm run build

配置

对于光标

添加到光标设置(.cursor/config.json 或工作空间设置):

{
  "mcpServers": {
    "photoshop": {
      "command": "npx",
      "args": ["-y", "@alisaitteke/photoshop-mcp"],
      "env": {
        "LOG_LEVEL": "1"
      }
    }
  }
}

适用于克劳德桌面

添加到您的Claude桌面配置(~/Library/Application Support/Claude/claude_desktop_config.json 在macOS或 %APPDATA%\Claude\claude_desktop_config.json 在Windows上):

{
  "mcpServers": {
    "photoshop": {
      "command": "npx",
      "args": ["-y", "@alisaitteke/photoshop-mcp"],
      "env": {
        "LOG_LEVEL": "1"
      }
    }
  }
}

环境变量

  • PHOTOSHOP_PATH:(可选)指定自定义Photoshop安装路径
  • LOG_LEVEL:日志记录级别(0=调试,1=信息,2=警告,3=错误)

可用工具

连接和信息

photoshop_ping

测试与Photoshop的连接。

// Example: Check if Photoshop is accessible
photoshop_ping()

photoshop_get_version

获取Photoshop版本信息。

// Example: Get version details
photoshop_get_version()

文档管理

photoshop_create_document

创建一个新的Photoshop文档。

参数:

  • width (数字,必填):文档宽度(像素)
  • height (数字,必填):文档高度(像素)
  • resolution (数字,可选):DPI分辨率(默认值:72)
  • colorMode (字符串,可选):颜色模式-RGB、CMYK或灰度(默认值:RGB)
// Example: Create a 1920x1080 RGB document
photoshop_create_document({
  width: 1920,
  height: 1080,
  resolution: 72,
  colorMode: "RGB"
})

photoshop_get_document_info

获取有关活动文档的信息。

// Example: Get current document details
photoshop_get_document_info()

photoshop_save_document

保存活动文档。

参数:

  • path (字符串,必填):保存的完整路径
  • format (字符串,可选):PSD、JPEG或PNG(默认:PSD)
  • quality (数字,可选):JPEG质量1-12(默认值:8)
// Example: Save as JPEG
photoshop_save_document({
  path: "/Users/username/Desktop/output.jpg",
  format: "JPEG",
  quality: 10
})

photoshop_close_document

关闭活动文档。

参数:

  • save (布尔值,可选):关闭前保存(默认值:false)
// Example: Close without saving
photoshop_close_document({ save: false })

图层操作

photoshop_create_layer

创建新图层。

参数:

  • name (字符串,可选):图层名称
// Example: Create a named layer
photoshop_create_layer({ name: "Background" })

photoshop_delete_layer

删除活动层。

// Example: Delete current layer
photoshop_delete_layer()

photoshop_create_text_layer

创建文本图层。

参数:

  • text (字符串,必填):文本内容
  • x (数字,可选):X位置(像素)(默认值:100)
  • y (数字,可选):Y位置(像素)(默认值:100)
  • fontSize (数字,可选):字体大小(默认值:24)
// Example: Create a text layer
photoshop_create_text_layer({
  text: "Hello World",
  x: 200,
  y: 150,
  fontSize: 48
})

photoshop_fill_layer

用纯色填充活动层。

参数:

  • red (数字,必填):红色分量(0-255)
  • green (数字,必填):绿色组件(0-255)
  • blue (数字,必填):蓝色分量(0-255)
// Example: Fill with blue
photoshop_fill_layer({
  red: 0,
  green: 100,
  blue: 255
})

photoshop_get_layers

获取活动文档中所有图层的列表。

// Example: List all layers
photoshop_get_layers()

photoshop_set_layer_opacity

设置活动层的不透明度。

参数:

  • opacity (数字,必填):不透明度值(0-100)
// Example: Set opacity to 75%
photoshop_set_layer_opacity({ opacity: 75 })

photoshop_set_layer_blend_mode

设置活动层的混合模式。

参数:

  • blendMode (字符串,必填):混合模式(正常、多重、屏幕、叠加等)
// Example: Set blend mode to multiply
photoshop_set_layer_blend_mode({ blendMode: "MULTIPLY" })

可用的混合模式:正常、溶解、深色、多重、彩色、亚麻布、深色、浅色、屏幕、彩色、线条、浅色、覆盖、柔和、强光、可见光、线条、粉色、混合、差异、排除、潜行、分割、HUE、饱和度、颜色、亮度

photoshop_set_layer_visibility

显示或隐藏活动层。

参数:

  • visible (布尔值,必填):可见性状态
// Example: Hide layer
photoshop_set_layer_visibility({ visible: false })

photoshop_set_layer_locked

锁定或解锁活动层。

参数:

  • locked (布尔值,必填):锁定状态
// Example: Lock layer
photoshop_set_layer_locked({ locked: true })

photoshop_rename_layer

重命名活动层。

参数:

  • name (字符串,必填):新图层名称
// Example: Rename layer
photoshop_rename_layer({ name: "Hero Image" })

photoshop_duplicate_layer

复制活动层。

参数:

  • newName (字符串,可选):重复层的名称
// Example: Duplicate layer with new name
photoshop_duplicate_layer({ newName: "Background Copy" })

photoshop_merge_visible_layers

将所有可见层合并为一个。

// Example: Merge visible layers
photoshop_merge_visible_layers()

photoshop_flatten_image

将所有图层平铺为一个背景图层。

// Example: Flatten image
photoshop_flatten_image()

photoshop_rasterize_layer

将活动层光栅化(将文本/智能对象转换为普通层)。

// Example: Rasterize layer
photoshop_rasterize_layer()

图层排序

photoshop_move_layer_to_position

相对于另一层移动活动层。

参数:

  • targetLayerName (string,必填):参考图层的名称
  • position (字符串,必填):上方、下方、顶部或底部
// Example: Move layer above "Background"
photoshop_move_layer_to_position({
  targetLayerName: "Background",
  position: "ABOVE"
})

photoshop_move_layer_to_top

将活动层移动到层堆栈的顶部。

// Example: Move to top
photoshop_move_layer_to_top()

photoshop_move_layer_to_bottom

将活动层移动到层堆栈的底部。

// Example: Move to bottom
photoshop_move_layer_to_bottom()

photoshop_move_layer_up

将活动层向上移动一个位置。

// Example: Move up
photoshop_move_layer_up()

photoshop_move_layer_down

将活动层向下移动一个位置。

// Example: Move down
photoshop_move_layer_down()

图层转换

photoshop_fit_layer_to_document

缩放活动层以适应文档画布,同时保持纵横比。

参数:

  • fillDocument (boolean,可选):如果为true,则填充整个画布(可以裁剪)。如果为false,则适合画布(可能有边距)。默认值:false
// Example: Fit layer within canvas
photoshop_fit_layer_to_document({ fillDocument: false })

// Example: Fill entire canvas (cropping if needed)
photoshop_fit_layer_to_document({ fillDocument: true })

photoshop_scale_layer

按百分比缩放活动层。

参数:

  • scalePercent (数字,必填):比例百分比(例如,50%为50,200%为200)
  • centerAnchor (布尔值,可选):从中心(true)或左上角(false)缩放。默认值:true
// Example: Scale to 150%
photoshop_scale_layer({
  scalePercent: 150,
  centerAnchor: true
})

photoshop_move_layer

按指定的偏移量移动活动层。

参数:

  • deltaX (数字,必填):水平偏移(像素)
  • deltaY (数字,必填):垂直偏移(像素)
// Example: Move layer 100px right and 50px down
photoshop_move_layer({
  deltaX: 100,
  deltaY: 50
})

photoshop_rotate_layer

旋转活动层。

参数:

  • degrees (数字,必填):旋转角度(度)(正=顺时针)
// Example: Rotate 45 degrees clockwise
photoshop_rotate_layer({ degrees: 45 })

过滤器

photoshop_apply_gaussian_blur

将高斯模糊滤镜应用于活动层。

参数:

  • radius (数字,必填):模糊半径(像素)(0.1-250)
// Example: Apply 10px blur
photoshop_apply_gaussian_blur({ radius: 10 })

photoshop_apply_sharpen

应用去锐化面膜(锐化)滤镜。

参数:

  • amount (数字,必填):锐化金额百分比(1-500)
  • radius (数字,必填):半径(像素)(0.1-250)
  • threshold (数字,可选):阈值级别(0-255,默认值:0)
// Example: Sharpen image
photoshop_apply_sharpen({
  amount: 100,
  radius: 1.5,
  threshold: 0
})

photoshop_apply_noise

应用“添加噪波”过滤器。

参数:

  • amount (数字,必填):噪声量百分比(0.1-400)
  • distribution (字符串,可选):统一格式或高斯文(默认:统一格式)
  • monochromatic (布尔值,可选):单色噪声(默认值:false)
// Example: Add noise
photoshop_apply_noise({
  amount: 10,
  distribution: "GAUSSIAN",
  monochromatic: false
})

photoshop_apply_motion_blur

应用运动模糊滤镜。

参数:

  • angle (数字,必填):模糊角度(-360至360度)
  • radius (数字,必填):模糊距离(像素)(1-999)
// Example: Apply motion blur
photoshop_apply_motion_blur({
  angle: 45,
  radius: 20
})

色彩调整

photoshop_adjust_brightness_contrast

调整亮度和对比度。

参数:

  • brightness (数字,必填):亮度调节(-100至100)
  • contrast (数字,必填):对比度调整(-100到100)
// Example: Increase brightness and contrast
photoshop_adjust_brightness_contrast({
  brightness: 20,
  contrast: 15
})

photoshop_adjust_hue_saturation

调整色调、饱和度和亮度。

参数:

  • hue (数字,必填):色调偏移(-180到180)
  • saturation (数字,必填):饱和度调整(-100到100)
  • lightness (数字,必填):亮度调节(-100至100)
// Example: Adjust colors
photoshop_adjust_hue_saturation({
  hue: 30,
  saturation: 20,
  lightness: 0
})

photoshop_auto_levels

应用自动水平调整。

// Example: Auto levels
photoshop_auto_levels()

photoshop_auto_contrast

应用自动对比度调整。

// Example: Auto contrast
photoshop_auto_contrast()

photoshop_desaturate

降低图层饱和度(转换为灰度)。

// Example: Desaturate
photoshop_desaturate()

photoshop_invert

反转图层的颜色。

// Example: Invert colors
photoshop_invert()

文本格式

photoshop_set_text_font

设置活动文本层的字体系列和大小。

参数:

  • fontName (字符串,必填):字体系列名称
  • fontSize (数字,可选):字体大小(以点为单位)
// Example: Change font
photoshop_set_text_font({
  fontName: "Helvetica",
  fontSize: 48
})

photoshop_set_text_color

设置活动文本层的颜色。

参数:

  • red (数字,必填):红色分量(0-255)
  • green (数字,必填):绿色组件(0-255)
  • blue (数字,必填):蓝色分量(0-255)
// Example: Set text to blue
photoshop_set_text_color({
  red: 0,
  green: 100,
  blue: 255
})

photoshop_set_text_alignment

设置文本对齐方式。

参数:

  • alignment (字符串,必填):左、中、右、左对齐、中对齐、右对齐、完全对齐
// Example: Center align text
photoshop_set_text_alignment({ alignment: "CENTER" })

photoshop_update_text_content

更新活动文本层的文本内容。

参数:

  • text (字符串,必填):新文本内容
// Example: Update text
photoshop_update_text_content({ text: "New Text" })

选择和口罩

photoshop_select_rectangle

创建矩形选择。

参数:

  • left, top, right, bottom (数字,必填):选择范围(像素)
// Example: Select area
photoshop_select_rectangle({
  left: 100,
  top: 100,
  right: 500,
  bottom: 400
})

photoshop_select_all

选择整个文档。

// Example: Select all
photoshop_select_all()

photoshop_deselect

清除所有选择。

// Example: Deselect
photoshop_deselect()

photoshop_invert_selection

反转当前选择。

// Example: Invert selection
photoshop_invert_selection()

photoshop_create_layer_mask

从当前选择创建图层遮罩。

// Example: Create mask
photoshop_create_layer_mask()

photoshop_delete_layer_mask

从活动层中删除层遮罩。

// Example: Delete mask
photoshop_delete_layer_mask()

photoshop_apply_layer_mask

将图层遮罩应用(合并)到图层。

// Example: Apply mask
photoshop_apply_layer_mask()

历史记录和撤消/重做

photoshop_undo

撤消上一个操作-相当于Ctrl/Cmd+Z。

参数:

  • steps (数字,可选):要撤消的步骤数(默认值:1)
// Example: Undo last operation
photoshop_undo()

// Example: Undo last 3 operations
photoshop_undo({ steps: 3 })

photoshop_redo

重做以前撤消的操作-相当于Ctrl/Cmd+Shift+Z。

参数:

  • steps (数字,可选):要重做的步骤数(默认值:1)
// Example: Redo last undone operation
photoshop_redo()

// Example: Redo last 2 undone operations
photoshop_redo({ steps: 2 })

photoshop_get_history

获取活动文档的历史状态。

// Example: View history
photoshop_get_history()

行动与自动化

photoshop_play_action

从“动作”选项板播放录制的动作。

参数:

  • actionName (字符串,必填):操作名称
  • actionSetName (字符串,必填):操作集名称
// Example: Play action
photoshop_play_action({
  actionName: "My Action",
  actionSetName: "Default Actions"
})

photoshop_execute_script

执行自定义ExtendScript代码(高级)。

参数:

  • code (字符串,必填):ExtendScript代码
// Example: Execute custom code
photoshop_execute_script({
  code: "app.beep();"
})

图像处理

photoshop_resize_image

调整活动图像的大小。

参数:

  • width (数字,必填):新宽度(像素)
  • height (数字,必填):新高度(像素)
// Example: Resize to Instagram post size
photoshop_resize_image({
  width: 1080,
  height: 1080
})

photoshop_crop_document

将文档裁剪到指定的边界。

参数:

  • left (数字,必填):左边缘像素
  • top (数字,必填):顶部边缘(像素)
  • right (数字,必填):右边缘(像素)
  • bottom (数字,必填):底部边缘(像素)
// Example: Crop document
photoshop_crop_document({
  left: 100,
  top: 100,
  right: 1820,
  bottom: 980
})

photoshop_place_image

将图像文件作为图层放置在活动文档中。

参数:

  • filePath (string,必填):图像文件的完整路径
  • x (数字,可选):X位置偏移(像素)(默认值:0)
  • y (数字,可选):Y位置偏移(像素)(默认值:0)
// Example: Place an image at specific position
photoshop_place_image({
  filePath: "/Users/username/Pictures/photo.jpg",
  x: 100,
  y: 200
})

photoshop_open_image

将图像文件作为新文档打开。

参数:

  • filePath (string,必填):图像文件的完整路径
// Example: Open an image
photoshop_open_image({
  filePath: "/Users/username/Pictures/photo.jpg"
})

______________________________________________________________________

用法示例

创建简单的设计

// 1. Create a new document
photoshop_create_document({
  width: 800,
  height: 600,
  colorMode: "RGB"
})

// 2. Create a background layer
photoshop_create_layer({ name: "Background" })

// 3. Fill it with a color
photoshop_fill_layer({
  red: 240,
  green: 240,
  blue: 255
})

// 4. Add a text layer
photoshop_create_text_layer({
  text: "My Design",
  x: 400,
  y: 300,
  fontSize: 64
})

// 5. Save the result
photoshop_save_document({
  path: "/Users/username/Desktop/design.psd",
  format: "PSD"
})

批处理图像

// 1. Open existing document (manual step)
// 2. Resize image
photoshop_resize_image({ width: 1920, height: 1080 })

// 3. Save as JPEG
photoshop_save_document({
  path: "/Users/username/Desktop/resized.jpg",
  format: "JPEG",
  quality: 12
})

// 4. Close document
photoshop_close_document({ save: false })

使用素材图像创建设计(使用Pexels MCP)

此示例显示了如何将Photoshop MCP与Pexels MCP结合使用:

// 1. Search for images on Pexels (using Pexels MCP server)
// Note: You need to have Pexels MCP server configured
pexels_photos_search({
  query: "nature landscape",
  per_page: 5
})

// 2. Download the image you want (manually or via script)
// 3. Create a new Photoshop document
photoshop_create_document({
  width: 1920,
  height: 1080,
  colorMode: "RGB"
})

// 4. Place the downloaded image
photoshop_place_image({
  filePath: "/Users/username/Downloads/pexels-photo.jpg",
  x: 0,
  y: 0
})

// 5. Fit the image to document (NEW!)
photoshop_fit_layer_to_document({
  fillDocument: true  // Fill entire canvas
})

// 6. Add text overlay
photoshop_create_text_layer({
  text: "Beautiful Nature",
  x: 960,
  y: 100,
  fontSize: 72
})

// 7. Save the final design
photoshop_save_document({
  path: "/Users/username/Desktop/nature-design.psd",
  format: "PSD"
})

上下文跟踪

每个工具都会返回有关Photoshop当前状态的全面上下文信息,包括:

  • 文档信息:名称、尺寸、分辨率、颜色模式、层数
  • 活动图层信息:名称、类型、不透明度、混合模式、可见性、锁定状态
  • 选择状态:选择是否处于活动状态
  • 操作结果:更改内容的具体细节

这使得AI助手能够保持对以下内容的意识:

  • 哪个文档处于活动状态
  • 正在处理哪一层
  • 当前图层属性(不透明度、混合模式等)
  • 文档尺寸和设置

示例响应:

{
  "applied": true,
  "filter": "Gaussian Blur",
  "radius": 10,
  "wasRasterized": true,
  "context": {
    "hasDocument": true,
    "document": {
      "name": "design.psd",
      "width": 1920,
      "height": 1080,
      "resolution": 72,
      "colorMode": "RGBColorMode",
      "layerCount": 3,
      "hasSelection": false
    },
    "activeLayer": {
      "name": "Background",
      "kind": "NORMAL",
      "opacity": 100,
      "blendMode": "NORMAL",
      "visible": true,
      "locked": false,
      "isBackground": false
    }
  }
}

这种上下文有助于AI助手记住他们在多个命令中处理的文档和层。

______________________________________________________________________

平台特定注意事项

视窗

  • 使用COM自动化与Photoshop通信
  • 基于注册表的安装路径自动检测
  • 支持32位和64位版本

macOS

  • 使用AppleScript/OSA进行Photoshop通信
  • 基于聚光灯的自动检测
  • 支持同时安装多个Photoshop版本

支持的Photoshop版本

  • 所有Photoshop版本 (2012-2025+):通过AppleScript(macOS)或COM(Windows)使用ExtendeScript API

重要提示:虽然Photoshop 2022+支持UXP插件,但通过AppleScript/COM的外部自动化只能使用ExtendScript。UXP是为内部插件设计的,不能从外部脚本调用。因此,此MCP服务器使用ExtendScript在所有Photoshop版本之间实现最大兼容性。

故障排除

“未找到Photoshop”

  1. 确保Photoshop安装在默认位置
  2. 或设置 PHOTOSHOP_PATH 自定义安装路径的环境变量
{
  "env": {
    "PHOTOSHOP_PATH": "C:\\Custom\\Path\\Adobe Photoshop 2025\\Photoshop.exe"
  }
}

“无法连接到Photoshop”

  1. 确保Photoshop正在运行(如果没有运行,服务器将尝试启动它)
  2. 检查Photoshop首选项中是否启用了脚本
  3. 在Windows上,验证COM自动化未被安全设置阻止

“脚本执行超时”

  • 对于大型文档,某些操作可能需要更长的时间
  • 默认超时为30秒
  • 对于复杂的操作,考虑将其分解为更小的步骤

调试日志记录

通过设置启用详细日志记录 LOG_LEVEL=0:

{
  "env": {
    "LOG_LEVEL": "0"
  }
}

发展

构建

npm run build

观看模式

npm run dev

棉绒和格式

npm run lint
npm run format

快速入门示例

💡 常见用例

任务提示示例
基础设计创建1920x1080文档,添加蓝色背景,居中文本“Hello”
照片编辑打开photo.jpg,应用自动级别,锐化100%,另存为已编辑的.jpg
库存图片放置image.jpg,适合填充画布,添加叠加文本“2026年夏季”
图层样式“将活动层混合模式设置为多个,不透明度80%”
过滤器“将10px高斯模糊应用于当前图层”
文本样式将文本更改为Helvetica 64pt,颜色为红色,居中对齐
批量工作调整大小为1080x1080,自动对比,另存为square.jpg,关闭
面具选择矩形100100到500500,创建图层遮罩

______________________________________________________________________

建筑

photoshop-mcp/
├── src/
│   ├── core/              # MCP server core
│   │   ├── server.ts      # Main MCP server
│   │   ├── session.ts     # Session management
│   │   └── tool-registry.ts  # Tool registration system
│   ├── platform/          # Platform-specific detection & execution
│   │   ├── detector.ts    # Main detector
│   │   ├── connection.ts  # Connection manager
│   │   ├── windows-detector.ts  # Windows registry detection
│   │   ├── windows-executor.ts  # Windows COM automation
│   │   ├── macos-detector.ts    # macOS Spotlight detection
│   │   └── macos-executor.ts    # macOS AppleScript execution
│   ├── api/              # Photoshop API abstractions
│   │   ├── photoshop-api.ts    # API factory
│   │   ├── batch-play.ts       # UXP batchPlay helpers (legacy)
│   │   └── extendscript.ts     # ExtendScript snippets library
│   ├── tools/            # MCP tool implementations (42+ tools)
│   │   ├── document-tools.ts        # Document operations
│   │   ├── layer-tools.ts           # Layer creation/deletion
│   │   ├── layer-properties-tools.ts # Opacity, blend modes, etc.
│   │   ├── layer-transform-tools.ts  # Scale, rotate, move
│   │   ├── image-tools.ts           # Resize, crop
│   │   ├── image-placement-tools.ts # Place/open images
│   │   ├── filter-tools.ts          # Blur, sharpen, noise
│   │   ├── adjustment-tools.ts      # Color adjustments
│   │   ├── text-tools.ts            # Text formatting
│   │   ├── selection-tools.ts       # Selections & masks
│   │   └── action-tools.ts          # Actions & custom scripts
│   └── utils/            # Utilities
│       └── logger.ts     # Logging system (stderr-based)
└── examples/             # Configuration examples
    ├── cursor-config.json
    └── claude-desktop-config.json

贡献

欢迎投稿!请随时提交拉取请求。

许可证

麻省理工学院

致谢

目录标签

目录标签

图像处理TypeScriptClaude工作流优化Photoshop自动化本地部署AI设计工具开发工具集成AI辅助设计

支持客户端

Claude DesktopClaudeCursor

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

session

运行时(runtime,运行环境)

Node.js

来源包(packageName,安装包名)

@alisaitteke/photoshop-mcp

工具数量(toolCount,工具数)

59

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiosession部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP