@dynamic-mockups/mcp 1.1.2 → 1.2.0
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 +1 -0
- package/package.json +1 -1
- package/src/index.js +67 -8
package/README.md
CHANGED
|
@@ -71,6 +71,7 @@ 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
|
+
| `get_styles` | List visual styles available for MockAnything AI generation (optionally filtered by model) |
|
|
74
75
|
| `create_mockup` | Create a new AI mockup template from a prompt or image URL |
|
|
75
76
|
| `get_mockup_creation_status` | Poll the status of a mockup creation task |
|
|
76
77
|
| `create_render` | Create a single mockup render with design assets (1 credit) |
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -542,9 +542,10 @@ 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.
|
|
547
|
-
// 4.
|
|
545
|
+
// 2. (Optional, prompt flow only) Call get_styles to list visual styles for a model, then pass the style id in create_mockup
|
|
546
|
+
// 3. Call create_mockup with prompt or image_url -> returns task_id
|
|
547
|
+
// 4. Poll get_mockup_creation_status with task_id until state=SUCCESS -> returns mockup payload
|
|
548
|
+
// 5. Use mockup.uuid as mockup_uuid in create_render (works exactly like classic mockups)
|
|
548
549
|
//
|
|
549
550
|
// WHEN TO USE EACH TOOL:
|
|
550
551
|
// - get_api_info: First call when user asks about limits, pricing, or capabilities
|
|
@@ -554,6 +555,7 @@ function getApiKey(extra) {
|
|
|
554
555
|
// - get_mockups: PRIMARY tool - lists templates WITH smart_object UUIDs ready for rendering
|
|
555
556
|
// - get_mockup_by_uuid: Only when user needs ONE specific template (already has UUID)
|
|
556
557
|
// - search_products: Find a POD product UUID to ground MockAnything AI generations
|
|
558
|
+
// - get_styles: List visual styles available for a MockAnything AI model (e.g. polaroid-etsy, ugc, fashion)
|
|
557
559
|
// - create_mockup: Create a brand-new mockup on the fly via AI prompt or image URL
|
|
558
560
|
// - get_mockup_creation_status: Poll a MockAnything task until the mockup is ready for rendering
|
|
559
561
|
// - create_render: For generating 1 mockup image
|
|
@@ -829,6 +831,36 @@ RETURNS: Array of {name, uuid} POD product entries matching the query.`,
|
|
|
829
831
|
required: ["query"],
|
|
830
832
|
},
|
|
831
833
|
},
|
|
834
|
+
{
|
|
835
|
+
name: "get_styles",
|
|
836
|
+
description: `List visual styles that can be applied to a MockAnything AI generation (e.g. polaroid-etsy, ugc, fashion, urban).
|
|
837
|
+
|
|
838
|
+
API: GET /mock-anything/styles
|
|
839
|
+
|
|
840
|
+
WHEN TO USE: When user wants the AI output to land in a specific aesthetic (warm Polaroid, editorial flash, casual UGC, etc.) instead of the default photographic look. Call this BEFORE create_mockup to discover which styles are valid for the chosen model - not every model supports every style.
|
|
841
|
+
|
|
842
|
+
WORKFLOW:
|
|
843
|
+
1. Call this tool with the model you intend to pass to create_mockup
|
|
844
|
+
2. Read each style's description to pick the look you want
|
|
845
|
+
3. Pass the chosen style id as 'style' in create_mockup (along with the same model)
|
|
846
|
+
|
|
847
|
+
NOTES:
|
|
848
|
+
- Style only applies to the prompt flow (ignored for image_url).
|
|
849
|
+
- When style is provided to create_mockup, model is REQUIRED.
|
|
850
|
+
- Omit the model param here to list every known style across all models (broadest set).
|
|
851
|
+
|
|
852
|
+
RETURNS: Array of {id, description, available_with} style entries.`,
|
|
853
|
+
inputSchema: {
|
|
854
|
+
type: "object",
|
|
855
|
+
properties: {
|
|
856
|
+
model: {
|
|
857
|
+
type: "string",
|
|
858
|
+
enum: ["seedream_4_0", "seedream_4_5", "nano_banana_2"],
|
|
859
|
+
description: "Optional. Filter styles to those supported by this model. Omit to list every style across all models.",
|
|
860
|
+
},
|
|
861
|
+
},
|
|
862
|
+
},
|
|
863
|
+
},
|
|
832
864
|
{
|
|
833
865
|
name: "create_mockup",
|
|
834
866
|
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.
|
|
@@ -849,9 +881,10 @@ EXACTLY ONE of these must be provided:
|
|
|
849
881
|
|
|
850
882
|
WORKFLOW:
|
|
851
883
|
1. (Optional) Call search_products to find a product UUID for grounding the AI
|
|
852
|
-
2. Call
|
|
853
|
-
3.
|
|
854
|
-
4. Use the returned
|
|
884
|
+
2. (Optional, prompt flow only) Call get_styles to pick a visual style for a given model
|
|
885
|
+
3. Call this tool with prompt OR image_url
|
|
886
|
+
4. Use the returned task_id with get_mockup_creation_status, polling every ~2 seconds until state=SUCCESS
|
|
887
|
+
5. Use the returned mockup.uuid as mockup_uuid in create_render
|
|
855
888
|
|
|
856
889
|
MODELS (only apply to the prompt flow):
|
|
857
890
|
- seedream_4_0 (default, 5 credits, ~20s, medium quality) - quick iterations
|
|
@@ -859,7 +892,8 @@ MODELS (only apply to the prompt flow):
|
|
|
859
892
|
- nano_banana_2 (14 credits, ~30s, high quality) - production-ready final mockups
|
|
860
893
|
|
|
861
894
|
NOTES:
|
|
862
|
-
- product.uuid, model, and enhance_prompt only apply to the prompt flow (ignored otherwise).
|
|
895
|
+
- product.uuid, model, style, and enhance_prompt only apply to the prompt flow (ignored otherwise).
|
|
896
|
+
- style applies a visual aesthetic (e.g. polaroid-etsy, ugc, fashion). Discover valid values via get_styles. When style is set, model is REQUIRED — not every model supports every style.
|
|
863
897
|
- collections accepts existing collections (by uuid) or new ones (by name, find-or-create).
|
|
864
898
|
- Rate limit: 50 requests/minute on this endpoint.
|
|
865
899
|
- File uploads (multipart image_file) are not supported via MCP - host the image and pass image_url.
|
|
@@ -893,7 +927,11 @@ RETURNS: {task_id, status} - the task_id will also be the mockup.uuid once the t
|
|
|
893
927
|
model: {
|
|
894
928
|
type: "string",
|
|
895
929
|
enum: ["seedream_4_0", "seedream_4_5", "nano_banana_2"],
|
|
896
|
-
description: "Optional. AI model used for generation. Default: seedream_4_0. Only applies to the prompt flow.",
|
|
930
|
+
description: "Optional. AI model used for generation. Default: seedream_4_0. Only applies to the prompt flow. REQUIRED when style is provided.",
|
|
931
|
+
},
|
|
932
|
+
style: {
|
|
933
|
+
type: "string",
|
|
934
|
+
description: "Optional. Visual style applied to the AI generation (e.g. 'polaroid-etsy', 'ugc', 'fashion'). Discover valid ids via get_styles. Only applies to the prompt flow. When set, model is REQUIRED and must support this style (use get_styles?model=... to verify).",
|
|
897
935
|
},
|
|
898
936
|
name: {
|
|
899
937
|
type: "string",
|
|
@@ -1802,6 +1840,7 @@ async function handleCreateMockanythingMockup(args, extra) {
|
|
|
1802
1840
|
if (args.enhance_prompt !== undefined) payload.enhance_prompt = args.enhance_prompt;
|
|
1803
1841
|
if (args.product) payload.product = args.product;
|
|
1804
1842
|
if (args.model) payload.model = args.model;
|
|
1843
|
+
if (args.style) payload.style = args.style;
|
|
1805
1844
|
if (args.name) payload.name = args.name;
|
|
1806
1845
|
if (args.collections) payload.collections = args.collections;
|
|
1807
1846
|
if (args.catalog_uuid) payload.catalog_uuid = args.catalog_uuid;
|
|
@@ -1818,6 +1857,25 @@ async function handleCreateMockanythingMockup(args, extra) {
|
|
|
1818
1857
|
}
|
|
1819
1858
|
}
|
|
1820
1859
|
|
|
1860
|
+
async function handleGetMockanythingStyles(args, extra) {
|
|
1861
|
+
const apiKey = getApiKey(extra);
|
|
1862
|
+
const error = validateApiKey(apiKey);
|
|
1863
|
+
if (error) return error;
|
|
1864
|
+
|
|
1865
|
+
try {
|
|
1866
|
+
const params = new URLSearchParams();
|
|
1867
|
+
if (args && args.model) params.append("model", args.model);
|
|
1868
|
+
|
|
1869
|
+
const qs = params.toString();
|
|
1870
|
+
const url = qs ? `/mock-anything/styles?${qs}` : "/mock-anything/styles";
|
|
1871
|
+
|
|
1872
|
+
const response = await createApiClient(apiKey, "get_styles").get(url);
|
|
1873
|
+
return ResponseFormatter.fromApiResponse(response);
|
|
1874
|
+
} catch (err) {
|
|
1875
|
+
return ResponseFormatter.fromError(err, "Failed to fetch MockAnything styles");
|
|
1876
|
+
}
|
|
1877
|
+
}
|
|
1878
|
+
|
|
1821
1879
|
async function handleGetMockanythingStatus(args, extra) {
|
|
1822
1880
|
const apiKey = getApiKey(extra);
|
|
1823
1881
|
const error = validateApiKey(apiKey);
|
|
@@ -1851,6 +1909,7 @@ const toolHandlers = {
|
|
|
1851
1909
|
get_mockups: handleGetMockups,
|
|
1852
1910
|
get_mockup_by_uuid: handleGetMockupByUuid,
|
|
1853
1911
|
search_products: handleSearchMockanythingProducts,
|
|
1912
|
+
get_styles: handleGetMockanythingStyles,
|
|
1854
1913
|
create_mockup: handleCreateMockanythingMockup,
|
|
1855
1914
|
get_mockup_creation_status: handleGetMockanythingStatus,
|
|
1856
1915
|
create_render: handleCreateRender,
|