@dynamic-mockups/mcp 1.1.0 → 1.1.2
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 +2 -2
- package/package.json +1 -1
- package/src/index.js +20 -18
package/README.md
CHANGED
|
@@ -71,8 +71,8 @@ If you want to connect via HTTP instead of NPX, use:
|
|
|
71
71
|
| `get_mockups` | Get list of available mockups with optional filters |
|
|
72
72
|
| `get_mockup_by_uuid` | Retrieve a specific mockup by UUID |
|
|
73
73
|
| `search_products` | Search the POD product catalog used to ground MockAnything AI generations |
|
|
74
|
-
| `
|
|
75
|
-
| `
|
|
74
|
+
| `create_mockup` | Create a new AI mockup template from a prompt or image URL |
|
|
75
|
+
| `get_mockup_creation_status` | Poll the status of a mockup creation task |
|
|
76
76
|
| `create_render` | Create a single mockup render with design assets (1 credit) |
|
|
77
77
|
| `create_batch_render` | Render multiple mockups in one request (1 credit per image) |
|
|
78
78
|
| `export_print_files` | Export high-resolution print files for production |
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -542,8 +542,8 @@ function getApiKey(extra) {
|
|
|
542
542
|
//
|
|
543
543
|
// WORKFLOW FOR CREATING NEW MOCKUPS WITH AI (MockAnything):
|
|
544
544
|
// 1. (Optional) Call search_products to find a POD product UUID for grounding
|
|
545
|
-
// 2. Call
|
|
546
|
-
// 3. Poll
|
|
545
|
+
// 2. Call create_mockup with prompt or image_url -> returns task_id
|
|
546
|
+
// 3. Poll get_mockup_creation_status with task_id until state=SUCCESS -> returns mockup payload
|
|
547
547
|
// 4. Use mockup.uuid as mockup_uuid in create_render (works exactly like classic mockups)
|
|
548
548
|
//
|
|
549
549
|
// WHEN TO USE EACH TOOL:
|
|
@@ -554,8 +554,8 @@ function getApiKey(extra) {
|
|
|
554
554
|
// - get_mockups: PRIMARY tool - lists templates WITH smart_object UUIDs ready for rendering
|
|
555
555
|
// - get_mockup_by_uuid: Only when user needs ONE specific template (already has UUID)
|
|
556
556
|
// - search_products: Find a POD product UUID to ground MockAnything AI generations
|
|
557
|
-
// -
|
|
558
|
-
// -
|
|
557
|
+
// - create_mockup: Create a brand-new mockup on the fly via AI prompt or image URL
|
|
558
|
+
// - get_mockup_creation_status: Poll a MockAnything task until the mockup is ready for rendering
|
|
559
559
|
// - create_render: For generating 1 mockup image
|
|
560
560
|
// - create_batch_render: For generating 2+ mockup images (more efficient)
|
|
561
561
|
// - export_print_files: When user needs production-ready files with specific DPI
|
|
@@ -813,7 +813,7 @@ WHEN TO USE: When user wants to anchor an AI-generated mockup around a specific
|
|
|
813
813
|
WORKFLOW:
|
|
814
814
|
1. Call this tool with a search term (matched against POD product names)
|
|
815
815
|
2. Pick the desired product from the response
|
|
816
|
-
3. Pass its uuid as product.uuid when calling
|
|
816
|
+
3. Pass its uuid as product.uuid when calling create_mockup
|
|
817
817
|
|
|
818
818
|
NOTE: Grounding is OPTIONAL. Skip this tool if you want the AI to compose freely from the prompt alone.
|
|
819
819
|
|
|
@@ -830,7 +830,7 @@ RETURNS: Array of {name, uuid} POD product entries matching the query.`,
|
|
|
830
830
|
},
|
|
831
831
|
},
|
|
832
832
|
{
|
|
833
|
-
name: "
|
|
833
|
+
name: "create_mockup",
|
|
834
834
|
description: `Create a new MockAnything AI mockup template on the fly. The resulting mockup behaves exactly like one returned by get_mockups - pass its uuid to create_render to print artwork on it.
|
|
835
835
|
|
|
836
836
|
API: POST /mock-anything/create
|
|
@@ -850,7 +850,7 @@ EXACTLY ONE of these must be provided:
|
|
|
850
850
|
WORKFLOW:
|
|
851
851
|
1. (Optional) Call search_products to find a product UUID for grounding the AI
|
|
852
852
|
2. Call this tool with prompt OR image_url
|
|
853
|
-
3. Use the returned task_id with
|
|
853
|
+
3. Use the returned task_id with get_mockup_creation_status, polling every ~2 seconds until state=SUCCESS
|
|
854
854
|
4. Use the returned mockup.uuid as mockup_uuid in create_render
|
|
855
855
|
|
|
856
856
|
MODELS (only apply to the prompt flow):
|
|
@@ -924,12 +924,12 @@ RETURNS: {task_id, status} - the task_id will also be the mockup.uuid once the t
|
|
|
924
924
|
},
|
|
925
925
|
},
|
|
926
926
|
{
|
|
927
|
-
name: "
|
|
927
|
+
name: "get_mockup_creation_status",
|
|
928
928
|
description: `Poll the status of a MockAnything AI mockup creation task.
|
|
929
929
|
|
|
930
930
|
API: GET /mock-anything/status/{taskId}
|
|
931
931
|
|
|
932
|
-
WHEN TO USE: After calling
|
|
932
|
+
WHEN TO USE: After calling create_mockup, use this to track progress until the mockup is ready for rendering.
|
|
933
933
|
|
|
934
934
|
POLLING STRATEGY:
|
|
935
935
|
- Poll every ~2 seconds (recommended)
|
|
@@ -953,7 +953,7 @@ RETURNS: {task_id, state, image_url, status, mockup}.`,
|
|
|
953
953
|
properties: {
|
|
954
954
|
task_id: {
|
|
955
955
|
type: "string",
|
|
956
|
-
description: "REQUIRED. The task_id returned from
|
|
956
|
+
description: "REQUIRED. The task_id returned from create_mockup.",
|
|
957
957
|
},
|
|
958
958
|
},
|
|
959
959
|
required: ["task_id"],
|
|
@@ -1149,7 +1149,7 @@ Use cases:
|
|
|
1149
1149
|
|
|
1150
1150
|
PREREQUISITES: Call get_mockups first - it returns both mockup_uuid AND smart_object uuids for all templates.
|
|
1151
1151
|
|
|
1152
|
-
RETURNS: {total_renders, successful_renders, failed_renders, renders[]} where each render has {status, export_path, export_label, mockup_uuid}.`,
|
|
1152
|
+
RETURNS: {total_renders, successful_renders, failed_renders, renders[]} where each render has {status, export_path, export_label, mockup_uuid, mockup_type}.`,
|
|
1153
1153
|
inputSchema: {
|
|
1154
1154
|
type: "object",
|
|
1155
1155
|
properties: {
|
|
@@ -1644,6 +1644,7 @@ async function handleCreateRender(args, extra) {
|
|
|
1644
1644
|
if (args.text_layers) payload.text_layers = args.text_layers;
|
|
1645
1645
|
|
|
1646
1646
|
const response = await createApiClient(apiKey, "create_render").post("/renders", payload);
|
|
1647
|
+
if (response.data?.data) response.data = response.data.data;
|
|
1647
1648
|
return ResponseFormatter.fromApiResponse(response, "Render created (1 credit used)");
|
|
1648
1649
|
} catch (err) {
|
|
1649
1650
|
return ResponseFormatter.fromError(err, "Failed to create render");
|
|
@@ -1660,6 +1661,7 @@ async function handleCreateBatchRender(args, extra) {
|
|
|
1660
1661
|
if (args.export_options) payload.export_options = args.export_options;
|
|
1661
1662
|
|
|
1662
1663
|
const response = await createApiClient(apiKey, "create_batch_render").post("/renders/batch", payload);
|
|
1664
|
+
if (response.data?.data) response.data = response.data.data;
|
|
1663
1665
|
const count = args.renders?.length || 0;
|
|
1664
1666
|
return ResponseFormatter.fromApiResponse(response, `Batch render complete (${count} credits used)`);
|
|
1665
1667
|
} catch (err) {
|
|
@@ -1804,11 +1806,11 @@ async function handleCreateMockanythingMockup(args, extra) {
|
|
|
1804
1806
|
if (args.collections) payload.collections = args.collections;
|
|
1805
1807
|
if (args.catalog_uuid) payload.catalog_uuid = args.catalog_uuid;
|
|
1806
1808
|
|
|
1807
|
-
const response = await createApiClient(apiKey, "
|
|
1809
|
+
const response = await createApiClient(apiKey, "create_mockup").post("/mock-anything/create", payload);
|
|
1808
1810
|
|
|
1809
1811
|
const successMessage = hasPrompt
|
|
1810
|
-
? "MockAnything AI generation started. Poll
|
|
1811
|
-
: "MockAnything mockup creation started from image_url. Poll
|
|
1812
|
+
? "MockAnything AI generation started. Poll get_mockup_creation_status with the returned task_id (every ~2s) until state=SUCCESS, then use mockup.uuid in create_render."
|
|
1813
|
+
: "MockAnything mockup creation started from image_url. Poll get_mockup_creation_status with the returned task_id - it usually completes on the first call.";
|
|
1812
1814
|
|
|
1813
1815
|
return ResponseFormatter.fromApiResponse(response, successMessage);
|
|
1814
1816
|
} catch (err) {
|
|
@@ -1824,12 +1826,12 @@ async function handleGetMockanythingStatus(args, extra) {
|
|
|
1824
1826
|
if (!args.task_id) {
|
|
1825
1827
|
return ResponseFormatter.error(
|
|
1826
1828
|
"Missing required parameter",
|
|
1827
|
-
{ solution: "Provide the task_id returned from
|
|
1829
|
+
{ solution: "Provide the task_id returned from create_mockup." }
|
|
1828
1830
|
);
|
|
1829
1831
|
}
|
|
1830
1832
|
|
|
1831
1833
|
try {
|
|
1832
|
-
const response = await createApiClient(apiKey, "
|
|
1834
|
+
const response = await createApiClient(apiKey, "get_mockup_creation_status").get(`/mock-anything/status/${args.task_id}`);
|
|
1833
1835
|
return ResponseFormatter.fromApiResponse(response);
|
|
1834
1836
|
} catch (err) {
|
|
1835
1837
|
return ResponseFormatter.fromError(err, "Failed to get MockAnything mockup status");
|
|
@@ -1849,8 +1851,8 @@ const toolHandlers = {
|
|
|
1849
1851
|
get_mockups: handleGetMockups,
|
|
1850
1852
|
get_mockup_by_uuid: handleGetMockupByUuid,
|
|
1851
1853
|
search_products: handleSearchMockanythingProducts,
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
+
create_mockup: handleCreateMockanythingMockup,
|
|
1855
|
+
get_mockup_creation_status: handleGetMockanythingStatus,
|
|
1854
1856
|
create_render: handleCreateRender,
|
|
1855
1857
|
create_batch_render: handleCreateBatchRender,
|
|
1856
1858
|
export_print_files: handleExportPrintFiles,
|