@sudomock/mcp 2.7.1 → 3.0.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 CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  > Generate photorealistic product mockups from Claude, Cursor, Windsurf, and VS Code.
4
4
 
5
- [Model Context Protocol](https://modelcontextprotocol.io/introduction) server for the [SudoMock](https://sudomock.com) mockup generation API. Upload PSD templates, place artwork onto smart objects, edit supported text layers, and get rendered image URLs -- all through natural language.
5
+ [Model Context Protocol](https://modelcontextprotocol.io/introduction) server for the [SudoMock](https://sudomock.com) mockup generation API. Upload PSD templates, place artwork onto smart objects, edit supported text layers, turn a product photo into a reusable photo mockup, and get rendered image URLs -- all through natural language.
6
6
 
7
7
  ## Quick Start
8
8
 
@@ -36,33 +36,38 @@ Get your API key at [sudomock.com/dashboard/api-keys](https://sudomock.com/dashb
36
36
 
37
37
  </details>
38
38
 
39
- > **Note:** A hosted remote (HTTP/OAuth) transport is not available yet. This
40
- > package only ships the local stdio server shown above.
39
+ > **Note:** This package ships the local stdio server shown above. The hosted
40
+ > remote transport (OAuth, `https://mcp.sudomock.com`) is documented at
41
+ > [sudomock.com/docs/mcp](https://sudomock.com/docs/mcp). From 3.0 of this
42
+ > package and 2.0 of the hosted server the two transports use the same tool
43
+ > names.
41
44
 
42
45
  ## Tools
43
46
 
47
+ Tools are named after the mockup family they act on: **PSD mockups** are
48
+ uploaded Photoshop templates, **photo mockups** are made from a product photo.
49
+
44
50
  | Tool | Description | Credits |
45
51
  |------|-------------|---------|
46
- | `list_mockups` | List your uploaded mockup templates | 0 |
47
- | `get_mockup_details` | Get smart object UUIDs, dimensions, blend modes | 0 |
48
- | `render_mockup` | Render a mockup with artwork and/or editable text | 1 |
49
- | `remove_background` | Get a transparent-PNG cutout through a 7-day signed URL | 25 |
50
- | `create_2d_mockup` | Create a 2D mockup and detect printable surfaces automatically | 25 |
51
- | `render_2d_surface` | Print artwork across a whole product surface (all-over) | 5 |
52
- | `render_2d_print_area` | Print artwork into one saved print area (a drawn zone) | 5 |
53
- | `render_video` | Animate a mockup into a video clip (always async) | cost-based (one per account at no charge, then cost-based) |
54
52
  | `upload_psd` | Upload a Photoshop PSD/PSB template (sync or async) | 0 |
55
- | `list_2d_mockups` | List saved 2D templates; use `customizable_only` for shopper-ready items | 0 |
56
- | `get_2d_mockup` | Get one 2D mockup's saved print areas and its product surfaces | 0 |
57
- | `update_2d_print_areas` | Replace a 2D mockup's print-area geometry | 0 |
58
- | `delete_2d_mockup` | Delete a 2D mockup template | 0 |
53
+ | `list_psd_mockups` | List your uploaded PSD mockup templates | 0 |
54
+ | `get_psd_mockup` | Get smart object UUIDs, editable text layers, dimensions, blend modes | 0 |
55
+ | `update_psd_mockup` | Rename a PSD mockup template | 0 |
56
+ | `delete_psd_mockup` | Delete a PSD mockup template | 0 |
57
+ | `render_psd_mockup` | Render a PSD mockup with artwork and/or editable text | 1 |
58
+ | `create_photo_mockup` | Create a photo mockup from a product photo and detect printable surfaces automatically | 25 |
59
+ | `list_photo_mockups` | List saved photo mockups; use `customizable_only` for shopper-ready items | 0 |
60
+ | `get_photo_mockup` | Get one photo mockup's saved print areas and its product surfaces | 0 |
61
+ | `update_photo_mockup_print_areas` | Replace a photo mockup's print-area geometry | 0 |
62
+ | `delete_photo_mockup` | Delete a photo mockup | 0 |
63
+ | `render_photo_mockup` | Print artwork into one saved print area, or across a whole product surface | 5 |
64
+ | `remove_background` | Get a transparent-PNG cutout through a 7-day signed URL | 25 |
65
+ | `render_video` | Animate a PSD mockup into a video clip (always async) | cost-based (one per account at no charge, then cost-based) |
59
66
  | `get_job` | Check the status of an async job by job_id | 0 |
60
- | `wait_for_job` | Poll an async job until it succeeds or fails | 0 |
61
- | `list_jobs` | List async render, video, upload, and 2D jobs | 0 |
67
+ | `wait_for_job` | Poll an async job until it succeeds, fails, or is cancelled | 0 |
68
+ | `list_jobs` | List async render, video, upload, and photo mockup jobs | 0 |
62
69
  | `get_account` | Check plan, credits, prepaid balance, and usage | 0 |
63
- | `update_mockup` | Rename a mockup template | 0 |
64
- | `delete_mockup` | Delete a mockup template | 0 |
65
- | `create_webhook_endpoint` | Register a webhook for async job completion | 0 |
70
+ | `create_webhook_endpoint` | Register a webhook for async job completion, pinned to an event naming | 0 |
66
71
  | `list_webhook_endpoints` | List your webhook endpoints | 0 |
67
72
  | `update_webhook_endpoint` | Edit or enable/disable a webhook endpoint | 0 |
68
73
  | `delete_webhook_endpoint` | Delete a webhook endpoint | 0 |
@@ -71,25 +76,49 @@ Get your API key at [sudomock.com/dashboard/api-keys](https://sudomock.com/dashb
71
76
  | `list_webhook_deliveries` | List delivery attempts for an endpoint | 0 |
72
77
  | `replay_webhook_delivery` | Replay a single failed delivery | 0 |
73
78
 
79
+ ### Renamed in 3.0
80
+
81
+ 3.0 names every mockup tool after its family and keeps no alias for the old
82
+ name, so a client written against 2.x fails at "tool not found" rather than
83
+ being redirected to a tool whose arguments have changed.
84
+
85
+ | 2.x | 3.0 |
86
+ |-----|-----|
87
+ | `list_mockups` | `list_psd_mockups` |
88
+ | `get_mockup_details` | `get_psd_mockup` |
89
+ | `update_mockup` | `update_psd_mockup` |
90
+ | `delete_mockup` | `delete_psd_mockup` |
91
+ | `render_mockup` | `render_psd_mockup` |
92
+ | `create_2d_mockup` | `create_photo_mockup` |
93
+ | `list_2d_mockups` | `list_photo_mockups` |
94
+ | `get_2d_mockup` | `get_photo_mockup` |
95
+ | `update_2d_print_areas` | `update_photo_mockup_print_areas` |
96
+ | `delete_2d_mockup` | `delete_photo_mockup` |
97
+ | `render_2d_surface`, `render_2d_print_area` | `render_photo_mockup` |
98
+
99
+ Photo mockup tools take `mockup_id`, the field `list_photo_mockups` and
100
+ `create_photo_mockup` return. PSD mockup tools keep `mockup_uuid`.
101
+
74
102
  ### Async jobs
75
103
 
76
- `render_mockup`, `upload_psd`, `create_2d_mockup`, and both 2D render tools
77
- accept `is_async: true`, and `render_video` is always async. These return a
78
- `job_id` immediately (HTTP 202) instead of a final result. (`create_2d_mockup`
79
- and the 2D render tools are synchronous by default and return the mockup /
80
- render directly.) Poll it with `get_job`, or let `wait_for_job` block until the job
81
- reaches a terminal status and hands back `result_url`, `mockup_uuid`,
82
- `credits_charged`, and `payg` (`{credits, unit_price, cost}` for pay-as-you-go
83
- jobs, otherwise `null`).
84
-
85
- For a 2D render, pick the tool that matches the target you read from
86
- `get_2d_mockup`. Every printable product in the photo is a surface with its own
87
- `surface_uuid`: `render_2d_surface` prints across the whole of one, and takes
88
- either a `coverage` percentage or an explicit `width` + `height`. A print area
89
- is a bounded zone somebody drew on a product, such as a chest logo:
90
- `render_2d_print_area` takes its `print_area_uuid`, and either a `fit` or an
91
- explicit `width` + `height`. A product can have both, and they are separate
92
- targets -- a saved print area does not close off the surface it sits on.
104
+ `render_psd_mockup`, `upload_psd`, `create_photo_mockup`, and
105
+ `render_photo_mockup` accept `is_async: true`, and `render_video` is always
106
+ async. These return a `job_id` immediately (HTTP 202) instead of a final
107
+ result. (`create_photo_mockup` and `render_photo_mockup` are synchronous by
108
+ default and return the mockup / render directly.) Poll it with `get_job`, or
109
+ let `wait_for_job` block until the job reaches a terminal status and hands back
110
+ `result_url`, `mockup_uuid`, `credits_charged`, and `payg`
111
+ (`{credits, unit_price, cost}` for pay-as-you-go jobs, otherwise `null`).
112
+
113
+ A photo mockup render names exactly one target, read from `get_photo_mockup`.
114
+ Every printable product in the photo is a surface with its own `surface_uuid`:
115
+ pass it to print across the whole of one, with either a `coverage` percentage
116
+ or an explicit `width` + `height`. A print area is a bounded zone somebody drew
117
+ on a product, such as a chest logo: pass its `print_area_uuid`, with either a
118
+ `fit` or an explicit `width` + `height`. A product can have both, and they are
119
+ separate targets -- a saved print area does not close off the surface it sits
120
+ on. The dial of the other kind of target (`fit` on a surface, `coverage` on a
121
+ print area) is refused by name rather than dropped.
93
122
 
94
123
  Sizing has one answer per render: send the relative option or the exact box,
95
124
  never both, and send `width` and `height` together. `position`, `offset_x`,
@@ -102,8 +131,8 @@ applies rather than a copy of it kept here.
102
131
  `remove_background` returns a transparent-PNG URL valid for 7 days. You can
103
132
  pass that URL straight back as `artwork_url` during that window. To clean
104
133
  artwork inline during a single render instead, pass
105
- `remove_background: true` to `render_mockup` or either 2D render tool. Either way it
106
- costs 25 credits per artwork, refunded automatically if processing fails.
134
+ `remove_background: true` to `render_psd_mockup` or `render_photo_mockup`. Either
135
+ way it costs 25 credits per artwork, refunded automatically if processing fails.
107
136
 
108
137
  ### Webhooks
109
138
 
@@ -114,20 +143,32 @@ creation/rotation) and `X-SudoMock-Timestamp` (unix seconds). Verify in constant
114
143
  time and reject if `|now - timestamp| > 300s`.
115
144
 
116
145
  Render, upload, and video job deliveries use
117
- `{event, job_id, kind, status, result_url, error, created_at}`. The typed 2D
118
- creation events add `version`, `mockup_id`, `name`, and either `print_areas`
119
- (`ready`) or `reason` (`rejected`). The typed 2D render events carry
120
- `mockup_id`, `result_url`, a public `{error_code, message}` failure when
121
- applicable, and optional `export_format` / `duration_ms`. Event types:
146
+ `{event, job_id, kind, status, result_url, error, created_at}`. The typed photo
147
+ mockup creation events add `version`, `mockup_id`, `name`, and either
148
+ `print_areas` (`ready`) or `reason` (`rejected`). The typed photo mockup render
149
+ events carry `mockup_id`, `result_url`, a public `{error_code, message}` failure
150
+ when applicable, and optional `export_format` / `duration_ms`. Event types:
122
151
  `render.succeeded`, `render.failed`, `upload.succeeded`, `video.succeeded`,
123
- `video.failed`, `2d_mockup.ready`, `2d_mockup.rejected`, `2d_mockup.failed`,
124
- `2d_render.succeeded`, `2d_render.failed`, `webhook.test`.
152
+ `video.failed`, `photo_mockup.ready`, `photo_mockup.rejected`,
153
+ `photo_mockup.failed`, `photo_mockup_render.succeeded`,
154
+ `photo_mockup_render.failed`, `webhook.test`.
155
+
156
+ The five photo mockup events also have a legacy spelling: `2d_mockup.ready`,
157
+ `2d_mockup.rejected`, `2d_mockup.failed`, `2d_render.succeeded`,
158
+ `2d_render.failed` (with `kind` `2d_create` / `2d_render` in the payload).
159
+ Which spelling an endpoint receives is its `event_naming` pin, set at
160
+ `create_webhook_endpoint` and returned on every endpoint: `current` (the names
161
+ above, the default for new endpoints) or `legacy`. Endpoints registered before
162
+ the pin existed stay on `legacy`, so a receiver written against the old names
163
+ keeps working unchanged. Once that receiver handles the new names, move it with
164
+ `update_webhook_endpoint` and `event_naming: "current"`; sent on its own, the
165
+ re-pin re-spells the endpoint's stored subscription list to match.
125
166
 
126
167
  ### Logs
127
168
 
128
169
  Each tool call writes one JSON line to stderr, which your MCP host keeps in its
129
170
  log file: the tool name, how long the call took, and whether it succeeded, for
130
- example `{"event":"mcp_tool_call","tool":"list_mockups","duration_ms":312,"ok":true}`.
171
+ example `{"event":"mcp_tool_call","tool":"list_psd_mockups","duration_ms":312,"ok":true}`.
131
172
  Arguments, API keys, file contents and API responses are never logged. Every
132
173
  API request identifies this package as `mcp-stdio/<version>` in its
133
174
  `User-Agent` and `X-SudoMock-Client` headers.
@@ -135,7 +176,7 @@ API request identifies this package as `mcp-stdio/<version>` in its
135
176
  ## Pricing and account limits
136
177
 
137
178
  Pay as you go is the entry tier, and it has no subscription. One PSD render costs
138
- **$0.10**, so $1 covers 10 of them. The minimum first payment is **$5**. 2D Mockups
179
+ **$0.10**, so $1 covers 10 of them. The minimum first payment is **$5**. Photo mockups
139
180
  and video are priced by what they cost to produce rather than at the flat render
140
181
  rate, which is why the Credits column above is not uniform.
141
182
 
@@ -164,13 +205,14 @@ as `0 / 0`.
164
205
 
165
206
  ## Example requests
166
207
 
167
- - "List my mockup templates"
208
+ - "List my PSD mockup templates"
168
209
  - "Render the t-shirt mockup with this design: https://example.com/logo.png"
169
210
  - "Replace the editable headline text, then render the mockup"
170
211
  - "Cut out the background from this product photo, then render it on the tote bag"
171
- - "List my 2D mockups, then render the first one with this artwork: https://example.com/logo.png"
212
+ - "Turn this product photo into a mockup: https://example.com/tote.jpg"
213
+ - "List my photo mockups, then render the first one with this artwork: https://example.com/logo.png"
172
214
  - "Render this design asynchronously and wait for it to finish"
173
- - "Queue that 2D mockup render async and give me the job id to track"
215
+ - "Queue that photo mockup render async and give me the job id to track"
174
216
  - "Animate the hoodie mockup into a 5-second video clip"
175
217
  - "Upload this PSD as a new template: https://example.com/mockup.psd"
176
218
  - "Set up a webhook at https://example.com/hooks so I get notified when renders finish"
package/dist/index.d.ts CHANGED
@@ -3,7 +3,8 @@
3
3
  * SudoMock MCP Server
4
4
  *
5
5
  * Local stdio MCP server for Claude Desktop, Claude Code, Cursor, and VS Code.
6
- * Renders photorealistic product mockups from Photoshop PSD templates via the SudoMock API.
6
+ * Renders photorealistic product mockups from Photoshop PSD templates and
7
+ * product photos via the SudoMock API.
7
8
  *
8
9
  * Auth: SUDOMOCK_API_KEY environment variable
9
10
  * Transport: stdio (local process)
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;GAQG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAiLpE;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAgBzD;AAED,eAAO,MAAM,qBAAqB,aAAmC,CAAC;AAkdtE;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAGnE;AAmFD,QAAA,MAAM,MAAM,WAGV,CAAC;AAw3CH,QAAA,MAAM,YAAY;;;;;;;;;CAGR,CAAC;AAEX,KAAK,UAAU,GAAG,MAAM,OAAO,YAAY,CAAC;AAE5C,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAsCzF;AAqFD,OAAO,EAAE,MAAM,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;GASG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAiLpE;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAgBzD;AAED,eAAO,MAAM,qBAAqB,aAAgD,CAAC;AAqdnF;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAGnE;AAmFD,QAAA,MAAM,MAAM,WAGV,CAAC;AAk3CH,QAAA,MAAM,YAAY;;;;;;;;;CAGR,CAAC;AAEX,KAAK,UAAU,GAAG,MAAM,OAAO,YAAY,CAAC;AAE5C,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAsCzF;AAqFD,OAAO,EAAE,MAAM,EAAE,CAAC"}