@dynamic-mockups/mcp 1.0.7 → 1.0.8
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 +18 -16
- package/package.json +1 -1
- package/src/index.js +70 -1
package/README.md
CHANGED
|
@@ -13,15 +13,15 @@ Add the following to your MCP client configuration file:
|
|
|
13
13
|
|
|
14
14
|
```json
|
|
15
15
|
{
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
16
|
+
"mcpServers": {
|
|
17
|
+
"dynamic-mockups": {
|
|
18
|
+
"command": "npx",
|
|
19
|
+
"args": ["-y", "@dynamic-mockups/mcp"],
|
|
20
|
+
"env": {
|
|
21
|
+
"DYNAMIC_MOCKUPS_API_KEY": "your_api_key_here"
|
|
23
22
|
}
|
|
24
|
-
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
25
|
}
|
|
26
26
|
```
|
|
27
27
|
|
|
@@ -37,15 +37,15 @@ If you want to connect via HTTP instead of NPX, use:
|
|
|
37
37
|
|
|
38
38
|
```json
|
|
39
39
|
{
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
40
|
+
"mcpServers": {
|
|
41
|
+
"dynamic-mockups": {
|
|
42
|
+
"type": "http",
|
|
43
|
+
"url": "https://mcp.dynamicmockups.com",
|
|
44
|
+
"headers": {
|
|
45
|
+
"x-api-key": "your_api_key_here"
|
|
47
46
|
}
|
|
48
|
-
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
49
|
}
|
|
50
50
|
```
|
|
51
51
|
|
|
@@ -75,6 +75,7 @@ If you want to connect via HTTP instead of NPX, use:
|
|
|
75
75
|
| `export_print_files` | Export high-resolution print files for production |
|
|
76
76
|
| `upload_psd` | Upload a PSD file and optionally create a mockup template |
|
|
77
77
|
| `delete_psd` | Delete a PSD file with optional related mockups deletion |
|
|
78
|
+
| `tool_create_embroidery_effect` | Transform any image into a realistic embroidery/stitched effect |
|
|
78
79
|
|
|
79
80
|
## Usage Examples
|
|
80
81
|
|
|
@@ -91,6 +92,7 @@ Ask your AI assistant:
|
|
|
91
92
|
| Upload PSD | "Upload my PSD mockup from url: https://example.com/my-mockup.psd and create a template from it" |
|
|
92
93
|
| API info | "What are the rate limits and supported file formats for Dynamic Mockups?" |
|
|
93
94
|
| Print files | "Export print-ready files at 300 DPI for my poster mockup" |
|
|
95
|
+
| Embroidery effect | "Transform my logo into an embroidery effect from url: https://example.com/my-logo.png" |
|
|
94
96
|
|
|
95
97
|
## Error Handling
|
|
96
98
|
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -553,6 +553,7 @@ function getApiKey(extra) {
|
|
|
553
553
|
// - upload_psd: When user wants to add their own PSD mockup template
|
|
554
554
|
// - delete_psd: When user wants to remove an uploaded PSD
|
|
555
555
|
// - create_collection: When user wants to organize mockups into groups
|
|
556
|
+
// - tool_create_embroidery_effect: When user wants to transform an image into embroidery/stitched effect
|
|
556
557
|
//
|
|
557
558
|
// =============================================================================
|
|
558
559
|
|
|
@@ -1234,7 +1235,7 @@ RETURNS: {uuid, name} of the uploaded PSD file.`,
|
|
|
1234
1235
|
|
|
1235
1236
|
API: POST /psd/delete
|
|
1236
1237
|
|
|
1237
|
-
WHEN TO USE: When user wants to:
|
|
1238
|
+
WHEN TO USE: When user wants to:
|
|
1238
1239
|
- Remove an uploaded PSD file
|
|
1239
1240
|
- Clean up unused PSD files
|
|
1240
1241
|
- Optionally remove all mockups derived from the PSD
|
|
@@ -1257,6 +1258,48 @@ RETURNS: Success confirmation message.`,
|
|
|
1257
1258
|
required: ["psd_uuid"],
|
|
1258
1259
|
},
|
|
1259
1260
|
},
|
|
1261
|
+
|
|
1262
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
1263
|
+
// EFFECT TOOLS
|
|
1264
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
1265
|
+
{
|
|
1266
|
+
name: "tool_create_embroidery_effect",
|
|
1267
|
+
description: `Transform any image into a realistic embroidery/stitched effect.
|
|
1268
|
+
|
|
1269
|
+
API: POST /tools/embroidery
|
|
1270
|
+
COST: 6 credits per request
|
|
1271
|
+
|
|
1272
|
+
WHEN TO USE: When user wants to:
|
|
1273
|
+
- Convert artwork/designs into embroidery style
|
|
1274
|
+
- Create stitched/embroidered versions of logos or images
|
|
1275
|
+
- Prepare designs for print-on-demand embroidery products
|
|
1276
|
+
- Transform existing artwork to look like embroidery before rendering on mockups
|
|
1277
|
+
|
|
1278
|
+
INPUT: Provide image via EITHER:
|
|
1279
|
+
- image_url: Public URL to the image (PNG, JPG, WEBP supported)
|
|
1280
|
+
- image_data_b64: Base64-encoded image data
|
|
1281
|
+
Only ONE input method is required per request.
|
|
1282
|
+
|
|
1283
|
+
TIPS FOR BEST RESULTS:
|
|
1284
|
+
- Use high-contrast images with clean edges
|
|
1285
|
+
- Simpler designs with fewer colors produce more realistic embroidery effects
|
|
1286
|
+
- The output can be used directly in mockup renders or saved to asset library
|
|
1287
|
+
|
|
1288
|
+
RETURNS: {export_path} - URL to the generated embroidery image (temporary, should be downloaded or saved to permanent storage).`,
|
|
1289
|
+
inputSchema: {
|
|
1290
|
+
type: "object",
|
|
1291
|
+
properties: {
|
|
1292
|
+
image_url: {
|
|
1293
|
+
type: "string",
|
|
1294
|
+
description: "Public URL to the image to transform. Supported formats: PNG, JPG, WEBP. Either image_url OR image_data_b64 must be provided.",
|
|
1295
|
+
},
|
|
1296
|
+
image_data_b64: {
|
|
1297
|
+
type: "string",
|
|
1298
|
+
description: "Base64-encoded image data. Either image_url OR image_data_b64 must be provided.",
|
|
1299
|
+
},
|
|
1300
|
+
},
|
|
1301
|
+
},
|
|
1302
|
+
},
|
|
1260
1303
|
];
|
|
1261
1304
|
|
|
1262
1305
|
// =============================================================================
|
|
@@ -1511,6 +1554,31 @@ async function handleDeletePsd(args, extra) {
|
|
|
1511
1554
|
}
|
|
1512
1555
|
}
|
|
1513
1556
|
|
|
1557
|
+
async function handleCreateEmbroideryEffect(args, extra) {
|
|
1558
|
+
const apiKey = getApiKey(extra);
|
|
1559
|
+
const error = validateApiKey(apiKey);
|
|
1560
|
+
if (error) return error;
|
|
1561
|
+
|
|
1562
|
+
// Validate that at least one input method is provided
|
|
1563
|
+
if (!args.image_url && !args.image_data_b64) {
|
|
1564
|
+
return ResponseFormatter.error(
|
|
1565
|
+
"Missing required input",
|
|
1566
|
+
{ solution: "Provide either image_url (public URL) or image_data_b64 (base64-encoded image data)." }
|
|
1567
|
+
);
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
try {
|
|
1571
|
+
const payload = {};
|
|
1572
|
+
if (args.image_url) payload.image_url = args.image_url;
|
|
1573
|
+
if (args.image_data_b64) payload.image_data_b64 = args.image_data_b64;
|
|
1574
|
+
|
|
1575
|
+
const response = await createApiClient(apiKey, "tool_create_embroidery_effect").post("/tools/embroidery", payload);
|
|
1576
|
+
return ResponseFormatter.fromApiResponse(response, "Embroidery effect created (6 credits used)");
|
|
1577
|
+
} catch (err) {
|
|
1578
|
+
return ResponseFormatter.fromError(err, "Failed to create embroidery effect");
|
|
1579
|
+
}
|
|
1580
|
+
}
|
|
1581
|
+
|
|
1514
1582
|
// =============================================================================
|
|
1515
1583
|
// Tool Router
|
|
1516
1584
|
// =============================================================================
|
|
@@ -1528,6 +1596,7 @@ const toolHandlers = {
|
|
|
1528
1596
|
export_print_files: handleExportPrintFiles,
|
|
1529
1597
|
upload_psd: handleUploadPsd,
|
|
1530
1598
|
delete_psd: handleDeletePsd,
|
|
1599
|
+
tool_create_embroidery_effect: handleCreateEmbroideryEffect,
|
|
1531
1600
|
};
|
|
1532
1601
|
|
|
1533
1602
|
// =============================================================================
|