@lofder/dsers-mcp-product 1.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.
Files changed (67) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +210 -0
  3. package/dist/dsers/account.d.ts +17 -0
  4. package/dist/dsers/account.d.ts.map +1 -0
  5. package/dist/dsers/account.js +37 -0
  6. package/dist/dsers/account.js.map +1 -0
  7. package/dist/dsers/auth.d.ts +14 -0
  8. package/dist/dsers/auth.d.ts.map +1 -0
  9. package/dist/dsers/auth.js +87 -0
  10. package/dist/dsers/auth.js.map +1 -0
  11. package/dist/dsers/client.d.ts +21 -0
  12. package/dist/dsers/client.d.ts.map +1 -0
  13. package/dist/dsers/client.js +78 -0
  14. package/dist/dsers/client.js.map +1 -0
  15. package/dist/dsers/config.d.ts +9 -0
  16. package/dist/dsers/config.d.ts.map +1 -0
  17. package/dist/dsers/config.js +28 -0
  18. package/dist/dsers/config.js.map +1 -0
  19. package/dist/dsers/product.d.ts +42 -0
  20. package/dist/dsers/product.d.ts.map +1 -0
  21. package/dist/dsers/product.js +289 -0
  22. package/dist/dsers/product.js.map +1 -0
  23. package/dist/dsers/settings.d.ts +30 -0
  24. package/dist/dsers/settings.d.ts.map +1 -0
  25. package/dist/dsers/settings.js +63 -0
  26. package/dist/dsers/settings.js.map +1 -0
  27. package/dist/error-map.d.ts +7 -0
  28. package/dist/error-map.d.ts.map +1 -0
  29. package/dist/error-map.js +231 -0
  30. package/dist/error-map.js.map +1 -0
  31. package/dist/index.d.ts +17 -0
  32. package/dist/index.d.ts.map +1 -0
  33. package/dist/index.js +43 -0
  34. package/dist/index.js.map +1 -0
  35. package/dist/job-store-memory.d.ts +8 -0
  36. package/dist/job-store-memory.d.ts.map +1 -0
  37. package/dist/job-store-memory.js +60 -0
  38. package/dist/job-store-memory.js.map +1 -0
  39. package/dist/job-store.d.ts +14 -0
  40. package/dist/job-store.d.ts.map +1 -0
  41. package/dist/job-store.js +31 -0
  42. package/dist/job-store.js.map +1 -0
  43. package/dist/provider.d.ts +53 -0
  44. package/dist/provider.d.ts.map +1 -0
  45. package/dist/provider.js +1298 -0
  46. package/dist/provider.js.map +1 -0
  47. package/dist/push-options.d.ts +7 -0
  48. package/dist/push-options.d.ts.map +1 -0
  49. package/dist/push-options.js +158 -0
  50. package/dist/push-options.js.map +1 -0
  51. package/dist/resolver.d.ts +8 -0
  52. package/dist/resolver.d.ts.map +1 -0
  53. package/dist/resolver.js +81 -0
  54. package/dist/resolver.js.map +1 -0
  55. package/dist/rules.d.ts +14 -0
  56. package/dist/rules.d.ts.map +1 -0
  57. package/dist/rules.js +332 -0
  58. package/dist/rules.js.map +1 -0
  59. package/dist/service.d.ts +22 -0
  60. package/dist/service.d.ts.map +1 -0
  61. package/dist/service.js +461 -0
  62. package/dist/service.js.map +1 -0
  63. package/dist/tools.d.ts +4 -0
  64. package/dist/tools.d.ts.map +1 -0
  65. package/dist/tools.js +402 -0
  66. package/dist/tools.js.map +1 -0
  67. package/package.json +54 -0
package/dist/tools.js ADDED
@@ -0,0 +1,402 @@
1
+ import { z } from "zod";
2
+ import { formatErrorForAgent } from "./error-map.js";
3
+ function toJson(data) {
4
+ return JSON.stringify(data, null, 2);
5
+ }
6
+ function ok(data) {
7
+ return { content: [{ type: "text", text: toJson(data) }] };
8
+ }
9
+ function fail(err) {
10
+ return {
11
+ content: [{ type: "text", text: formatErrorForAgent(err) }],
12
+ isError: true,
13
+ };
14
+ }
15
+ function safeJsonParse(raw, paramName, hint) {
16
+ try {
17
+ return { value: JSON.parse(raw) };
18
+ }
19
+ catch {
20
+ return { value: null, error: `Invalid JSON in ${paramName}. ${hint}` };
21
+ }
22
+ }
23
+ export function registerTools(server, getService) {
24
+ const svc = typeof getService === "function" ? getService : () => getService;
25
+ server.registerTool("dsers.store.discover", {
26
+ title: "DSers Store & Rule Discovery",
27
+ description: "Retrieve available stores, supported rule families (pricing, content, images), push options, and visibility modes for the connected DSers account. " +
28
+ "Call this first before any other tool — the response contains store IDs, shipping profiles, and configuration constraints needed by all subsequent operations. " +
29
+ "Returns: provider_label, source_support (aliexpress/alibaba/1688), stores (each with store_ref, display_name, platform, shipping_profiles), rule_families, push_options, notes.",
30
+ inputSchema: {
31
+ target_store: z
32
+ .string()
33
+ .optional()
34
+ .describe("Store ID or display name to filter capabilities for a specific store. " +
35
+ "Omit to see all linked stores. Use the store_ref or display_name from this response in later calls."),
36
+ },
37
+ annotations: {
38
+ readOnlyHint: true,
39
+ destructiveHint: false,
40
+ idempotentHint: true,
41
+ openWorldHint: false,
42
+ },
43
+ }, async ({ target_store }) => {
44
+ try {
45
+ return ok(await svc().getRuleCapabilities({ target_store: target_store || null }));
46
+ }
47
+ catch (err) {
48
+ return fail(err);
49
+ }
50
+ });
51
+ server.registerTool("dsers.rules.validate", {
52
+ title: "Dropshipping Pricing & Content Rule Validator",
53
+ description: "Check and normalize a rules object against the provider's capabilities before importing. " +
54
+ "Use this to verify pricing, content, and image rules are valid and see exactly which ones will be applied. " +
55
+ "Returns: effective_rules_snapshot (what will actually be applied), warnings (adjustments made), errors (blocking issues that must be fixed before calling dsers.product.import).",
56
+ inputSchema: {
57
+ rules: z.string().describe("Rules as a JSON string. Top-level keys: pricing, content, images. " +
58
+ 'Example: {"pricing": {"mode": "multiplier", "multiplier": 2.5}, ' +
59
+ '"content": {"title_prefix": "[US] "}, "images": {"keep_first_n": 5}}'),
60
+ target_store: z
61
+ .string()
62
+ .optional()
63
+ .describe("Store ID or display name from dsers.store.discover. Some rule capabilities vary by store."),
64
+ },
65
+ annotations: {
66
+ readOnlyHint: true,
67
+ destructiveHint: false,
68
+ idempotentHint: true,
69
+ openWorldHint: false,
70
+ },
71
+ }, async ({ rules, target_store }) => {
72
+ try {
73
+ const parsed = safeJsonParse(rules, "rules", 'Expected a JSON object with optional keys: pricing, content, images. ' +
74
+ 'Example: {"pricing": {"mode": "multiplier", "multiplier": 2.0}}');
75
+ if (parsed.error)
76
+ return fail(new Error(parsed.error));
77
+ return ok(await svc().validateRules({ rules: parsed.value, target_store: target_store || null }));
78
+ }
79
+ catch (err) {
80
+ return fail(err);
81
+ }
82
+ });
83
+ server.registerTool("dsers.product.import", {
84
+ title: "AliExpress / Alibaba / 1688 Product Import",
85
+ description: "Import product(s) from supplier URL(s) into the DSers import list and return a preview bundle with title, prices, images, and variants. " +
86
+ "Single mode: provide source_url. Batch mode: provide source_urls_json with an array of URLs or objects. " +
87
+ "Each successful import returns a job_id needed for dsers.product.preview, dsers.product.visibility, and dsers.store.push. " +
88
+ "Returns: job_id, status, title_before/after, price_range_before/after, images_before/after, variant_count, variant_preview (first 5), warnings.",
89
+ inputSchema: {
90
+ source_url: z
91
+ .string()
92
+ .optional()
93
+ .describe("Single supplier product URL. Supports AliExpress (aliexpress.com/item/xxx.html), " +
94
+ "Alibaba (alibaba.com/product-detail/xxx.html), and 1688 (1688.com/offer/xxx.html)."),
95
+ source_urls_json: z
96
+ .string()
97
+ .optional()
98
+ .describe("Batch import: JSON array of URL strings or objects with {url, rules?, source_hint?, country?, target_store?, visibility_mode?}. " +
99
+ 'Example: ["https://aliexpress.com/item/123.html", ' +
100
+ '{"url": "https://aliexpress.com/item/456.html", "rules": {"pricing": {"mode": "multiplier", "multiplier": 3}}}]'),
101
+ source_hint: z
102
+ .string()
103
+ .default("auto")
104
+ .describe("Supplier platform hint. Valid values: auto, aliexpress, alibaba, 1688, accio. Default: auto (detected from URL)."),
105
+ country: z
106
+ .string()
107
+ .default("US")
108
+ .describe("Target country code for shipping and pricing lookup. Examples: US, GB, DE, FR, AU."),
109
+ target_store: z
110
+ .string()
111
+ .optional()
112
+ .describe("Store ID or display name from dsers.store.discover. Required when the account has multiple stores."),
113
+ visibility_mode: z
114
+ .string()
115
+ .default("backend_only")
116
+ .describe("Product visibility after push. " +
117
+ "backend_only: saved as draft, not visible to shoppers. " +
118
+ "sell_immediately: published and visible on the storefront."),
119
+ rules_json: z
120
+ .string()
121
+ .optional()
122
+ .describe("Optional rules as JSON string applied to all items. " +
123
+ "Keys: pricing ({mode, multiplier, fixed_markup, round_digits}), " +
124
+ "content ({title_override, title_prefix, title_suffix, description_override_html, description_append_html, tags_add}), " +
125
+ "images ({keep_first_n, drop_indexes}). " +
126
+ 'Example: {"pricing": {"mode": "fixed_markup", "fixed_markup": 5.00}}'),
127
+ },
128
+ annotations: {
129
+ readOnlyHint: false,
130
+ destructiveHint: false,
131
+ idempotentHint: false,
132
+ openWorldHint: true,
133
+ },
134
+ }, async (args) => {
135
+ try {
136
+ const payload = {};
137
+ if (args.source_urls_json) {
138
+ const parsed = safeJsonParse(args.source_urls_json, "source_urls_json", 'Expected a JSON array of URL strings or objects. Example: ["https://aliexpress.com/item/123.html"]');
139
+ if (parsed.error)
140
+ return fail(new Error(parsed.error));
141
+ payload.source_urls = parsed.value;
142
+ }
143
+ else if (args.source_url) {
144
+ payload.source_url = args.source_url;
145
+ }
146
+ if (args.source_hint)
147
+ payload.source_hint = args.source_hint;
148
+ if (args.country)
149
+ payload.country = args.country;
150
+ if (args.target_store)
151
+ payload.target_store = args.target_store;
152
+ if (args.visibility_mode)
153
+ payload.visibility_mode = args.visibility_mode;
154
+ if (args.rules_json) {
155
+ const parsed = safeJsonParse(args.rules_json, "rules_json", 'Expected a JSON object with optional keys: pricing, content, images. ' +
156
+ 'Example: {"pricing": {"mode": "multiplier", "multiplier": 2.0}}');
157
+ if (parsed.error)
158
+ return fail(new Error(parsed.error));
159
+ payload.rules = parsed.value;
160
+ }
161
+ return ok(await svc().prepareImportCandidate(payload));
162
+ }
163
+ catch (err) {
164
+ return fail(err);
165
+ }
166
+ });
167
+ server.registerTool("dsers.product.preview", {
168
+ title: "Import Draft Preview",
169
+ description: "Reload the preview for a previously prepared import job without re-importing. " +
170
+ "Use this to re-examine title, prices, images, variants, and applied rules for a job created by dsers.product.import. " +
171
+ "Returns the same structure as dsers.product.import: job_id, status, title, price ranges, images, variants, rules, warnings.",
172
+ inputSchema: {
173
+ job_id: z
174
+ .string()
175
+ .describe("Job ID returned by dsers.product.import."),
176
+ },
177
+ annotations: {
178
+ readOnlyHint: true,
179
+ destructiveHint: false,
180
+ idempotentHint: true,
181
+ openWorldHint: false,
182
+ },
183
+ }, async ({ job_id }) => {
184
+ try {
185
+ return ok(await svc().getImportPreview({ job_id }));
186
+ }
187
+ catch (err) {
188
+ return fail(err);
189
+ }
190
+ });
191
+ server.registerTool("dsers.product.visibility", {
192
+ title: "Shopify / Wix Product Visibility Toggle",
193
+ description: "Change the visibility mode of a prepared job before pushing it to the store. " +
194
+ "Call this between dsers.product.import and dsers.store.push to switch between draft and published. " +
195
+ "Returns: job_id, status, visibility_mode.",
196
+ inputSchema: {
197
+ job_id: z
198
+ .string()
199
+ .describe("Job ID returned by dsers.product.import."),
200
+ visibility_mode: z.string().describe("New visibility mode. " +
201
+ "backend_only: save as draft, not visible to shoppers. " +
202
+ "sell_immediately: publish to storefront."),
203
+ },
204
+ annotations: {
205
+ readOnlyHint: false,
206
+ destructiveHint: false,
207
+ idempotentHint: true,
208
+ openWorldHint: false,
209
+ },
210
+ }, async ({ job_id, visibility_mode }) => {
211
+ try {
212
+ return ok(await svc().setProductVisibility({ job_id, visibility_mode }));
213
+ }
214
+ catch (err) {
215
+ return fail(err);
216
+ }
217
+ });
218
+ server.registerTool("dsers.store.push", {
219
+ title: "Push Product to Shopify / Wix Store",
220
+ description: "Push one or more prepared import drafts to the connected Shopify or Wix store(s). " +
221
+ "Three modes: (1) Single push — provide job_id + target_store. " +
222
+ "(2) Batch push — provide job_ids_json with an array of job IDs or objects; takes priority over job_id. " +
223
+ "(3) Multi-store push — provide job_id + target_stores_json to push one product to multiple stores. " +
224
+ "Returns per-job results: job_id, status, target_store, visibility_applied, push_options_applied, job_summary, warnings.",
225
+ inputSchema: {
226
+ job_id: z
227
+ .string()
228
+ .optional()
229
+ .describe("Single job ID from dsers.product.import. Used for single-push or multi-store mode."),
230
+ job_ids_json: z
231
+ .string()
232
+ .optional()
233
+ .describe("Batch push: JSON array of job ID strings or objects " +
234
+ '{job_id, target_store?, target_stores?, push_options?, visibility_mode?}. ' +
235
+ 'Example: ["job-abc123", {"job_id": "job-def456", "target_store": "My Store"}]. ' +
236
+ "When provided, this takes priority over job_id."),
237
+ target_store: z
238
+ .string()
239
+ .optional()
240
+ .describe("Target store ID or display name from dsers.store.discover. Required when the account has multiple stores."),
241
+ target_stores_json: z
242
+ .string()
243
+ .optional()
244
+ .describe("Multi-store: JSON array of store IDs or display names. Pushes the same job_id to each listed store. " +
245
+ 'Example: ["Store A", "Store B"]'),
246
+ visibility_mode: z
247
+ .string()
248
+ .optional()
249
+ .describe("Override the visibility mode set during prepare. " +
250
+ "backend_only: draft. sell_immediately: published."),
251
+ push_options_json: z
252
+ .string()
253
+ .optional()
254
+ .describe("Push configuration as JSON string. Keys: " +
255
+ "publish_to_online_store (bool), " +
256
+ "image_strategy ('selected_only' or 'all_available'), " +
257
+ "pricing_rule_behavior ('keep_manual' or 'apply_store_pricing_rule'), " +
258
+ "shipping_profile_name (string — Shopify delivery profile name), " +
259
+ "auto_inventory_update (bool), auto_price_update (bool), " +
260
+ "sales_channels (string[]), only_push_specifications (bool). " +
261
+ 'Example: {"image_strategy": "all_available", "shipping_profile_name": "DSers Shipping Profile"}'),
262
+ },
263
+ annotations: {
264
+ readOnlyHint: false,
265
+ destructiveHint: true,
266
+ idempotentHint: false,
267
+ openWorldHint: true,
268
+ },
269
+ }, async (args) => {
270
+ try {
271
+ const payload = {};
272
+ if (args.job_ids_json) {
273
+ const parsed = safeJsonParse(args.job_ids_json, "job_ids_json", 'Expected a JSON array of job ID strings or objects. Example: ["job-abc123"]');
274
+ if (parsed.error)
275
+ return fail(new Error(parsed.error));
276
+ payload.job_ids = parsed.value;
277
+ }
278
+ else if (args.job_id) {
279
+ payload.job_id = args.job_id;
280
+ }
281
+ if (args.target_store)
282
+ payload.target_store = args.target_store;
283
+ if (args.target_stores_json) {
284
+ const parsed = safeJsonParse(args.target_stores_json, "target_stores_json", 'Expected a JSON array of store names or IDs. Example: ["My Store", "Store B"]');
285
+ if (parsed.error)
286
+ return fail(new Error(parsed.error));
287
+ payload.target_stores = parsed.value;
288
+ }
289
+ if (args.visibility_mode)
290
+ payload.visibility_mode = args.visibility_mode;
291
+ if (args.push_options_json) {
292
+ const parsed = safeJsonParse(args.push_options_json, "push_options_json", 'Expected a JSON object. Example: {"image_strategy": "all_available", "auto_inventory_update": true}');
293
+ if (parsed.error)
294
+ return fail(new Error(parsed.error));
295
+ payload.push_options = parsed.value;
296
+ }
297
+ return ok(await svc().confirmPushToStore(payload));
298
+ }
299
+ catch (err) {
300
+ return fail(err);
301
+ }
302
+ });
303
+ server.registerTool("dsers.job.status", {
304
+ title: "Import / Push Job Status Tracker",
305
+ description: "Check the current status of an import or push job. " +
306
+ "Status lifecycle: preview_ready (after prepare) -> push_requested (after confirm) -> completed or failed. " +
307
+ "Call this to monitor push progress or verify a job's state before further action. " +
308
+ "Returns: job_id, status, created_at, updated_at, target_store, visibility_mode, warnings, has_push_result.",
309
+ inputSchema: {
310
+ job_id: z
311
+ .string()
312
+ .describe("Job ID from dsers.product.import or dsers.store.push."),
313
+ },
314
+ annotations: {
315
+ readOnlyHint: true,
316
+ destructiveHint: false,
317
+ idempotentHint: true,
318
+ openWorldHint: false,
319
+ },
320
+ }, async ({ job_id }) => {
321
+ try {
322
+ return ok(await svc().getJobStatus({ job_id }));
323
+ }
324
+ catch (err) {
325
+ return fail(err);
326
+ }
327
+ });
328
+ // ── Prompts ──
329
+ server.prompt("dsers.workflow.quick-import", "Quick product import workflow — import a single AliExpress, Alibaba, or 1688 product and push it to your Shopify or Wix store as a draft.", {
330
+ product_url: z
331
+ .string()
332
+ .describe("Supplier product URL (AliExpress, Alibaba, or 1688)."),
333
+ store_name: z
334
+ .string()
335
+ .optional()
336
+ .describe("Target store display name. Omit if only one store is linked."),
337
+ }, async ({ product_url, store_name }) => ({
338
+ messages: [
339
+ {
340
+ role: "user",
341
+ content: {
342
+ type: "text",
343
+ text: `Import this product and push it to ${store_name || "my store"} as a draft:\n${product_url}\n\n` +
344
+ "Steps: 1) Call dsers.store.discover to find the store. " +
345
+ "2) Call dsers.product.import with the URL. " +
346
+ "3) Show me the preview (title, price, variants). " +
347
+ "4) Call dsers.store.push with visibility_mode=backend_only.",
348
+ },
349
+ },
350
+ ],
351
+ }));
352
+ server.prompt("dsers.workflow.bulk-import", "Bulk import multiple products with a pricing multiplier — import several supplier URLs at once and apply a price markup before pushing to your store.", {
353
+ product_urls: z
354
+ .string()
355
+ .describe("Comma-separated list of supplier product URLs."),
356
+ price_multiplier: z
357
+ .string()
358
+ .default("2.0")
359
+ .describe("Price multiplier to apply (e.g. 2.0 for 2x markup)."),
360
+ store_name: z
361
+ .string()
362
+ .optional()
363
+ .describe("Target store display name."),
364
+ }, async ({ product_urls, price_multiplier, store_name }) => {
365
+ const urls = product_urls.split(",").map((u) => u.trim()).filter(Boolean);
366
+ const urlsJson = JSON.stringify(urls);
367
+ return {
368
+ messages: [
369
+ {
370
+ role: "user",
371
+ content: {
372
+ type: "text",
373
+ text: `Bulk import these ${urls.length} products with a ${price_multiplier}x price markup and push them to ${store_name || "my store"}:\n\n` +
374
+ urls.map((u, i) => `${i + 1}. ${u}`).join("\n") +
375
+ "\n\nSteps: 1) dsers.store.discover. " +
376
+ `2) dsers.product.import with source_urls_json='${urlsJson}' and rules_json='{"pricing":{"mode":"multiplier","multiplier":${price_multiplier}}}'. ` +
377
+ "3) Show previews. 4) dsers.store.push for each job.",
378
+ },
379
+ },
380
+ ],
381
+ };
382
+ });
383
+ server.prompt("dsers.workflow.multi-push", "Push one product to all connected Shopify and Wix stores at once — useful for sellers managing multiple storefronts.", {
384
+ product_url: z
385
+ .string()
386
+ .describe("Supplier product URL to import."),
387
+ }, async ({ product_url }) => ({
388
+ messages: [
389
+ {
390
+ role: "user",
391
+ content: {
392
+ type: "text",
393
+ text: `Import this product and push it to ALL my stores:\n${product_url}\n\n` +
394
+ "Steps: 1) dsers.store.discover — list all stores. " +
395
+ "2) dsers.product.import with the URL. " +
396
+ "3) dsers.store.push with target_stores_json containing all store names from step 1.",
397
+ },
398
+ },
399
+ ],
400
+ }));
401
+ }
402
+ //# sourceMappingURL=tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,SAAS,MAAM,CAAC,IAAS;IACvB,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACvC,CAAC;AAED,SAAS,EAAE,CAAC,IAAS;IACnB,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;AACtE,CAAC;AAED,SAAS,IAAI,CAAC,GAAQ;IACpB,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,mBAAmB,CAAC,GAAG,CAAC,EAAE,CAAC;QACpE,OAAO,EAAE,IAAa;KACvB,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CACpB,GAAW,EACX,SAAiB,EACjB,IAAY;IAEZ,IAAI,CAAC;QACH,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;IACpC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,mBAAmB,SAAS,KAAK,IAAI,EAAE,EAAE,CAAC;IACzE,CAAC;AACH,CAAC;AAED,MAAM,UAAU,aAAa,CAC3B,MAAiB,EACjB,UAAyD;IAEzD,MAAM,GAAG,GAAG,OAAO,UAAU,KAAK,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,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
+ {
2
+ "name": "@lofder/dsers-mcp-product",
3
+ "version": "1.0.0",
4
+ "type": "module",
5
+ "mcpName": "io.github.lofder/dsers-mcp-product",
6
+ "description": "MCP server to automate DSers product import from AliExpress/Alibaba to Shopify",
7
+ "main": "dist/index.js",
8
+ "files": [
9
+ "dist"
10
+ ],
11
+ "license": "MIT",
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "https://github.com/lofder/dsers-mcp-product.git"
15
+ },
16
+ "keywords": [
17
+ "mcp",
18
+ "mcp-server",
19
+ "model-context-protocol",
20
+ "dsers",
21
+ "shopify",
22
+ "aliexpress",
23
+ "dropshipping",
24
+ "product-import",
25
+ "ai-agent",
26
+ "bulk-import",
27
+ "wix",
28
+ "woocommerce"
29
+ ],
30
+ "scripts": {
31
+ "build": "tsc -p tsconfig.build.json",
32
+ "build:vercel": "next build",
33
+ "dev": "npx @smithery/cli dev ./src/index.ts",
34
+ "dev:vercel": "next dev",
35
+ "playground": "npx @smithery/cli playground ./src/index.ts"
36
+ },
37
+ "dependencies": {
38
+ "@modelcontextprotocol/sdk": "^1.12.0",
39
+ "@smithery/sdk": "^4.3.0",
40
+ "mcp-handler": "^1.0.7",
41
+ "next": "^16.1.7",
42
+ "zod": "^4.0.0"
43
+ },
44
+ "devDependencies": {
45
+ "@smithery/cli": "^4.7.0",
46
+ "@types/node": "^22.0.0",
47
+ "@types/react": "^19.2.14",
48
+ "tsx": "^4.19.0",
49
+ "typescript": "^5.7.0"
50
+ },
51
+ "engines": {
52
+ "node": ">=18.0.0"
53
+ }
54
+ }