@wplaunchify/ml-mcp-server 2.5.1 → 2.5.4

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/build/server.js CHANGED
@@ -61,15 +61,27 @@ for (const tool of allTools) {
61
61
  continue;
62
62
  }
63
63
  const wrappedHandler = async (args) => {
64
- // The handler functions are already typed with their specific parameter types
65
- const result = await handler(args);
66
- return {
67
- content: result.toolResult.content.map((item) => ({
68
- ...item,
69
- type: "text"
70
- })),
71
- isError: result.toolResult.isError
72
- };
64
+ try {
65
+ // The handler functions are already typed with their specific parameter types
66
+ const result = await handler(args);
67
+ return {
68
+ content: result.toolResult.content.map((item) => ({
69
+ ...item,
70
+ type: "text"
71
+ })),
72
+ isError: result.toolResult.isError
73
+ };
74
+ }
75
+ catch (error) {
76
+ // Return error as tool result instead of throwing
77
+ return {
78
+ content: [{
79
+ type: "text",
80
+ text: `Error executing ${tool.name}: ${error.message || String(error)}`
81
+ }],
82
+ isError: true
83
+ };
84
+ }
73
85
  };
74
86
  // console.log(`Registering tool: ${tool.name}`);
75
87
  // console.log(`Input schema: ${JSON.stringify(tool.inputSchema)}`);
@@ -110,7 +122,7 @@ async function main() {
110
122
  throw error;
111
123
  }
112
124
  }
113
- // Handle process signals and errors
125
+ // Handle process signals gracefully
114
126
  process.on('SIGTERM', () => {
115
127
  console.log('Received SIGTERM signal, shutting down...');
116
128
  process.exit(0);
@@ -119,13 +131,14 @@ process.on('SIGINT', () => {
119
131
  console.log('Received SIGINT signal, shutting down...');
120
132
  process.exit(0);
121
133
  });
134
+ // Log errors but don't kill the server - let MCP SDK handle tool errors gracefully
122
135
  process.on('uncaughtException', (error) => {
123
136
  console.error('Uncaught exception:', error);
124
- process.exit(1);
137
+ // Don't exit - let the server continue running
125
138
  });
126
139
  process.on('unhandledRejection', (error) => {
127
140
  console.error('Unhandled rejection:', error);
128
- process.exit(1);
141
+ // Don't exit - let the server continue running
129
142
  });
130
143
  main().catch((error) => {
131
144
  console.error('Startup error:', error);
@@ -1,68 +1,5 @@
1
- import { z } from 'zod';
2
- export declare const fluentMcpProTools: ({
3
- name: string;
4
- description: string;
5
- inputSchema: z.ZodObject<{
6
- path: z.ZodString;
7
- }, "strip", z.ZodTypeAny, {
8
- path: string;
9
- }, {
10
- path: string;
11
- }>;
12
- } | {
13
- name: string;
14
- description: string;
15
- inputSchema: z.ZodObject<{
16
- source: z.ZodString;
17
- destination: z.ZodString;
18
- }, "strip", z.ZodTypeAny, {
19
- source: string;
20
- destination: string;
21
- }, {
22
- source: string;
23
- destination: string;
24
- }>;
25
- } | {
26
- name: string;
27
- description: string;
28
- inputSchema: z.ZodObject<{
29
- query: z.ZodString;
30
- type: z.ZodOptional<z.ZodEnum<["SELECT", "INSERT", "UPDATE", "DELETE"]>>;
31
- }, "strip", z.ZodTypeAny, {
32
- query: string;
33
- type?: "DELETE" | "SELECT" | "INSERT" | "UPDATE" | undefined;
34
- }, {
35
- query: string;
36
- type?: "DELETE" | "SELECT" | "INSERT" | "UPDATE" | undefined;
37
- }>;
38
- } | {
39
- name: string;
40
- description: string;
41
- inputSchema: z.ZodObject<{
42
- tables: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
43
- filename: z.ZodOptional<z.ZodString>;
44
- }, "strip", z.ZodTypeAny, {
45
- filename?: string | undefined;
46
- tables?: string[] | undefined;
47
- }, {
48
- filename?: string | undefined;
49
- tables?: string[] | undefined;
50
- }>;
51
- } | {
52
- name: string;
53
- description: string;
54
- inputSchema: z.ZodObject<{
55
- filename: z.ZodString;
56
- }, "strip", z.ZodTypeAny, {
57
- filename: string;
58
- }, {
59
- filename: string;
60
- }>;
61
- } | {
62
- name: string;
63
- description: string;
64
- inputSchema: {};
65
- })[];
1
+ import { Tool } from '@modelcontextprotocol/sdk/types.js';
2
+ export declare const fluentMcpProTools: Tool[];
66
3
  export declare const fluentMcpProHandlers: {
67
4
  pro_fs_read: (args: any) => Promise<{
68
5
  toolResult: {
@@ -234,7 +171,7 @@ export declare const fluentMcpProHandlers: {
234
171
  }[];
235
172
  };
236
173
  }>;
237
- pro_db_tables: (args: any) => Promise<{
174
+ pro_db_table_list: (args: any) => Promise<{
238
175
  toolResult: {
239
176
  content: {
240
177
  type: string;
@@ -302,7 +239,7 @@ export declare const fluentMcpProHandlers: {
302
239
  }[];
303
240
  };
304
241
  }>;
305
- pro_db_search_replace: (args: any) => Promise<{
242
+ pro_db_export: (args: any) => Promise<{
306
243
  toolResult: {
307
244
  content: {
308
245
  type: string;
@@ -319,7 +256,7 @@ export declare const fluentMcpProHandlers: {
319
256
  }[];
320
257
  };
321
258
  }>;
322
- pro_settings_general_get: (args: any) => Promise<{
259
+ pro_wp_get_option: (args: any) => Promise<{
323
260
  toolResult: {
324
261
  content: {
325
262
  type: string;
@@ -336,7 +273,7 @@ export declare const fluentMcpProHandlers: {
336
273
  }[];
337
274
  };
338
275
  }>;
339
- pro_settings_general_update: (args: any) => Promise<{
276
+ pro_wp_set_option: (args: any) => Promise<{
340
277
  toolResult: {
341
278
  content: {
342
279
  type: string;
@@ -353,7 +290,7 @@ export declare const fluentMcpProHandlers: {
353
290
  }[];
354
291
  };
355
292
  }>;
356
- pro_settings_reading_get: (args: any) => Promise<{
293
+ pro_wp_delete_option: (args: any) => Promise<{
357
294
  toolResult: {
358
295
  content: {
359
296
  type: string;
@@ -370,7 +307,7 @@ export declare const fluentMcpProHandlers: {
370
307
  }[];
371
308
  };
372
309
  }>;
373
- pro_settings_reading_update: (args: any) => Promise<{
310
+ pro_wp_list_options: (args: any) => Promise<{
374
311
  toolResult: {
375
312
  content: {
376
313
  type: string;
@@ -387,7 +324,7 @@ export declare const fluentMcpProHandlers: {
387
324
  }[];
388
325
  };
389
326
  }>;
390
- pro_settings_writing_get: (args: any) => Promise<{
327
+ pro_wp_get_constants: (args: any) => Promise<{
391
328
  toolResult: {
392
329
  content: {
393
330
  type: string;
@@ -404,7 +341,7 @@ export declare const fluentMcpProHandlers: {
404
341
  }[];
405
342
  };
406
343
  }>;
407
- pro_settings_writing_update: (args: any) => Promise<{
344
+ pro_wp_get_env: (args: any) => Promise<{
408
345
  toolResult: {
409
346
  content: {
410
347
  type: string;
@@ -421,7 +358,7 @@ export declare const fluentMcpProHandlers: {
421
358
  }[];
422
359
  };
423
360
  }>;
424
- pro_settings_discussion_get: (args: any) => Promise<{
361
+ pro_wp_site_info: (args: any) => Promise<{
425
362
  toolResult: {
426
363
  content: {
427
364
  type: string;
@@ -438,7 +375,7 @@ export declare const fluentMcpProHandlers: {
438
375
  }[];
439
376
  };
440
377
  }>;
441
- pro_settings_discussion_update: (args: any) => Promise<{
378
+ pro_wp_get_permalinks: (args: any) => Promise<{
442
379
  toolResult: {
443
380
  content: {
444
381
  type: string;
@@ -455,7 +392,7 @@ export declare const fluentMcpProHandlers: {
455
392
  }[];
456
393
  };
457
394
  }>;
458
- pro_settings_media_get: (args: any) => Promise<{
395
+ pro_wp_set_permalinks: (args: any) => Promise<{
459
396
  toolResult: {
460
397
  content: {
461
398
  type: string;
@@ -472,7 +409,7 @@ export declare const fluentMcpProHandlers: {
472
409
  }[];
473
410
  };
474
411
  }>;
475
- pro_settings_media_update: (args: any) => Promise<{
412
+ pro_wp_get_timezone: (args: any) => Promise<{
476
413
  toolResult: {
477
414
  content: {
478
415
  type: string;
@@ -489,7 +426,7 @@ export declare const fluentMcpProHandlers: {
489
426
  }[];
490
427
  };
491
428
  }>;
492
- pro_settings_permalink_get: (args: any) => Promise<{
429
+ pro_wp_set_timezone: (args: any) => Promise<{
493
430
  toolResult: {
494
431
  content: {
495
432
  type: string;
@@ -506,7 +443,7 @@ export declare const fluentMcpProHandlers: {
506
443
  }[];
507
444
  };
508
445
  }>;
509
- pro_settings_permalink_update: (args: any) => Promise<{
446
+ pro_wp_flush_cache: (args: any) => Promise<{
510
447
  toolResult: {
511
448
  content: {
512
449
  type: string;
@@ -523,7 +460,7 @@ export declare const fluentMcpProHandlers: {
523
460
  }[];
524
461
  };
525
462
  }>;
526
- pro_themes_list: (args: any) => Promise<{
463
+ pro_theme_list: (args: any) => Promise<{
527
464
  toolResult: {
528
465
  content: {
529
466
  type: string;
@@ -540,7 +477,7 @@ export declare const fluentMcpProHandlers: {
540
477
  }[];
541
478
  };
542
479
  }>;
543
- pro_themes_activate: (args: any) => Promise<{
480
+ pro_theme_activate: (args: any) => Promise<{
544
481
  toolResult: {
545
482
  content: {
546
483
  type: string;
@@ -557,7 +494,7 @@ export declare const fluentMcpProHandlers: {
557
494
  }[];
558
495
  };
559
496
  }>;
560
- pro_themes_active: (args: any) => Promise<{
497
+ pro_theme_delete: (args: any) => Promise<{
561
498
  toolResult: {
562
499
  content: {
563
500
  type: string;
@@ -574,7 +511,7 @@ export declare const fluentMcpProHandlers: {
574
511
  }[];
575
512
  };
576
513
  }>;
577
- pro_system_phpinfo: (args: any) => Promise<{
514
+ pro_system_info: (args: any) => Promise<{
578
515
  toolResult: {
579
516
  content: {
580
517
  type: string;
@@ -591,7 +528,7 @@ export declare const fluentMcpProHandlers: {
591
528
  }[];
592
529
  };
593
530
  }>;
594
- pro_system_server_info: (args: any) => Promise<{
531
+ pro_system_health: (args: any) => Promise<{
595
532
  toolResult: {
596
533
  content: {
597
534
  type: string;
@@ -608,7 +545,7 @@ export declare const fluentMcpProHandlers: {
608
545
  }[];
609
546
  };
610
547
  }>;
611
- pro_system_disk_space: (args: any) => Promise<{
548
+ pro_system_logs: (args: any) => Promise<{
612
549
  toolResult: {
613
550
  content: {
614
551
  type: string;
@@ -625,7 +562,7 @@ export declare const fluentMcpProHandlers: {
625
562
  }[];
626
563
  };
627
564
  }>;
628
- pro_system_error_log: (args: any) => Promise<{
565
+ pro_system_cron: (args: any) => Promise<{
629
566
  toolResult: {
630
567
  content: {
631
568
  type: string;
@@ -642,7 +579,7 @@ export declare const fluentMcpProHandlers: {
642
579
  }[];
643
580
  };
644
581
  }>;
645
- pro_system_clear_cache: (args: any) => Promise<{
582
+ pro_system_cron_run: (args: any) => Promise<{
646
583
  toolResult: {
647
584
  content: {
648
585
  type: string;
@@ -659,7 +596,7 @@ export declare const fluentMcpProHandlers: {
659
596
  }[];
660
597
  };
661
598
  }>;
662
- pro_config_wp_config: (args: any) => Promise<{
599
+ pro_wc_product_list: (args: any) => Promise<{
663
600
  toolResult: {
664
601
  content: {
665
602
  type: string;
@@ -676,7 +613,7 @@ export declare const fluentMcpProHandlers: {
676
613
  }[];
677
614
  };
678
615
  }>;
679
- pro_config_htaccess: (args: any) => Promise<{
616
+ pro_wc_product_get: (args: any) => Promise<{
680
617
  toolResult: {
681
618
  content: {
682
619
  type: string;
@@ -693,7 +630,7 @@ export declare const fluentMcpProHandlers: {
693
630
  }[];
694
631
  };
695
632
  }>;
696
- pro_wc_products_list: (args: any) => Promise<{
633
+ pro_wc_product_create: (args: any) => Promise<{
697
634
  toolResult: {
698
635
  content: {
699
636
  type: string;
@@ -710,7 +647,7 @@ export declare const fluentMcpProHandlers: {
710
647
  }[];
711
648
  };
712
649
  }>;
713
- pro_wc_products_create: (args: any) => Promise<{
650
+ pro_wc_product_update: (args: any) => Promise<{
714
651
  toolResult: {
715
652
  content: {
716
653
  type: string;
@@ -727,7 +664,7 @@ export declare const fluentMcpProHandlers: {
727
664
  }[];
728
665
  };
729
666
  }>;
730
- pro_wc_products_update: (args: any) => Promise<{
667
+ pro_wc_product_delete: (args: any) => Promise<{
731
668
  toolResult: {
732
669
  content: {
733
670
  type: string;
@@ -744,7 +681,7 @@ export declare const fluentMcpProHandlers: {
744
681
  }[];
745
682
  };
746
683
  }>;
747
- pro_wc_products_delete: (args: any) => Promise<{
684
+ pro_wc_order_list: (args: any) => Promise<{
748
685
  toolResult: {
749
686
  content: {
750
687
  type: string;
@@ -761,7 +698,7 @@ export declare const fluentMcpProHandlers: {
761
698
  }[];
762
699
  };
763
700
  }>;
764
- pro_wc_orders_list: (args: any) => Promise<{
701
+ pro_wc_order_get: (args: any) => Promise<{
765
702
  toolResult: {
766
703
  content: {
767
704
  type: string;
@@ -778,7 +715,7 @@ export declare const fluentMcpProHandlers: {
778
715
  }[];
779
716
  };
780
717
  }>;
781
- pro_wc_orders_update: (args: any) => Promise<{
718
+ pro_wc_order_update: (args: any) => Promise<{
782
719
  toolResult: {
783
720
  content: {
784
721
  type: string;
@@ -795,7 +732,7 @@ export declare const fluentMcpProHandlers: {
795
732
  }[];
796
733
  };
797
734
  }>;
798
- pro_wc_orders_delete: (args: any) => Promise<{
735
+ pro_wc_customer_list: (args: any) => Promise<{
799
736
  toolResult: {
800
737
  content: {
801
738
  type: string;
@@ -812,7 +749,7 @@ export declare const fluentMcpProHandlers: {
812
749
  }[];
813
750
  };
814
751
  }>;
815
- pro_wc_customers_list: (args: any) => Promise<{
752
+ pro_wc_customer_get: (args: any) => Promise<{
816
753
  toolResult: {
817
754
  content: {
818
755
  type: string;
@@ -829,7 +766,7 @@ export declare const fluentMcpProHandlers: {
829
766
  }[];
830
767
  };
831
768
  }>;
832
- pro_wc_customers_create: (args: any) => Promise<{
769
+ pro_wc_reports: (args: any) => Promise<{
833
770
  toolResult: {
834
771
  content: {
835
772
  type: string;
@@ -846,7 +783,7 @@ export declare const fluentMcpProHandlers: {
846
783
  }[];
847
784
  };
848
785
  }>;
849
- pro_wc_customers_update: (args: any) => Promise<{
786
+ pro_wc_coupon_list: (args: any) => Promise<{
850
787
  toolResult: {
851
788
  content: {
852
789
  type: string;
@@ -863,41 +800,7 @@ export declare const fluentMcpProHandlers: {
863
800
  }[];
864
801
  };
865
802
  }>;
866
- pro_wc_customers_delete: (args: any) => Promise<{
867
- toolResult: {
868
- content: {
869
- type: string;
870
- text: string;
871
- }[];
872
- isError?: undefined;
873
- };
874
- } | {
875
- toolResult: {
876
- isError: boolean;
877
- content: {
878
- type: string;
879
- text: string;
880
- }[];
881
- };
882
- }>;
883
- pro_wc_settings_get: (args: any) => Promise<{
884
- toolResult: {
885
- content: {
886
- type: string;
887
- text: string;
888
- }[];
889
- isError?: undefined;
890
- };
891
- } | {
892
- toolResult: {
893
- isError: boolean;
894
- content: {
895
- type: string;
896
- text: string;
897
- }[];
898
- };
899
- }>;
900
- pro_wc_settings_update: (args: any) => Promise<{
803
+ pro_wc_coupon_create: (args: any) => Promise<{
901
804
  toolResult: {
902
805
  content: {
903
806
  type: string;