@hasna/microservices 0.0.3 → 0.0.5

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 (68) hide show
  1. package/bin/index.js +63 -0
  2. package/bin/mcp.js +63 -0
  3. package/dist/index.js +63 -0
  4. package/microservices/microservice-ads/package.json +27 -0
  5. package/microservices/microservice-ads/src/cli/index.ts +605 -0
  6. package/microservices/microservice-ads/src/db/campaigns.ts +797 -0
  7. package/microservices/microservice-ads/src/db/database.ts +93 -0
  8. package/microservices/microservice-ads/src/db/migrations.ts +60 -0
  9. package/microservices/microservice-ads/src/index.ts +39 -0
  10. package/microservices/microservice-ads/src/mcp/index.ts +480 -0
  11. package/microservices/microservice-contracts/package.json +27 -0
  12. package/microservices/microservice-contracts/src/cli/index.ts +770 -0
  13. package/microservices/microservice-contracts/src/db/contracts.ts +925 -0
  14. package/microservices/microservice-contracts/src/db/database.ts +93 -0
  15. package/microservices/microservice-contracts/src/db/migrations.ts +141 -0
  16. package/microservices/microservice-contracts/src/index.ts +43 -0
  17. package/microservices/microservice-contracts/src/mcp/index.ts +617 -0
  18. package/microservices/microservice-domains/package.json +27 -0
  19. package/microservices/microservice-domains/src/cli/index.ts +691 -0
  20. package/microservices/microservice-domains/src/db/database.ts +93 -0
  21. package/microservices/microservice-domains/src/db/domains.ts +1164 -0
  22. package/microservices/microservice-domains/src/db/migrations.ts +60 -0
  23. package/microservices/microservice-domains/src/index.ts +65 -0
  24. package/microservices/microservice-domains/src/mcp/index.ts +536 -0
  25. package/microservices/microservice-hiring/package.json +27 -0
  26. package/microservices/microservice-hiring/src/cli/index.ts +741 -0
  27. package/microservices/microservice-hiring/src/db/database.ts +93 -0
  28. package/microservices/microservice-hiring/src/db/hiring.ts +1085 -0
  29. package/microservices/microservice-hiring/src/db/migrations.ts +89 -0
  30. package/microservices/microservice-hiring/src/index.ts +80 -0
  31. package/microservices/microservice-hiring/src/lib/scoring.ts +206 -0
  32. package/microservices/microservice-hiring/src/mcp/index.ts +709 -0
  33. package/microservices/microservice-payments/package.json +27 -0
  34. package/microservices/microservice-payments/src/cli/index.ts +609 -0
  35. package/microservices/microservice-payments/src/db/database.ts +93 -0
  36. package/microservices/microservice-payments/src/db/migrations.ts +81 -0
  37. package/microservices/microservice-payments/src/db/payments.ts +1204 -0
  38. package/microservices/microservice-payments/src/index.ts +51 -0
  39. package/microservices/microservice-payments/src/mcp/index.ts +683 -0
  40. package/microservices/microservice-payroll/package.json +27 -0
  41. package/microservices/microservice-payroll/src/cli/index.ts +643 -0
  42. package/microservices/microservice-payroll/src/db/database.ts +93 -0
  43. package/microservices/microservice-payroll/src/db/migrations.ts +95 -0
  44. package/microservices/microservice-payroll/src/db/payroll.ts +1377 -0
  45. package/microservices/microservice-payroll/src/index.ts +48 -0
  46. package/microservices/microservice-payroll/src/mcp/index.ts +666 -0
  47. package/microservices/microservice-shipping/package.json +27 -0
  48. package/microservices/microservice-shipping/src/cli/index.ts +606 -0
  49. package/microservices/microservice-shipping/src/db/database.ts +93 -0
  50. package/microservices/microservice-shipping/src/db/migrations.ts +69 -0
  51. package/microservices/microservice-shipping/src/db/shipping.ts +1093 -0
  52. package/microservices/microservice-shipping/src/index.ts +53 -0
  53. package/microservices/microservice-shipping/src/mcp/index.ts +533 -0
  54. package/microservices/microservice-social/package.json +27 -0
  55. package/microservices/microservice-social/src/cli/index.ts +689 -0
  56. package/microservices/microservice-social/src/db/database.ts +93 -0
  57. package/microservices/microservice-social/src/db/migrations.ts +88 -0
  58. package/microservices/microservice-social/src/db/social.ts +1046 -0
  59. package/microservices/microservice-social/src/index.ts +46 -0
  60. package/microservices/microservice-social/src/mcp/index.ts +655 -0
  61. package/microservices/microservice-subscriptions/package.json +27 -0
  62. package/microservices/microservice-subscriptions/src/cli/index.ts +715 -0
  63. package/microservices/microservice-subscriptions/src/db/database.ts +93 -0
  64. package/microservices/microservice-subscriptions/src/db/migrations.ts +125 -0
  65. package/microservices/microservice-subscriptions/src/db/subscriptions.ts +1256 -0
  66. package/microservices/microservice-subscriptions/src/index.ts +41 -0
  67. package/microservices/microservice-subscriptions/src/mcp/index.ts +631 -0
  68. package/package.json +1 -1
@@ -0,0 +1,53 @@
1
+ /**
2
+ * microservice-shipping — Shipping and order management microservice
3
+ */
4
+
5
+ export {
6
+ createOrder,
7
+ getOrder,
8
+ listOrders,
9
+ updateOrder,
10
+ deleteOrder,
11
+ searchOrders,
12
+ listByStatus,
13
+ type Order,
14
+ type OrderItem,
15
+ type Address,
16
+ type CreateOrderInput,
17
+ type UpdateOrderInput,
18
+ type ListOrdersOptions,
19
+ } from "./db/shipping.js";
20
+
21
+ export {
22
+ createShipment,
23
+ getShipment,
24
+ getShipmentByTracking,
25
+ listShipments,
26
+ updateShipment,
27
+ deleteShipment,
28
+ type Shipment,
29
+ type CreateShipmentInput,
30
+ type UpdateShipmentInput,
31
+ type ListShipmentsOptions,
32
+ } from "./db/shipping.js";
33
+
34
+ export {
35
+ createReturn,
36
+ getReturn,
37
+ listReturns,
38
+ updateReturn,
39
+ deleteReturn,
40
+ type Return,
41
+ type CreateReturnInput,
42
+ type UpdateReturnInput,
43
+ type ListReturnsOptions,
44
+ } from "./db/shipping.js";
45
+
46
+ export {
47
+ getShippingStats,
48
+ getCostsByCarrier,
49
+ type ShippingStats,
50
+ type CarrierCosts,
51
+ } from "./db/shipping.js";
52
+
53
+ export { getDatabase, closeDatabase } from "./db/database.js";
@@ -0,0 +1,533 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
4
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
5
+ import { z } from "zod";
6
+ import {
7
+ createOrder,
8
+ getOrder,
9
+ listOrders,
10
+ updateOrder,
11
+ deleteOrder,
12
+ searchOrders,
13
+ listByStatus,
14
+ bulkImportOrders,
15
+ exportOrders,
16
+ getOrderTimeline,
17
+ } from "../db/shipping.js";
18
+ import {
19
+ createShipment,
20
+ getShipment,
21
+ getShipmentByTracking,
22
+ listShipments,
23
+ updateShipment,
24
+ } from "../db/shipping.js";
25
+ import {
26
+ createReturn,
27
+ getReturn,
28
+ listReturns,
29
+ updateReturn,
30
+ } from "../db/shipping.js";
31
+ import {
32
+ getShippingStats,
33
+ getCostsByCarrier,
34
+ getDeliveryStats,
35
+ listOverdueShipments,
36
+ getCustomerHistory,
37
+ getCarrierPerformance,
38
+ optimizeCost,
39
+ } from "../db/shipping.js";
40
+
41
+ const server = new McpServer({
42
+ name: "microservice-shipping",
43
+ version: "0.0.1",
44
+ });
45
+
46
+ // ─── Orders ──────────────────────────────────────────────────────────────────
47
+
48
+ const AddressSchema = z.object({
49
+ street: z.string(),
50
+ city: z.string(),
51
+ state: z.string(),
52
+ zip: z.string(),
53
+ country: z.string(),
54
+ });
55
+
56
+ const OrderItemSchema = z.object({
57
+ name: z.string(),
58
+ qty: z.number(),
59
+ weight: z.number(),
60
+ value: z.number(),
61
+ });
62
+
63
+ server.registerTool(
64
+ "create_order",
65
+ {
66
+ title: "Create Order",
67
+ description: "Create a new order.",
68
+ inputSchema: {
69
+ customer_name: z.string(),
70
+ customer_email: z.string().optional(),
71
+ address: AddressSchema,
72
+ items: z.array(OrderItemSchema),
73
+ currency: z.string().optional(),
74
+ },
75
+ },
76
+ async (params) => {
77
+ const order = createOrder(params);
78
+ return { content: [{ type: "text", text: JSON.stringify(order, null, 2) }] };
79
+ }
80
+ );
81
+
82
+ server.registerTool(
83
+ "get_order",
84
+ {
85
+ title: "Get Order",
86
+ description: "Get an order by ID.",
87
+ inputSchema: { id: z.string() },
88
+ },
89
+ async ({ id }) => {
90
+ const order = getOrder(id);
91
+ if (!order) {
92
+ return { content: [{ type: "text", text: `Order '${id}' not found.` }], isError: true };
93
+ }
94
+ return { content: [{ type: "text", text: JSON.stringify(order, null, 2) }] };
95
+ }
96
+ );
97
+
98
+ server.registerTool(
99
+ "list_orders",
100
+ {
101
+ title: "List Orders",
102
+ description: "List orders with optional filters.",
103
+ inputSchema: {
104
+ status: z.string().optional(),
105
+ search: z.string().optional(),
106
+ limit: z.number().optional(),
107
+ },
108
+ },
109
+ async (params) => {
110
+ const orders = listOrders(params);
111
+ return {
112
+ content: [
113
+ { type: "text", text: JSON.stringify({ orders, count: orders.length }, null, 2) },
114
+ ],
115
+ };
116
+ }
117
+ );
118
+
119
+ server.registerTool(
120
+ "update_order",
121
+ {
122
+ title: "Update Order",
123
+ description: "Update an existing order.",
124
+ inputSchema: {
125
+ id: z.string(),
126
+ customer_name: z.string().optional(),
127
+ customer_email: z.string().optional(),
128
+ status: z.enum(["pending", "processing", "shipped", "delivered", "returned"]).optional(),
129
+ address: AddressSchema.optional(),
130
+ items: z.array(OrderItemSchema).optional(),
131
+ total_value: z.number().optional(),
132
+ currency: z.string().optional(),
133
+ },
134
+ },
135
+ async ({ id, ...input }) => {
136
+ const order = updateOrder(id, input);
137
+ if (!order) {
138
+ return { content: [{ type: "text", text: `Order '${id}' not found.` }], isError: true };
139
+ }
140
+ return { content: [{ type: "text", text: JSON.stringify(order, null, 2) }] };
141
+ }
142
+ );
143
+
144
+ server.registerTool(
145
+ "delete_order",
146
+ {
147
+ title: "Delete Order",
148
+ description: "Delete an order by ID.",
149
+ inputSchema: { id: z.string() },
150
+ },
151
+ async ({ id }) => {
152
+ const deleted = deleteOrder(id);
153
+ return { content: [{ type: "text", text: JSON.stringify({ id, deleted }) }] };
154
+ }
155
+ );
156
+
157
+ server.registerTool(
158
+ "search_orders",
159
+ {
160
+ title: "Search Orders",
161
+ description: "Search orders by customer name or email.",
162
+ inputSchema: { query: z.string() },
163
+ },
164
+ async ({ query }) => {
165
+ const results = searchOrders(query);
166
+ return {
167
+ content: [
168
+ { type: "text", text: JSON.stringify({ results, count: results.length }, null, 2) },
169
+ ],
170
+ };
171
+ }
172
+ );
173
+
174
+ // ─── Shipments ───────────────────────────────────────────────────────────────
175
+
176
+ server.registerTool(
177
+ "create_shipment",
178
+ {
179
+ title: "Create Shipment",
180
+ description: "Create a shipment for an order.",
181
+ inputSchema: {
182
+ order_id: z.string(),
183
+ carrier: z.enum(["ups", "fedex", "usps", "dhl"]),
184
+ tracking_number: z.string().optional(),
185
+ service: z.enum(["ground", "express", "overnight"]).optional(),
186
+ cost: z.number().optional(),
187
+ weight: z.number().optional(),
188
+ estimated_delivery: z.string().optional(),
189
+ dimensions: z.record(z.unknown()).optional(),
190
+ },
191
+ },
192
+ async (params) => {
193
+ const shipment = createShipment(params);
194
+ return { content: [{ type: "text", text: JSON.stringify(shipment, null, 2) }] };
195
+ }
196
+ );
197
+
198
+ server.registerTool(
199
+ "get_shipment",
200
+ {
201
+ title: "Get Shipment",
202
+ description: "Get a shipment by ID.",
203
+ inputSchema: { id: z.string() },
204
+ },
205
+ async ({ id }) => {
206
+ const shipment = getShipment(id);
207
+ if (!shipment) {
208
+ return { content: [{ type: "text", text: `Shipment '${id}' not found.` }], isError: true };
209
+ }
210
+ return { content: [{ type: "text", text: JSON.stringify(shipment, null, 2) }] };
211
+ }
212
+ );
213
+
214
+ server.registerTool(
215
+ "track_shipment",
216
+ {
217
+ title: "Track Shipment",
218
+ description: "Track a shipment by tracking number.",
219
+ inputSchema: { tracking_number: z.string() },
220
+ },
221
+ async ({ tracking_number }) => {
222
+ const shipment = getShipmentByTracking(tracking_number);
223
+ if (!shipment) {
224
+ return { content: [{ type: "text", text: `Shipment with tracking '${tracking_number}' not found.` }], isError: true };
225
+ }
226
+ return { content: [{ type: "text", text: JSON.stringify(shipment, null, 2) }] };
227
+ }
228
+ );
229
+
230
+ server.registerTool(
231
+ "list_shipments",
232
+ {
233
+ title: "List Shipments",
234
+ description: "List shipments with optional filters.",
235
+ inputSchema: {
236
+ order_id: z.string().optional(),
237
+ carrier: z.string().optional(),
238
+ status: z.string().optional(),
239
+ limit: z.number().optional(),
240
+ },
241
+ },
242
+ async (params) => {
243
+ const shipments = listShipments(params);
244
+ return {
245
+ content: [
246
+ { type: "text", text: JSON.stringify({ shipments, count: shipments.length }, null, 2) },
247
+ ],
248
+ };
249
+ }
250
+ );
251
+
252
+ server.registerTool(
253
+ "update_shipment",
254
+ {
255
+ title: "Update Shipment",
256
+ description: "Update a shipment.",
257
+ inputSchema: {
258
+ id: z.string(),
259
+ carrier: z.enum(["ups", "fedex", "usps", "dhl"]).optional(),
260
+ tracking_number: z.string().optional(),
261
+ service: z.enum(["ground", "express", "overnight"]).optional(),
262
+ status: z.enum(["label_created", "in_transit", "out_for_delivery", "delivered", "exception"]).optional(),
263
+ shipped_at: z.string().optional(),
264
+ estimated_delivery: z.string().optional(),
265
+ delivered_at: z.string().optional(),
266
+ cost: z.number().optional(),
267
+ weight: z.number().optional(),
268
+ dimensions: z.record(z.unknown()).optional(),
269
+ },
270
+ },
271
+ async ({ id, ...input }) => {
272
+ const shipment = updateShipment(id, input);
273
+ if (!shipment) {
274
+ return { content: [{ type: "text", text: `Shipment '${id}' not found.` }], isError: true };
275
+ }
276
+ return { content: [{ type: "text", text: JSON.stringify(shipment, null, 2) }] };
277
+ }
278
+ );
279
+
280
+ // ─── Returns ─────────────────────────────────────────────────────────────────
281
+
282
+ server.registerTool(
283
+ "create_return",
284
+ {
285
+ title: "Create Return",
286
+ description: "Create a return request for an order. Set auto_rma to true to generate a unique RMA code.",
287
+ inputSchema: {
288
+ order_id: z.string(),
289
+ reason: z.string().optional(),
290
+ auto_rma: z.boolean().optional(),
291
+ },
292
+ },
293
+ async (params) => {
294
+ const ret = createReturn(params);
295
+ return { content: [{ type: "text", text: JSON.stringify(ret, null, 2) }] };
296
+ }
297
+ );
298
+
299
+ server.registerTool(
300
+ "get_return",
301
+ {
302
+ title: "Get Return",
303
+ description: "Get a return by ID.",
304
+ inputSchema: { id: z.string() },
305
+ },
306
+ async ({ id }) => {
307
+ const ret = getReturn(id);
308
+ if (!ret) {
309
+ return { content: [{ type: "text", text: `Return '${id}' not found.` }], isError: true };
310
+ }
311
+ return { content: [{ type: "text", text: JSON.stringify(ret, null, 2) }] };
312
+ }
313
+ );
314
+
315
+ server.registerTool(
316
+ "list_returns",
317
+ {
318
+ title: "List Returns",
319
+ description: "List returns with optional filters.",
320
+ inputSchema: {
321
+ order_id: z.string().optional(),
322
+ status: z.string().optional(),
323
+ limit: z.number().optional(),
324
+ },
325
+ },
326
+ async (params) => {
327
+ const returns = listReturns(params);
328
+ return {
329
+ content: [
330
+ { type: "text", text: JSON.stringify({ returns, count: returns.length }, null, 2) },
331
+ ],
332
+ };
333
+ }
334
+ );
335
+
336
+ server.registerTool(
337
+ "update_return",
338
+ {
339
+ title: "Update Return",
340
+ description: "Update a return status.",
341
+ inputSchema: {
342
+ id: z.string(),
343
+ reason: z.string().optional(),
344
+ status: z.enum(["requested", "approved", "received", "refunded"]).optional(),
345
+ },
346
+ },
347
+ async ({ id, ...input }) => {
348
+ const ret = updateReturn(id, input);
349
+ if (!ret) {
350
+ return { content: [{ type: "text", text: `Return '${id}' not found.` }], isError: true };
351
+ }
352
+ return { content: [{ type: "text", text: JSON.stringify(ret, null, 2) }] };
353
+ }
354
+ );
355
+
356
+ // ─── Analytics ───────────────────────────────────────────────────────────────
357
+
358
+ server.registerTool(
359
+ "shipping_stats",
360
+ {
361
+ title: "Shipping Statistics",
362
+ description: "Get overall shipping statistics.",
363
+ inputSchema: {},
364
+ },
365
+ async () => {
366
+ const stats = getShippingStats();
367
+ return { content: [{ type: "text", text: JSON.stringify(stats, null, 2) }] };
368
+ }
369
+ );
370
+
371
+ server.registerTool(
372
+ "carrier_costs",
373
+ {
374
+ title: "Carrier Costs",
375
+ description: "Get shipping costs breakdown by carrier.",
376
+ inputSchema: {},
377
+ },
378
+ async () => {
379
+ const costs = getCostsByCarrier();
380
+ return { content: [{ type: "text", text: JSON.stringify(costs, null, 2) }] };
381
+ }
382
+ );
383
+
384
+ // ─── Bulk Import/Export ──────────────────────────────────────────────────────
385
+
386
+ server.registerTool(
387
+ "bulk_import_orders",
388
+ {
389
+ title: "Bulk Import Orders",
390
+ description: "Import orders from CSV data. Columns: customer_name,customer_email,street,city,state,zip,country,items_json,total_value.",
391
+ inputSchema: {
392
+ csv_data: z.string().describe("CSV data with header row"),
393
+ },
394
+ },
395
+ async ({ csv_data }) => {
396
+ const result = bulkImportOrders(csv_data);
397
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
398
+ }
399
+ );
400
+
401
+ server.registerTool(
402
+ "export_orders",
403
+ {
404
+ title: "Export Orders",
405
+ description: "Export orders in CSV or JSON format, optionally filtered by date range.",
406
+ inputSchema: {
407
+ format: z.enum(["csv", "json"]).describe("Output format"),
408
+ date_from: z.string().optional().describe("Filter from date (YYYY-MM-DD)"),
409
+ date_to: z.string().optional().describe("Filter to date (YYYY-MM-DD)"),
410
+ },
411
+ },
412
+ async ({ format, date_from, date_to }) => {
413
+ const output = exportOrders(format, date_from, date_to);
414
+ return { content: [{ type: "text", text: output }] };
415
+ }
416
+ );
417
+
418
+ // ─── Delivery Timeline Analytics ────────────────────────────────────────────
419
+
420
+ server.registerTool(
421
+ "delivery_timeline_stats",
422
+ {
423
+ title: "Delivery Timeline Stats",
424
+ description: "Get delivery time analytics (avg days, on-time %, late %) per carrier and service level.",
425
+ inputSchema: {
426
+ carrier: z.string().optional().describe("Filter by carrier"),
427
+ },
428
+ },
429
+ async ({ carrier }) => {
430
+ const stats = getDeliveryStats(carrier);
431
+ return { content: [{ type: "text", text: JSON.stringify(stats, null, 2) }] };
432
+ }
433
+ );
434
+
435
+ // ─── Late Delivery Alerts ───────────────────────────────────────────────────
436
+
437
+ server.registerTool(
438
+ "list_overdue_shipments",
439
+ {
440
+ title: "List Overdue Shipments",
441
+ description: "Find shipments past their estimated delivery date + grace period that are not yet delivered.",
442
+ inputSchema: {
443
+ grace_days: z.number().optional().describe("Grace days beyond estimated delivery (default 0)"),
444
+ },
445
+ },
446
+ async ({ grace_days }) => {
447
+ const overdue = listOverdueShipments(grace_days ?? 0);
448
+ return { content: [{ type: "text", text: JSON.stringify({ overdue, count: overdue.length }, null, 2) }] };
449
+ }
450
+ );
451
+
452
+ // ─── Customer History ───────────────────────────────────────────────────────
453
+
454
+ server.registerTool(
455
+ "customer_shipping_history",
456
+ {
457
+ title: "Customer Shipping History",
458
+ description: "Get all orders, shipments, and returns for a customer by email.",
459
+ inputSchema: {
460
+ email: z.string().describe("Customer email address"),
461
+ },
462
+ },
463
+ async ({ email }) => {
464
+ const history = getCustomerHistory(email);
465
+ return { content: [{ type: "text", text: JSON.stringify(history, null, 2) }] };
466
+ }
467
+ );
468
+
469
+ // ─── Carrier Performance ────────────────────────────────────────────────────
470
+
471
+ server.registerTool(
472
+ "carrier_performance",
473
+ {
474
+ title: "Carrier Performance",
475
+ description: "Rank carriers by on-time delivery %, average cost, and average delivery days.",
476
+ inputSchema: {},
477
+ },
478
+ async () => {
479
+ const perf = getCarrierPerformance();
480
+ return { content: [{ type: "text", text: JSON.stringify(perf, null, 2) }] };
481
+ }
482
+ );
483
+
484
+ // ─── Cost Optimizer ─────────────────────────────────────────────────────────
485
+
486
+ server.registerTool(
487
+ "optimize_shipping_cost",
488
+ {
489
+ title: "Optimize Shipping Cost",
490
+ description: "Recommend cheapest carrier/service based on historical cost data for a given package weight.",
491
+ inputSchema: {
492
+ weight: z.number().describe("Package weight in kg"),
493
+ from_zip: z.string().optional().describe("Origin zip code"),
494
+ to_zip: z.string().optional().describe("Destination zip code"),
495
+ },
496
+ },
497
+ async ({ weight, from_zip, to_zip }) => {
498
+ const recommendations = optimizeCost(weight, from_zip, to_zip);
499
+ return { content: [{ type: "text", text: JSON.stringify(recommendations, null, 2) }] };
500
+ }
501
+ );
502
+
503
+ // ─── Order Timeline ─────────────────────────────────────────────────────────
504
+
505
+ server.registerTool(
506
+ "order_timeline",
507
+ {
508
+ title: "Order Timeline",
509
+ description: "Get the full event history for an order, including shipments and returns.",
510
+ inputSchema: {
511
+ order_id: z.string().describe("Order ID"),
512
+ },
513
+ },
514
+ async ({ order_id }) => {
515
+ const timeline = getOrderTimeline(order_id);
516
+ if (timeline.length === 0) {
517
+ return { content: [{ type: "text", text: `No events found for order '${order_id}'.` }], isError: true };
518
+ }
519
+ return { content: [{ type: "text", text: JSON.stringify(timeline, null, 2) }] };
520
+ }
521
+ );
522
+
523
+ // --- Start ---
524
+ async function main() {
525
+ const transport = new StdioServerTransport();
526
+ await server.connect(transport);
527
+ console.error("microservice-shipping MCP server running on stdio");
528
+ }
529
+
530
+ main().catch((error) => {
531
+ console.error("Fatal error:", error);
532
+ process.exit(1);
533
+ });
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "@hasna/microservice-social",
3
+ "version": "0.0.1",
4
+ "description": "Social media management microservice with SQLite — manage accounts, posts, templates, and engagement analytics",
5
+ "type": "module",
6
+ "bin": {
7
+ "microservice-social": "./src/cli/index.ts",
8
+ "microservice-social-mcp": "./src/mcp/index.ts"
9
+ },
10
+ "exports": {
11
+ ".": "./src/index.ts"
12
+ },
13
+ "scripts": {
14
+ "dev": "bun run ./src/cli/index.ts",
15
+ "test": "bun test"
16
+ },
17
+ "dependencies": {
18
+ "@modelcontextprotocol/sdk": "^1.26.0",
19
+ "commander": "^12.1.0",
20
+ "zod": "^3.24.0"
21
+ },
22
+ "license": "Apache-2.0",
23
+ "publishConfig": {
24
+ "registry": "https://registry.npmjs.org",
25
+ "access": "public"
26
+ }
27
+ }