一个全面的 模型上下文协议(MCP)服务器,用于 Adobe InDesign 自动化,拥有 35 多种专业工具。此服务器使像 Claude 这样的AI助手能够直接控制 Adobe InDesign,自动化复杂的出版工作流程、文档创建和专业布局任务。
git clone https://github.com/lucdesign/indesign-mcp-server.git
cd indesign-mcp-server
npm install
在您的MCP客户端配置中添加服务器(例如Claude Desktop):
claude_desktop_config.json:
{
"mcpServers": {
"indesign": {
"command": "node",
"args": ["/path/to/indesign-mcp-server/index.js"],
"env": {}
}
}
}
确保在使用MCP服务器之前启动Adobe InDesign。
// 创建一个带有双面页的A4文档
create_document({
preset: "A4",
orientation: "Portrait",
pages: 4,
facingPages: true,
marginTop: 20,
marginBottom: 20,
marginLeft: 20,
marginRight: 20
})
// 创建一个具有专业排版的文本框
create_text_frame({
content: "使用InDesign MCP进行专业出版",
x: 20,
y: 20,
width: 170,
height: 50,
fontSize: 18,
fontFamily: "Helvetica Neue",
fontStyle: "Bold",
alignment: "LEFT_ALIGN"
})
// 创建字符样式
create_character_style({
name: "Emphasis",
fontFamily: "Helvetica Neue",
fontStyle: "Italic",
textColor: "Red"
})
// 应用到特定文本
find_replace_text({
findText: "重要",
replaceText: "重要",
applyCharacterStyle: "Emphasis"
})
export_pdf({
filePath: "/path/to/output.pdf",
preset: "HighQualityPrint",
includeBleed: true,
colorProfile: "ISO Coated v2"
})
get_document_info - 文档信息和统计create_document - 高级文档创建open_document - 打开现有文档save_document - 保存,可选新路径close_document - 关闭,带保存选项add_page - 添加页面,带位置控制delete_page - 安全删除页面duplicate_page - 复制页面及其内容navigate_to_page - 页面导航create_text_frame - 高级文本框创建edit_text_frame - 修改现有框架find_replace_text - 搜索和替换,支持GREPplace_image - 图像放置,带适配选项create_rectangle - 创建矩形,带样式create_ellipse - 创建椭圆,带样式create_paragraph_style - 段落样式创建create_character_style - 字符样式创建apply_paragraph_style - 将样式应用于文本list_styles - 列出所有可用样式create_color_swatch - 创建CMYK/RGB/专色list_color_swatches - 列出可用颜色apply_color - 将颜色应用于对象create_table - 创建表格,带表头/表脚populate_table - 填充表格数据create_layer - 创建新层set_active_layer - 切换活动层list_layers - 列出所有层export_pdf - 专业PDF导出export_images - 多格式图像导出export_epub - 数字出版导出package_document - 打印生产打包execute_indesign_code - 自定义ExtendScript执行preflight_document - 质量检查view_document - 文档可视化data_merge - 自动数据整合execute_indesign_code({
code: `
// 自定义InDesign脚本
var doc = app.activeDocument;
// 您的自定义自动化逻辑在此处
`
})
// 处理多个文件
const files = ["doc1.indd", "doc2.indd", "doc3.indd"];
for (const file of files) {
await open_document({ filePath: file });
await export_pdf({
filePath: file.replace('.indd', '.pdf'),
preset: 'HighQualityPrint'
});
await close_document({ save: false });
}
“未找到Adobe InDesign”
“脚本执行失败”
“未找到工具”
node index.jsnode --inspect index.js
git checkout -b feature/AmazingFeature)git commit -m '添加一些AmazingFeature')git push origin feature/AmazingFeature)本项目采用 MIT 许可证 - 查看LICENSE文件了解详情。
为出版界制作的❤️
通过AI自动化改进您的InDesign工作流程