@dynamic-mockups/mcp 1.1.0 → 1.1.1
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 +17 -17
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"],
|
|
@@ -1804,11 +1804,11 @@ async function handleCreateMockanythingMockup(args, extra) {
|
|
|
1804
1804
|
if (args.collections) payload.collections = args.collections;
|
|
1805
1805
|
if (args.catalog_uuid) payload.catalog_uuid = args.catalog_uuid;
|
|
1806
1806
|
|
|
1807
|
-
const response = await createApiClient(apiKey, "
|
|
1807
|
+
const response = await createApiClient(apiKey, "create_mockup").post("/mock-anything/create", payload);
|
|
1808
1808
|
|
|
1809
1809
|
const successMessage = hasPrompt
|
|
1810
|
-
? "MockAnything AI generation started. Poll
|
|
1811
|
-
: "MockAnything mockup creation started from image_url. Poll
|
|
1810
|
+
? "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."
|
|
1811
|
+
: "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
1812
|
|
|
1813
1813
|
return ResponseFormatter.fromApiResponse(response, successMessage);
|
|
1814
1814
|
} catch (err) {
|
|
@@ -1824,12 +1824,12 @@ async function handleGetMockanythingStatus(args, extra) {
|
|
|
1824
1824
|
if (!args.task_id) {
|
|
1825
1825
|
return ResponseFormatter.error(
|
|
1826
1826
|
"Missing required parameter",
|
|
1827
|
-
{ solution: "Provide the task_id returned from
|
|
1827
|
+
{ solution: "Provide the task_id returned from create_mockup." }
|
|
1828
1828
|
);
|
|
1829
1829
|
}
|
|
1830
1830
|
|
|
1831
1831
|
try {
|
|
1832
|
-
const response = await createApiClient(apiKey, "
|
|
1832
|
+
const response = await createApiClient(apiKey, "get_mockup_creation_status").get(`/mock-anything/status/${args.task_id}`);
|
|
1833
1833
|
return ResponseFormatter.fromApiResponse(response);
|
|
1834
1834
|
} catch (err) {
|
|
1835
1835
|
return ResponseFormatter.fromError(err, "Failed to get MockAnything mockup status");
|
|
@@ -1849,8 +1849,8 @@ const toolHandlers = {
|
|
|
1849
1849
|
get_mockups: handleGetMockups,
|
|
1850
1850
|
get_mockup_by_uuid: handleGetMockupByUuid,
|
|
1851
1851
|
search_products: handleSearchMockanythingProducts,
|
|
1852
|
-
|
|
1853
|
-
|
|
1852
|
+
create_mockup: handleCreateMockanythingMockup,
|
|
1853
|
+
get_mockup_creation_status: handleGetMockanythingStatus,
|
|
1854
1854
|
create_render: handleCreateRender,
|
|
1855
1855
|
create_batch_render: handleCreateBatchRender,
|
|
1856
1856
|
export_print_files: handleExportPrintFiles,
|