尾Twig MCP(TailorKit MCP)是一款强大的电子商务产品定制框架,它借助模板管理、图层控制以及与Shopify的集成等功能,能够帮助商家打造交互式个性化购物体验,且无需大量开发工作即可提供可自定义的产品。
![]()
此MCP(模型上下文协议)服务器可将Claude和其他AI助手与TailorKit API连接起来,使它们能够管理可自定义产品的模板。通过TailorKit MCP,AI助手可以创建、获取和操作特定于电子商务平台的产品模板及其图层。
npm install tailor-mcp
下载并放置 index.js 文件到你的项目目录中。
本项目提供了多个工具函数,以下为部分工具函数的使用示例:
get_list_templates获取商店的模板列表:
// 假设以下为调用示例
const result = get_list_templates({
shopDomain: "your-shop.myshopify.com",
limit: 10,
page: 2,
sort: "updatedAt__desc",
filter: "some-filter"
});
get_detail_template获取特定模板的详细信息:
const result = get_detail_template({
_id: "template-id",
shopDomain: "your-shop.myshopify.com"
});
create_template为商店创建新模板:
const result = create_template({
shopDomain: "your-shop.myshopify.com",
name: "New Template Name",
dimensions: {
width: 100,
height: 200,
unit: "px",
resolution: 72
},
_id: "custom-template-id",
layers: [/* initial layer config */]
});
get_list_layers_of_template获取特定模板的所有图层:
const result = get_list_layers_of_template({
_id: "template-id",
shopDomain: "your-shop.myshopify.com"
});
在实际开发中,你可以根据业务需求对这些工具函数进行组合使用,以实现更复杂的功能。例如,先获取模板列表,然后根据列表中的模板ID获取特定模板的详细信息:
// 先获取模板列表
const templateList = get_list_templates({
shopDomain: "your-shop.myshopify.com"
});
// 遍历模板列表,获取每个模板的详细信息
templateList.forEach(template => {
const templateDetail = get_detail_template({
_id: template._id,
shopDomain: "your-shop.myshopify.com"
});
// 处理模板详细信息
console.log(templateDetail);
});
| 工具函数 | 功能 | 必填输入 | 可选输入 | 返回结果 |
|---|---|---|---|---|
get_list_templates |
获取商店的模板列表 | shopDomain(字符串,以“.myshopify.com”结尾的商店域名) |
limit(数字,默认值:5)、page(数字,默认值:1)、sort(字符串,默认值:“updatedAt__desc”)、filter(字符串) |
包含详细信息的模板列表 |
get_detail_template |
获取特定模板的详细信息 | _id(字符串,模板ID)、shopDomain(字符串,以“.myshopify.com”结尾的商店域名) |
无 | 包括图层和设置在内的详细模板信息 |
create_template |
为商店创建新模板 | shopDomain(字符串,以“.myshopify.com”结尾的商店域名)、name(字符串,默认值:“New Template”)、dimensions(对象,宽度、高度、度量单位和分辨率) |
_id(字符串,格式:uuid)、layers(数组,初始图层配置) |
确认创建成功的消息及模板ID |
get_list_layers_of_template |
获取特定模板的所有图层 | _id(字符串,模板ID)、shopDomain(字符串,以“.myshopify.com”结尾的商店域名) |
无 | 包含属性在内的所有图层列表 |
在你的 claude_desktop_config.json 中添加以下内容:
{
"mcpServers": {
"tailorkit-mcp": {
"command": "node",
"args": ["path/to/your/dist/index.js"],
"env": {
"HOST": "https://your-api-host.com",
"ACCESS_TOKEN": "your-access-token"
}
}
}
}
HOST:API服务的URLACCESS_TOKEN:用于身份验证的安全令牌要生成访问令牌,请访问 TailorKit 的安全设置。
git clone git@github.com:shopify/tailor-mcp.gitnpm installnpm start通过以上步骤,你可以在本地进行开发和调试,对项目进行扩展和改进。