Photoshop MCP服务器
](https://pypi.org/project/photoshop-mcp-server/) ](https://pypi.org/project/photoshop-mcp-server/)   ](https://pypi.org/project/photoshop-mcp-server/)  ](https://github.com/loonghao/photoshop-python-api-mcp-server/stargazers) ](https://github.com/loonghao/photoshop-python-api-mcp-server/issues) ](https://github.com/loonghao/photoshop-python-api-mcp-server/commits/main)
⚠️ 仅限窗户:由于此服务器依赖于Windows特定的COM接口,因此只能在Windows操作系统上运行。
使用Photoshop python api集成Photoshop的模型上下文协议(MCP)服务器。
英语| 简体中文
概述
该项目在模型上下文协议(MCP)和Adobe Photoshop之间架起了一座桥梁,允许AI助手和其他MCP客户端以编程方式控制Photoshop。
它能做什么?
借助此MCP服务器,AI助手可以:
- 创建、打开和保存Photoshop文档
- 创建和操作图层(文本、纯色等)
- 获取有关Photoshop会话和文档的信息
- 对图像应用效果和调整
- 还有更多!
需求
系统要求
- 🔴 仅限WINDOWS操作系统:此服务器仅适用于Windows操作系统
- 服务器依赖于Windows特定的COM接口与Photoshop通信 - macOS和Linux不受支持,无法运行此软件
软件需求
- Adobe Photoshop:必须在本地安装(使用CC2017至2024版本进行测试)
- python:3.10或更高版本
安装
备注:请记住,此软件包仅适用于Windows系统。
# Install using pip
pip install photoshop-mcp-server
# Or using uv
uv install photoshop-mcp-serverMCP主机配置
此服务器旨在与各种MCP主机配合使用。这 PS_VERSION 环境变量用于指定要连接到哪个Photoshop版本(例如,“2024”、“2023”、“2022”等)。
建议配置服务器的方法是使用 uvx 作为命令,这是官方标准格式。
标准配置(推荐)
将以下内容添加到MCP主机配置中(适用于Claude Desktop、Windsurf、Cline和其他MCP主机):
{
"mcpServers": {
"photoshop": {
"command": "uvx",
"args": ["--python", "3.10", "photoshop-mcp-server"],
"env": {
"PS_VERSION": "2024"
}
}
}
}配置选项
- PS_版本:指定要连接的Photoshop版本(例如,“2024”、“2023”、“2022”等)
- 命令:使用
uvx对于标准方法 - 参数:使用
["photoshop-mcp-server"]运行Photoshop MCP服务器
- 要明确指定Python版本,请使用 ["--python", "3.10", "photoshop-mcp-server"] (支持3.10至3.14的任何版本)
主要特点
可用资源
photoshop://info-获取Photoshop应用程序信息photoshop://document/info-获取活动文档信息photoshop://document/layers-在活动文档中获取图层
可用工具
服务器提供各种工具来控制Photoshop:
- 文档工具:创建、打开和保存文档
- 图层工具:创建文本图层、纯色图层等。
- 会话工具:获取有关Photoshop会话、活动文档、选择的信息
AI助手提示示例
在MCP主机中配置后,您可以在AI助手对话中使用Photoshop MCP服务器。以下是一些示例提示,以帮助您开始:
基本示例
User: Can you create a new Photoshop document and add a text layer with "Hello World"?
AI Assistant: I'll create a new document and add the text layer for you.
[The AI uses the Photoshop MCP server to:
1. Create a new document using the `create_document` tool
2. Add a text layer using the `create_text_layer` tool with the text "Hello World"]
I've created a new Photoshop document and added a text layer with "Hello World".更高级的示例
User: Open my latest PSD file and tell me how many layers it has.
AI Assistant: I'll check your latest PSD file and count the layers.
[The AI uses the Photoshop MCP server to:
1. Get information about open documents
2. If no document is open, it can browse and open a PSD file
3. Retrieve and analyze the layer structure]
Your document has 12 layers, including 3 group folders and 2 adjustment layers.User: Create a social media post with a gradient background and the text "Summer Sale" in a bold font.
AI Assistant: I'll create that social media post for you.
[The AI uses the Photoshop MCP server to:
1. Create a new document with appropriate dimensions for social media
2. Create a gradient fill layer with summer colors
3. Add a text layer with "Summer Sale" in a bold font
4. Position and style the text appropriately]
I've created your social media post with a gradient background and bold "Summer Sale" text.许可证
麻省理工学院
致谢
- photoshop python api -用于Photoshop的Python API
- 模型上下文协议 -MCP Python SDK
