-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-wizard.html
More file actions
963 lines (886 loc) · 69.1 KB
/
Copy pathsetup-wizard.html
File metadata and controls
963 lines (886 loc) · 69.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Better Mealie MCP · Setup Wizard</title>
<style>
:root {
--paper:#f6f3ec; --surface:#fffdf8; --panel:#eee9dd; --panel-2:#e6e0d0;
--ink:#24211b; --muted:#6f6a5d; --faint:#938c7c; --line:#ded7c7;
--basil:#2f7d4f; --basil-2:#3ea968; --copper:#b5652f;
--code-bg:#232016; --code-ink:#ece7da; --code-line:#3a3527;
--code-key:#8fd3aa; --code-str:#e0b07a; --code-punc:#9a927f;
--radius:14px; --radius-sm:9px;
--shadow:0 1px 2px rgba(40,35,20,.06), 0 8px 24px -12px rgba(40,35,20,.18);
--fs-step:1.14;
--ui:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
--mono:ui-monospace,"SF Mono",SFMono-Regular,Menlo,Consolas,"Liberation Mono",monospace;
}
@media (prefers-color-scheme: dark) {
:root {
/* Gruvbox dark */
--paper:#1d2021; --surface:#282828; --panel:#32302f; --panel-2:#3c3836;
--ink:#ebdbb2; --muted:#bdae93; --faint:#928374; --line:#504945;
--basil:#8ec07c; --basil-2:#b8bb26; --copper:#fe8019;
--code-bg:#1d2021; --code-ink:#ebdbb2; --code-line:#3c3836;
--code-key:#b8bb26; --code-str:#fabd2f; --code-punc:#928374;
--shadow:0 1px 2px rgba(0,0,0,.4), 0 12px 32px -14px rgba(0,0,0,.75);
}
}
:root[data-theme="light"] {
--paper:#f6f3ec; --surface:#fffdf8; --panel:#eee9dd; --panel-2:#e6e0d0;
--ink:#24211b; --muted:#6f6a5d; --faint:#938c7c; --line:#ded7c7;
--basil:#2f7d4f; --basil-2:#3ea968; --copper:#b5652f;
--code-bg:#232016; --code-ink:#ece7da; --code-line:#3a3527;
--shadow:0 1px 2px rgba(40,35,20,.06), 0 8px 24px -12px rgba(40,35,20,.18);
}
:root[data-theme="dark"] {
/* Gruvbox dark */
--paper:#1d2021; --surface:#282828; --panel:#32302f; --panel-2:#3c3836;
--ink:#ebdbb2; --muted:#bdae93; --faint:#928374; --line:#504945;
--basil:#8ec07c; --basil-2:#b8bb26; --copper:#fe8019;
--code-bg:#1d2021; --code-ink:#ebdbb2; --code-line:#3c3836;
--code-key:#b8bb26; --code-str:#fabd2f; --code-punc:#928374;
--shadow:0 1px 2px rgba(0,0,0,.4), 0 12px 32px -14px rgba(0,0,0,.75);
}
* { box-sizing:border-box; }
/* Author `display` on .row/.seg would otherwise override the UA [hidden]
rule, so the JS toggles (syncAuth / syncTransport) had no visible effect. */
[hidden] { display:none !important; }
body {
margin:0; background:var(--paper); color:var(--ink);
font-family:var(--ui); line-height:1.55;
-webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility;
}
.wrap { max-width:1120px; margin:0 auto; padding:clamp(20px,4vw,52px) clamp(16px,4vw,40px) 72px; }
/* ---- header ---- */
header { display:flex; align-items:center; gap:16px; flex-wrap:wrap; }
.mark { flex:none; font-size:40px; line-height:1; }
.title h1 { font-size:clamp(1.5rem,3.4vw,2.15rem); margin:0; letter-spacing:-.02em; font-weight:660; text-wrap:balance; }
.title p { margin:2px 0 0; color:var(--muted); font-size:.98rem; }
.badges { margin-left:auto; display:flex; gap:8px; flex-wrap:wrap; }
.badge {
font-family:var(--mono); font-size:.74rem; letter-spacing:.02em;
padding:5px 10px; border-radius:999px; border:1px solid var(--line);
background:var(--surface); color:var(--muted); white-space:nowrap;
}
.badge b { color:var(--basil); font-weight:600; }
a.badge.repo { display:inline-flex; align-items:center; gap:6px; text-decoration:none; transition:color .15s, border-color .15s; }
a.badge.repo svg { width:13px; height:13px; }
a.badge.repo:hover { color:var(--basil); border-color:color-mix(in oklab,var(--basil) 45%,var(--line)); }
a.badge.repo:focus-visible { outline:2px solid var(--basil-2); outline-offset:2px; }
.rule { height:1px; background:linear-gradient(90deg,var(--line),transparent); border:0; margin:26px 0 8px; }
/* ---- layout ---- */
.grid { display:grid; grid-template-columns:1fr; gap:28px; margin-top:20px; }
@media (min-width:940px){ .grid { grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:36px; align-items:start; } }
.step { display:flex; align-items:baseline; gap:11px; margin:0 0 14px; }
.step .n {
font-family:var(--mono); font-size:.72rem; font-weight:600;
width:22px; height:22px; flex:none; border-radius:6px;
display:grid; place-items:center; color:var(--basil);
background:color-mix(in oklab, var(--basil) 15%, transparent);
border:1px solid color-mix(in oklab, var(--basil) 30%, transparent);
transform:translateY(-1px);
}
.step h2 { font-size:1.02rem; margin:0; font-weight:620; letter-spacing:-.01em; }
.step .hint { color:var(--faint); font-size:.85rem; font-weight:400; margin-left:6px; }
fieldset { border:0; margin:0 0 30px; padding:0; }
.runrow { margin-top:34px; }
/* ---- client cards ---- */
.clients { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; }
@media (min-width:520px){ .clients { grid-template-columns:repeat(3,1fr); } }
.client {
appearance:none; cursor:pointer; text-align:left; font-family:var(--ui);
background:var(--surface); border:1px solid var(--line); border-radius:var(--radius-sm);
padding:12px 12px 11px; color:var(--ink); display:flex; flex-direction:column; gap:3px;
transition:border-color .15s, box-shadow .15s, background .15s, transform .05s;
}
.client:hover { border-color:color-mix(in oklab, var(--basil) 45%, var(--line)); }
.client:active { transform:translateY(1px); }
.client .cn { font-weight:600; font-size:.92rem; letter-spacing:-.01em; }
.client .cd { font-size:.76rem; color:var(--muted); line-height:1.35; }
.client[aria-pressed="true"] {
border-color:var(--basil); background:color-mix(in oklab, var(--basil) 9%, var(--surface));
box-shadow:0 0 0 1px var(--basil) inset;
}
.client:focus-visible { outline:2px solid var(--basil-2); outline-offset:2px; }
/* ---- segmented toggle ---- */
.seg { display:inline-flex; background:var(--panel); border:1px solid var(--line); border-radius:999px; padding:3px; gap:2px; }
.seg button {
appearance:none; border:0; background:transparent; cursor:pointer; font-family:var(--ui);
font-size:.83rem; font-weight:560; color:var(--muted); padding:6px 15px; border-radius:999px;
transition:color .15s, background .15s;
}
.seg button[aria-pressed="true"] { background:var(--surface); color:var(--ink); box-shadow:var(--shadow); }
.seg button:focus-visible { outline:2px solid var(--basil-2); outline-offset:2px; }
.seg button:disabled { opacity:.38; cursor:not-allowed; }
.row { display:flex; flex-direction:column; gap:6px; margin-bottom:15px; }
.row label { font-size:.82rem; font-weight:560; color:var(--ink); }
.row .sub { color:var(--faint); font-weight:400; }
.row .sub a { color:var(--basil); text-decoration:none; border-bottom:1px solid color-mix(in oklab,var(--basil) 35%,transparent); }
.row .sub a:hover { color:var(--basil-2); }
.field { display:flex; align-items:center; gap:8px; }
input[type=text], input[type=password] {
width:100%; font-family:var(--mono); font-size:.86rem; color:var(--ink);
background:var(--surface); border:1px solid var(--line); border-radius:var(--radius-sm);
padding:10px 12px; transition:border-color .15s, box-shadow .15s;
}
input:focus { outline:0; border-color:var(--basil); box-shadow:0 0 0 3px color-mix(in oklab,var(--basil) 22%,transparent); }
input::placeholder { color:var(--faint); }
.ghost {
appearance:none; flex:none; cursor:pointer; font-family:var(--ui); font-size:.78rem; font-weight:560;
background:var(--panel); color:var(--muted); border:1px solid var(--line);
border-radius:var(--radius-sm); padding:9px 12px; white-space:nowrap; transition:color .15s,border-color .15s;
}
.ghost:hover { color:var(--ink); border-color:var(--faint); }
.ghost:focus-visible { outline:2px solid var(--basil-2); outline-offset:2px; }
/* ---- output ---- */
.card { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); overflow:hidden; }
.card-h { display:flex; align-items:center; gap:10px; padding:13px 16px; border-bottom:1px solid var(--line); background:var(--panel); }
.card-h .dot { width:9px; height:9px; border-radius:50%; background:var(--basil-2); box-shadow:0 0 0 3px color-mix(in oklab,var(--basil) 22%,transparent); flex:none; }
.card-h .ct { font-weight:620; font-size:.92rem; letter-spacing:-.01em; }
.card-h .cf { font-family:var(--mono); font-size:.72rem; color:var(--muted); background:var(--surface); border:1px solid var(--line); padding:3px 8px; border-radius:6px; }
.card-h .tokbadge { margin-left:auto; font-family:var(--mono); font-size:.72rem; font-weight:600; color:var(--basil); background:color-mix(in oklab,var(--basil) 12%,var(--surface)); border:1px solid color-mix(in oklab,var(--basil) 40%,var(--line)); padding:3px 8px; border-radius:6px; }
.block { position:relative; }
.block + .block { border-top:1px solid var(--line); }
.block-lbl { font-family:var(--mono); font-size:.68rem; letter-spacing:.08em; text-transform:uppercase; color:var(--faint); padding:11px 16px 0; }
pre {
margin:0; padding:10px 16px 18px; overflow-x:auto; background:transparent;
font-family:var(--mono); font-size:.8rem; line-height:1.65; color:var(--code-ink);
}
.codewrap { background:var(--code-bg); }
.codewrap pre { color:var(--code-ink); }
.codewrap .block-lbl { color:var(--code-punc); }
.tok-key { color:var(--code-key); }
.tok-str { color:var(--code-str); }
.tok-punc { color:var(--code-punc); }
.tok-cmt { color:var(--code-punc); font-style:italic; }
.copy {
position:absolute; top:9px; right:11px; z-index:2;
appearance:none; cursor:pointer; font-family:var(--ui); font-size:.74rem; font-weight:600;
display:inline-flex; align-items:center; gap:6px;
background:color-mix(in oklab,var(--basil) 16%, var(--code-bg)); color:var(--code-key);
border:1px solid color-mix(in oklab,var(--basil) 40%,transparent); border-radius:7px; padding:5px 10px;
transition:background .15s, color .15s;
}
.copy:hover { background:color-mix(in oklab,var(--basil) 28%, var(--code-bg)); }
.copy:focus-visible { outline:2px solid var(--basil-2); outline-offset:2px; }
.copy.done { color:#fff; background:var(--basil); border-color:var(--basil); }
.copy svg { width:13px; height:13px; }
.notes { padding:14px 16px 16px; font-size:.85rem; color:var(--muted); }
.notes p { margin:0 0 8px; }
.notes p:last-child { margin:0; }
.notes code { font-family:var(--mono); font-size:.82em; background:var(--panel); padding:1px 5px; border-radius:5px; color:var(--ink); }
.notes .warn { color:var(--copper); }
.notes a { color:var(--basil); text-decoration:none; border-bottom:1px solid color-mix(in oklab,var(--basil) 40%,transparent); }
/* ---- docker accordion ---- */
details.docker { margin-top:34px; background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; }
details.docker summary { cursor:pointer; padding:15px 18px; font-weight:600; font-size:.94rem; list-style:none; display:flex; align-items:center; gap:10px; }
details.docker summary::-webkit-details-marker { display:none; }
details.docker summary .chev { margin-left:auto; transition:transform .2s; color:var(--muted); }
details.docker[open] summary .chev { transform:rotate(90deg); }
details.docker .body { padding:0 18px 18px; }
details.docker p { color:var(--muted); font-size:.86rem; margin:4px 0 12px; }
details.docker .codewrap { border-radius:var(--radius-sm); border:1px solid var(--code-line); }
details.docker code { font-family:var(--mono); background:var(--panel); padding:1px 5px; border-radius:5px; font-size:.82em; }
footer { margin-top:40px; padding-top:20px; border-top:1px solid var(--line); color:var(--faint); font-size:.8rem; display:flex; gap:14px; flex-wrap:wrap; align-items:center; }
footer b { color:var(--basil); font-weight:600; }
footer .credit { margin-left:auto; display:inline-flex; align-items:center; gap:9px; }
footer .credit .heart { color:#e0565f; display:inline-flex; }
footer .credit .heart svg { width:13px; height:13px; }
footer .credit .icons { display:inline-flex; align-items:center; gap:11px; }
footer .credit .icons a { color:var(--muted); display:inline-flex; transition:color .15s, transform .1s; }
footer .credit .icons a:hover { color:var(--basil); transform:translateY(-1px); }
footer .credit .icons a:focus-visible { outline:2px solid var(--basil-2); outline-offset:3px; border-radius:3px; }
footer .credit .icons svg { width:16px; height:16px; }
@media (prefers-reduced-motion: reduce){ *{ transition:none !important; } details.docker summary .chev{ transition:none; } }
/* ---- prerequisite step ---- */
.prereq { margin:2px 0 30px; }
.prereq .codewrap { border-radius:var(--radius-sm); border:1px solid var(--code-line); }
.prereq-note { margin:9px 2px 0; font-size:.8rem; color:var(--faint); line-height:1.5; }
.prereq-note:empty { display:none; }
.prereq-note code { font-family:var(--mono); font-size:.82em; background:var(--panel); padding:1px 5px; border-radius:5px; color:var(--muted); }
.methods { display:grid; grid-template-columns:1fr; gap:10px; margin:0 0 14px; }
@media (min-width:560px){ .methods { grid-template-columns:1fr 1fr; max-width:560px; } }
.method {
appearance:none; cursor:pointer; text-align:left; font-family:var(--ui);
background:var(--surface); border:1px solid var(--line); border-radius:var(--radius);
padding:15px 16px; color:var(--ink); display:flex; align-items:center; gap:13px;
transition:border-color .15s, box-shadow .15s, background .15s, transform .05s;
}
.method:hover { border-color:color-mix(in oklab,var(--basil) 45%,var(--line)); }
.method:active { transform:translateY(1px); }
.method .micon { flex:none; width:34px; height:34px; color:var(--faint); display:grid; place-items:center; transition:color .15s; }
.method .micon svg { width:30px; height:30px; }
.method .mtext { display:flex; flex-direction:column; gap:2px; }
.method .mt { font-weight:640; font-size:1rem; letter-spacing:-.01em; }
.method .md { font-size:.79rem; color:var(--muted); }
.method[aria-pressed="true"] { border-color:var(--basil); background:color-mix(in oklab,var(--basil) 10%,var(--surface)); box-shadow:0 0 0 1.5px var(--basil) inset; }
.method[aria-pressed="true"] .micon { color:var(--basil); }
.method:focus-visible { outline:2px solid var(--basil-2); outline-offset:2px; }
/* ---- tool-group chips ---- */
.grouphelp { font-size:.85rem; color:var(--muted); margin:0 0 12px; line-height:1.5; }
.grouphelp code { font-family:var(--mono); font-size:.82em; background:var(--panel); padding:1px 5px; border-radius:5px; color:var(--ink); }
.grouphelp b { color:var(--basil); }
.infoi { display:inline-grid; place-items:center; width:15px; height:15px; border-radius:50%;
border:1px solid var(--faint); color:var(--faint); font-size:.62rem; font-weight:700; font-style:normal;
font-family:var(--mono); vertical-align:middle; }
/* preset packs */
.packs { display:flex; flex-wrap:wrap; gap:7px; margin-bottom:12px; }
.pack {
appearance:none; cursor:pointer; font-family:var(--ui); font-size:.82rem; font-weight:560; color:var(--muted);
background:var(--panel); border:1px solid var(--line); border-radius:999px; padding:6px 13px;
transition:color .15s, border-color .15s, background .15s;
}
.pack:hover { color:var(--ink); border-color:var(--faint); }
.pack[aria-pressed="true"] { color:var(--basil); border-color:var(--basil); background:color-mix(in oklab,var(--basil) 12%,var(--surface)); }
.pack:focus-visible { outline:2px solid var(--basil-2); outline-offset:2px; }
/* group cards */
.groups { display:grid; grid-template-columns:1fr; gap:8px; }
@media (min-width:560px){ .groups { grid-template-columns:1fr 1fr; } }
.grow { position:relative; background:var(--surface); border:1px solid var(--line); border-radius:11px;
display:flex; align-items:center; transition:border-color .15s, background .15s; }
.grow:hover { border-color:color-mix(in oklab,var(--basil) 45%,var(--line)); }
.gsel { appearance:none; cursor:pointer; text-align:left; font-family:var(--ui); color:var(--ink);
background:transparent; border:0; flex:1; min-width:0; display:flex; align-items:center; gap:11px; padding:12px 4px 12px 13px; }
.gsel .box { flex:none; width:17px; height:17px; border-radius:5px; border:1.5px solid var(--faint);
display:grid; place-items:center; transition:background .15s, border-color .15s; }
.gsel .box svg { width:11px; height:11px; opacity:0; color:#1d2021; }
.gsel .gname { font-weight:600; font-size:.92rem; }
.gsel .gc { font-family:var(--mono); font-size:.73rem; color:var(--faint); margin-left:5px; }
.ginfo { appearance:none; cursor:pointer; flex:none; background:transparent; border:0; color:var(--faint);
width:34px; align-self:stretch; border-left:1px solid var(--line); border-radius:0 11px 11px 0;
display:grid; place-items:center; transition:color .15s, background .15s; }
.ginfo:hover { color:var(--basil); background:color-mix(in oklab,var(--basil) 8%,transparent); }
.ginfo svg { width:16px; height:16px; }
.grow[aria-pressed="true"] { border-color:var(--basil); background:color-mix(in oklab,var(--basil) 10%,var(--surface)); }
.grow[aria-pressed="true"] .box { background:var(--basil); border-color:var(--basil); }
.grow[aria-pressed="true"] .box svg { opacity:1; }
.grow[aria-pressed="true"] .gc { color:var(--basil); }
.gsel:focus-visible, .ginfo:focus-visible { outline:2px solid var(--basil-2); outline-offset:-2px; }
/* popover with the full item list */
.pop { position:absolute; top:calc(100% + 6px); left:0; z-index:20;
min-width:100%; width:max-content; max-width:min(360px, 88vw);
background:var(--surface); border:1px solid var(--basil); border-radius:11px;
box-shadow:var(--shadow); padding:12px 14px; max-height:240px; overflow-y:auto; }
.pop h4 { margin:0 0 8px; font-size:.82rem; color:var(--muted); font-weight:600; }
.pop h4 b { color:var(--basil); }
.pop ul { margin:0; padding:0; list-style:none; display:flex; flex-direction:column; gap:3px; }
.pop li { font-family:var(--mono); font-size:.76rem; color:var(--ink); overflow-wrap:anywhere; }
.groupsum { font-size:.82rem; color:var(--faint); margin:12px 0 0; min-height:1.2em; }
.groupsum b { color:var(--basil); }
.tokstat { display:flex; align-items:center; gap:18px; margin:2px 0 14px;
background:linear-gradient(180deg, color-mix(in oklab,var(--basil) 8%,var(--surface)), var(--surface));
border:1px solid color-mix(in oklab,var(--basil) 30%,var(--line)); border-radius:var(--radius); padding:16px 18px; }
.tokstat-num { flex:none; display:flex; flex-direction:column; align-items:center; line-height:1;
min-width:110px; padding-right:18px; border-right:1px solid var(--line); }
.tokstat-num b { font-family:var(--mono); font-size:2.3rem; font-weight:680; color:var(--basil);
letter-spacing:-.02em; font-variant-numeric:tabular-nums; }
.tokstat-num span { font-size:.74rem; color:var(--muted); text-transform:uppercase; letter-spacing:.08em; margin-top:5px; }
.tokstat-body { flex:1; min-width:0; }
.tokstat-lbl { font-size:.86rem; font-weight:600; color:var(--ink); }
#toksave { font-family:var(--mono); font-size:.76rem; font-weight:600; color:var(--basil);
background:color-mix(in oklab,var(--basil) 14%,transparent); padding:1px 7px; border-radius:20px; margin-left:4px; }
#toksave:empty { display:none; }
.tokbar { height:7px; border-radius:20px; background:var(--panel); overflow:hidden; margin:9px 0 8px; }
.tokbar span { display:block; height:100%; border-radius:20px; background:linear-gradient(90deg,var(--basil),var(--basil-2));
transition:width .35s ease; }
.tokstat-desc { font-size:.79rem; color:var(--faint); line-height:1.45; }
.tokjoke { font-size:.79rem; color:var(--copper); line-height:1.45; margin-top:6px; font-style:italic; }
.tokjoke:empty { display:none; }
/* context-mode cards */
.ctxcards { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.ctxcard {
appearance:none; cursor:pointer; text-align:left; font-family:var(--ui); color:var(--ink);
background:var(--surface); border:1px solid var(--line); border-radius:var(--radius-sm);
padding:12px 13px; display:flex; flex-direction:column; gap:6px; min-height:104px;
transition:border-color .15s, background .15s, transform .05s;
}
.ctxcard:hover { border-color:color-mix(in oklab,var(--basil) 45%,var(--line)); }
.ctxcard:active { transform:translateY(1px); }
.ctxcard .cc-top { display:flex; align-items:baseline; justify-content:space-between; gap:6px; }
.ctxcard .cc-name { font-weight:660; font-size:1rem; letter-spacing:-.01em; }
.ctxcard .cc-tok { font-family:var(--mono); font-size:.72rem; color:var(--faint); font-variant-numeric:tabular-nums; }
.ctxcard .cc-desc { font-size:.76rem; color:var(--muted); line-height:1.4; }
.ctxcard[aria-pressed="true"] { border-color:var(--basil); background:color-mix(in oklab,var(--basil) 10%,var(--surface)); box-shadow:0 0 0 1px var(--basil) inset; }
.ctxcard[aria-pressed="true"] .cc-tok { color:var(--basil); }
.ctxcard:focus-visible { outline:2px solid var(--basil-2); outline-offset:2px; }
.step .hint a { color:var(--basil); text-decoration:none; border-bottom:1px solid color-mix(in oklab,var(--basil) 35%,transparent); }
.step .hint a:hover { color:var(--basil-2); }
/* ---- scrollbars (theme-aware) ---- */
* { scrollbar-width:thin; scrollbar-color:color-mix(in oklab,var(--faint) 55%,transparent) transparent; }
::-webkit-scrollbar { width:11px; height:11px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb {
background:color-mix(in oklab,var(--faint) 55%,transparent);
border-radius:9px; border:3px solid transparent; background-clip:padding-box;
}
::-webkit-scrollbar-thumb:hover { background:var(--basil); background-clip:padding-box; border:3px solid transparent; }
::-webkit-scrollbar-corner { background:transparent; }
/* code blocks stay dark in both themes → give them a matching track/thumb */
.codewrap pre { scrollbar-color:color-mix(in oklab,var(--code-punc) 70%,transparent) transparent; }
.codewrap pre::-webkit-scrollbar-thumb { background:color-mix(in oklab,var(--code-punc) 70%,transparent); background-clip:padding-box; border:3px solid transparent; }
.codewrap pre::-webkit-scrollbar-thumb:hover { background:var(--code-key); background-clip:padding-box; border:3px solid transparent; }
</style>
</head>
<body>
<div class="wrap">
<header>
<span class="mark" role="img" aria-label="Pot of food">🍲</span>
<div class="title">
<h1>Better Mealie MCP · Setup Wizard</h1>
<p>Point any AI client at your Mealie. Pick, fill, copy.</p>
</div>
<div class="badges">
<span class="badge"><b>264</b> tools</span>
<span class="badge">FastMCP</span>
<span class="badge">Mealie v3</span>
<a class="badge repo" href="https://github.com/djwmarcx/better-mealie-mcp" title="View this repo on GitHub">
<svg viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82a7.6 7.6 0 0 1 4 0c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z"/></svg>
GitHub
</a>
</div>
</header>
<hr class="rule">
<section class="prereq">
<div class="step"><span class="n">1</span><h2>Install<span class="hint" id="installHint">needs <a href="https://docs.docker.com/get-docker/">Docker</a></span></h2></div>
<div class="methods" id="method" role="group" aria-label="Install method">
<button type="button" class="method" data-v="docker" aria-pressed="true">
<span class="micon"><svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M13.98 11.08h2.12a.19.19 0 0 0 .19-.19V9a.19.19 0 0 0-.19-.19h-2.12a.18.18 0 0 0-.18.19v1.89c0 .1.08.19.18.19m-2.95-5.43h2.12a.19.19 0 0 0 .18-.19V3.57a.19.19 0 0 0-.18-.18h-2.12a.18.18 0 0 0-.19.18v1.89c0 .1.08.18.19.19m0 2.72h2.12a.19.19 0 0 0 .18-.19V6.29a.19.19 0 0 0-.18-.18h-2.12a.18.18 0 0 0-.19.18v1.89c0 .1.08.18.19.19m-2.93 0h2.12a.19.19 0 0 0 .18-.19V6.29a.18.18 0 0 0-.18-.18H8.1a.18.18 0 0 0-.18.18v1.89c0 .1.08.18.18.19m-2.96 0h2.11a.19.19 0 0 0 .19-.19V6.29a.18.18 0 0 0-.19-.18H5.14a.19.19 0 0 0-.19.18v1.89c0 .1.08.18.19.19m5.89 2.71h2.12a.19.19 0 0 0 .18-.18V9a.19.19 0 0 0-.18-.19h-2.12a.18.18 0 0 0-.18.19v1.89c0 .1.08.18.18.18m-2.93 0h2.12a.18.18 0 0 0 .18-.18V9a.18.18 0 0 0-.18-.19H8.1a.18.18 0 0 0-.18.19v1.89c0 .1.08.18.18.18m-2.96 0h2.11a.18.18 0 0 0 .19-.18V9a.18.18 0 0 0-.18-.19H5.14a.19.19 0 0 0-.19.19v1.89c0 .1.09.18.19.18m-2.92 0h2.12a.18.18 0 0 0 .18-.18V9a.18.18 0 0 0-.18-.19H2.22a.18.18 0 0 0-.18.19v1.89c0 .1.08.18.18.18m21.54-1.19c-.06-.05-.67-.51-1.95-.51-.34 0-.68.03-1.01.09-.25-1.7-1.65-2.53-1.72-2.57l-.34-.2-.23.33c-.28.44-.49.92-.61 1.43-.23.97-.09 1.88.4 2.66-.59.33-1.55.41-1.74.42H.75a.75.75 0 0 0-.75.75 11.4 11.4 0 0 0 .69 4.06c.55 1.43 1.36 2.48 2.41 3.12 1.18.72 3.1 1.14 5.28 1.14 1 0 1.99-.09 2.96-.27a12.6 12.6 0 0 0 4.11-1.49 11.3 11.3 0 0 0 2.89-2.61c1.4-1.75 2.23-3.7 2.85-5.43h.25c1.38 0 2.23-.55 2.7-1.02.31-.29.55-.66.71-1.06l.1-.28z"/></svg></span>
<span class="mtext"><span class="mt">Docker</span><span class="md">Run the published image</span></span>
</button>
<button type="button" class="method" data-v="source" aria-pressed="false">
<span class="micon"><svg viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M10.48 1.65a.5.5 0 1 0-.96-.3l-4 13a.5.5 0 0 0 .96.3zM4.85 4.15a.5.5 0 0 1 0 .7L1.71 8l3.14 3.15a.5.5 0 0 1-.7.7l-3.5-3.5a.5.5 0 0 1 0-.7l3.5-3.5a.5.5 0 0 1 .7 0m6.3 0a.5.5 0 0 0 0 .7L14.29 8l-3.14 3.15a.5.5 0 0 0 .7.7l3.5-3.5a.5.5 0 0 0 0-.7l-3.5-3.5a.5.5 0 0 0-.7 0"/></svg></span>
<span class="mtext"><span class="mt">From source</span><span class="md">Clone & uv sync</span></span>
</button>
</div>
<div class="codewrap" style="position:relative">
<button class="copy" type="button" data-copy="install"><svg viewBox="0 0 16 16" fill="none"><path d="M5.5 5.5V3.2c0-.4.3-.7.7-.7h6.6c.4 0 .7.3.7.7v6.6c0 .4-.3.7-.7.7h-2.3M2.5 6.9c0-.4.3-.7.7-.7h6.6c.4 0 .7.3.7.7v6.6c0 .4-.3.7-.7.7H3.2a.7.7 0 0 1-.7-.7z" stroke="currentColor" stroke-width="1.3"/></svg><span>Copy</span></button>
<pre id="installCode"></pre>
</div>
<p class="prereq-note" id="installNote"></p>
</section>
<div class="grid">
<!-- ===== controls ===== -->
<div>
<fieldset>
<div class="step"><span class="n">2</span><h2>Choose your client<span class="hint">where you talk to Claude</span></h2></div>
<div class="clients" id="clients" role="group" aria-label="AI client"></div>
</fieldset>
<fieldset>
<div class="step"><span class="n">3</span><h2>Connection</h2></div>
<div class="row">
<label>Transport <span class="sub">— how the client reaches the server</span></label>
<div class="seg" id="transport" role="group" aria-label="Transport">
<button type="button" data-v="stdio" aria-pressed="true">stdio (local)</button>
<button type="button" data-v="http" aria-pressed="false">HTTP (remote)</button>
</div>
</div>
<div class="row">
<label for="url">Mealie base URL</label>
<input id="url" type="text" spellcheck="false" value="http://localhost:9925" autocomplete="off">
</div>
<div class="row" id="pathRow">
<label for="path">Path to this repo <span class="sub">— where <code style="font-family:var(--mono)">server.py</code> lives</span></label>
<input id="path" type="text" spellcheck="false" value="/path/to/better-mealie-mcp" autocomplete="off">
</div>
<div class="row" id="hostRow" hidden>
<label for="hosturl">Server URL <span class="sub">— where you run the HTTP server</span></label>
<input id="hosturl" type="text" spellcheck="false" value="http://localhost:8000/mcp" autocomplete="off">
</div>
<div class="row">
<label>Authentication</label>
<div class="seg" id="authmode" role="group" aria-label="Auth mode">
<button type="button" data-v="token" aria-pressed="true">API token</button>
<button type="button" data-v="login" aria-pressed="false">Username / password</button>
</div>
</div>
<div class="row" id="tokenRow">
<label for="token">API token <span class="sub">— Mealie → Profile → <a id="tokenLink" href="#" target="_blank" rel="noopener">Manage API Tokens ↗</a></span></label>
<div class="field">
<input id="token" type="password" spellcheck="false" placeholder="paste your long-lived token" autocomplete="off">
<button type="button" class="ghost" id="revToken">Show</button>
</div>
</div>
<div class="row" id="userRow" hidden>
<label for="user">Username / email</label>
<input id="user" type="text" spellcheck="false" placeholder="changeme@example.com" autocomplete="off">
</div>
<div class="row" id="passRow" hidden>
<label for="pass">Password</label>
<div class="field">
<input id="pass" type="password" spellcheck="false" placeholder="MyPassword" autocomplete="off">
<button type="button" class="ghost" id="revPass">Show</button>
</div>
</div>
</fieldset>
</div>
<!-- ===== config / context (row 2, right) ===== -->
<div>
<fieldset>
<div class="step"><span class="n">4</span><h2>Tools & context<span class="hint">trim the toolset and schema detail</span></h2></div>
<div class="tokstat">
<div class="tokstat-num"><b id="tokbig">~61k</b><span>tokens</span></div>
<div class="tokstat-body">
<div class="tokstat-lbl">estimated idle context <span id="toksave"></span></div>
<div class="tokbar"><span id="tokbar"></span></div>
<div class="tokstat-desc" id="ctxsum"></div>
<div class="tokjoke" id="tokjoke"></div>
</div>
</div>
<div class="ctxcards" id="ctx" role="group" aria-label="Context size">
<button type="button" class="ctxcard" data-v="leanest">
<span class="cc-top"><span class="cc-name">Leanest</span><span class="cc-tok" data-mode="leanest"></span></span>
<span class="cc-desc">Aggressive slim, no output schemas. Smallest footprint.</span>
</button>
<button type="button" class="ctxcard" data-v="lean" aria-pressed="true">
<span class="cc-top"><span class="cc-name">Lean</span><span class="cc-tok" data-mode="lean"></span></span>
<span class="cc-desc">Slim schemas, no output schemas. Recommended default.</span>
</button>
<button type="button" class="ctxcard" data-v="full">
<span class="cc-top"><span class="cc-name">Full</span><span class="cc-tok" data-mode="full"></span></span>
<span class="cc-desc">Complete input + output schemas, with result validation.</span>
</button>
</div>
<p class="grouphelp" style="margin-top:20px">All <b id="allcount">259</b> endpoints are exposed by default. Start from a pack, or pick groups (<code>MEALIE_INCLUDE_TAGS</code>) — tap <span class="infoi">i</span> to see everything inside a group:</p>
<div class="packs" id="packs" role="group" aria-label="Presets"></div>
<div class="groups" id="toolgroups" role="group" aria-label="Tool groups"></div>
</fieldset>
</div>
</div>
<!-- ===== copy & run (row 3, full width) ===== -->
<div class="runrow">
<div class="step"><span class="n">5</span><h2>Copy & run</h2></div>
<div class="card">
<div class="card-h">
<span class="dot"></span>
<span class="ct" id="outTitle">Claude Code</span>
<span class="tokbadge" id="tokbadge" title="Estimated idle-context tokens for this config">~61k tok</span>
<span class="cf" id="outFile">terminal</span>
</div>
<div id="output"></div>
<div class="notes" id="notes"></div>
</div>
</div>
<details class="docker">
<summary>🐳 No Mealie yet? Spin one up with Docker
<svg class="chev" width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><path d="M6 4l4 4-4 4" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/></svg>
</summary>
<div class="body">
<p>Runs Mealie v3 on <code>http://localhost:9925</code>. Default admin login: <code>changeme@example.com</code> / <code>MyPassword</code>. Create an API token under Profile → Manage API Tokens, then paste it above.</p>
<div class="codewrap" style="position:relative">
<button class="copy" type="button" data-copy="docker"><svg viewBox="0 0 16 16" fill="none"><path d="M5.5 5.5V3.2c0-.4.3-.7.7-.7h6.6c.4 0 .7.3.7.7v6.6c0 .4-.3.7-.7.7h-2.3M2.5 6.9c0-.4.3-.7.7-.7h6.6c.4 0 .7.3.7.7v6.6c0 .4-.3.7-.7.7H3.2a.7.7 0 0 1-.7-.7z" stroke="currentColor" stroke-width="1.3"/></svg><span>Copy</span></button>
<pre id="dockerCode"></pre>
</div>
</div>
</details>
<footer>
<span>🍲 <b>Better Mealie MCP</b></span>
<span>Every endpoint, generated from the OpenAPI spec via FastMCP.</span>
<span class="credit">
Built with
<span class="heart" aria-hidden="true"><svg viewBox="0 0 16 16" fill="currentColor"><path d="M8 14s-5.5-3.6-5.5-7.3A3 3 0 0 1 8 4.6a3 3 0 0 1 5.5 2.1C13.5 10.4 8 14 8 14z"/></svg></span>
by Marcos Pérez
<span class="icons">
<a href="https://marcx.dev" title="marcx.dev" aria-label="Website"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4"><circle cx="8" cy="8" r="6.5"/><path d="M1.6 8h12.8M8 1.5c1.9 2 1.9 11 0 13M8 1.5c-1.9 2-1.9 11 0 13"/></svg></a>
<a href="https://github.com/djwmarcx" title="GitHub" aria-label="GitHub"><svg viewBox="0 0 16 16" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82a7.6 7.6 0 0 1 4 0c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z"/></svg></a>
<a href="https://www.linkedin.com/in/marcx" title="LinkedIn" aria-label="LinkedIn"><svg viewBox="0 0 16 16" fill="currentColor"><path d="M0 1.146C0 .513.526 0 1.175 0h13.65C15.474 0 16 .513 16 1.146v13.708c0 .633-.526 1.146-1.175 1.146H1.175C.526 16 0 15.487 0 14.854zm4.943 12.248V6.169H2.542v7.225zm-1.2-8.212c.837 0 1.358-.554 1.358-1.248-.015-.709-.52-1.248-1.342-1.248S2.4 3.226 2.4 3.934c0 .694.521 1.248 1.327 1.248zm4.908 8.212V9.359c0-.216.016-.432.08-.586.173-.431.568-.878 1.232-.878.869 0 1.216.662 1.216 1.634v3.865h2.401V9.25c0-2.22-1.184-3.252-2.764-3.252-1.274 0-1.845.7-2.165 1.193v.025h-.016l.016-.025V6.169h-2.4c.03.678 0 7.225 0 7.225z"/></svg></a>
</span>
</span>
</footer>
</div>
<script>
(() => {
"use strict";
const CLIENTS = {
"claude-code": { name:"Claude Code", desc:"Anthropic CLI", file:"terminal", kind:"cmd", http:true },
"claude-desktop": { name:"Claude Desktop", desc:"macOS / Windows app", file:"claude_desktop_config.json", kind:"json", http:false },
"cursor": { name:"Cursor", desc:"~/.cursor/mcp.json", file:"~/.cursor/mcp.json", kind:"json", http:true },
"vscode": { name:"VS Code", desc:".vscode/mcp.json", file:".vscode/mcp.json", kind:"vscode", http:true },
"gemini": { name:"Gemini CLI", desc:"~/.gemini/settings.json", file:"~/.gemini/settings.json", kind:"json", http:true },
"chatgpt": { name:"ChatGPT", desc:"Developer mode connector", file:"connector", kind:"chatgpt", http:true, forceHttp:true },
};
const ALIAS = "better-mealie-mcp"; // MCP server name registered in the client
const DEFPATH = "/path/to/better-mealie-mcp";
const IMAGE = "ghcr.io/djwmarcx/better-mealie-mcp";
// Mealie API groups + tool counts — generated from the spec by gen_tools.py.
const GROUPS = /*GROUPS_START*/[{"tag":"households","count":64,"subs":["shopping","mealplans","lists","items","webhooks","cookbooks","events","notifications","recipe-actions","rules","invitations","recipe","test","self","preferences","trigger","recipes","members","permissions","statistics","email","label-settings","delete","create-bulk","rerun","today","random"],"tools":["create_households_cookbooks","create_households_events_notifications","create_households_events_notifications_by_item_test","create_households_invitations","create_households_invitations_email","create_households_mealplans","create_households_mealplans_random","create_households_mealplans_rules","create_households_recipe_actions","create_households_recipe_actions_by_item_trigger_by_reci","create_households_shopping_items","create_households_shopping_items_create_bulk","create_households_shopping_lists","create_households_shopping_lists_by_item_recipe","create_households_shopping_lists_by_item_recipe_by_rec_2","create_households_shopping_lists_by_item_recipe_by_recip","create_households_webhooks","create_households_webhooks_by_item_test","create_households_webhooks_rerun","delete_households_cookbooks_by_item","delete_households_events_notifications_by_item","delete_households_mealplans_by_item","delete_households_mealplans_rules_by_item","delete_households_recipe_actions_by_item","delete_households_shopping_items","delete_households_shopping_items_by_item","delete_households_shopping_lists_by_item","delete_households_webhooks_by_item","get_households_cookbooks_by_item","get_households_events_notifications_by_item","get_households_mealplans_by_item","get_households_mealplans_rules_by_item","get_households_recipe_actions_by_item","get_households_self_recipes_by_recipe_slug","get_households_shopping_items_by_item","get_households_shopping_lists_by_item","get_households_webhooks_by_item","list_households_cookbooks","list_households_events_notifications","list_households_invitations","list_households_mealplans","list_households_mealplans_rules","list_households_mealplans_today","list_households_members","list_households_preferences","list_households_recipe_actions","list_households_self","list_households_shopping_items","list_households_shopping_lists","list_households_statistics","list_households_webhooks","update_households_cookbooks","update_households_cookbooks_by_item","update_households_events_notifications_by_item","update_households_mealplans_by_item","update_households_mealplans_rules_by_item","update_households_permissions","update_households_preferences","update_households_recipe_actions_by_item","update_households_shopping_items","update_households_shopping_items_by_item","update_households_shopping_lists_by_item","update_households_shopping_lists_by_item_label_settings","update_households_webhooks_by_item"]},{"tag":"recipes","count":43,"subs":["create","bulk-actions","timeline","events","image","export","stream","url","exports","html-or-json","ai","zip","shared","test-scrape-url","bulk","suggestions","duplicate","last-made","assets","comments","tag","settings","categorize","delete","download","purge"],"tools":["create_recipes","create_recipes_bulk_actions_categorize","create_recipes_bulk_actions_delete","create_recipes_bulk_actions_export","create_recipes_bulk_actions_settings","create_recipes_bulk_actions_tag","create_recipes_by_slug_assets","create_recipes_by_slug_duplicate","create_recipes_by_slug_image","create_recipes_create_ai","create_recipes_create_ai_stream","create_recipes_create_html_or_json","create_recipes_create_html_or_json_stream","create_recipes_create_url","create_recipes_create_url_bulk","create_recipes_create_url_stream","create_recipes_create_zip","create_recipes_test_scrape_url","create_recipes_timeline_events","delete_recipes_bulk_actions_export_purge","delete_recipes_by_slug","delete_recipes_by_slug_image","delete_recipes_timeline_events_by_item","get_recipes_by_slug","get_recipes_shared_by_token","get_recipes_timeline_events_by_item","list_recipes","list_recipes_bulk_actions_export","list_recipes_bulk_actions_export_by_export_download","list_recipes_by_slug_comments","list_recipes_by_slug_exports","list_recipes_exports","list_recipes_shared_by_token_zip","list_recipes_suggestions","list_recipes_timeline_events","patch_recipes","patch_recipes_by_slug","patch_recipes_by_slug_last_made","update_recipes","update_recipes_by_slug","update_recipes_by_slug_image","update_recipes_timeline_events_by_item","update_recipes_timeline_events_by_item_image"]},{"tag":"admin","count":38,"subs":["groups","users","backups","households","maintenance","ai-providers","providers","about","clean","email","statistics","check","unlock","password-reset-token","upload","restore","storage","images","temp","recipe-folders","debug","openai"],"tools":["create_admin_backups","create_admin_backups_by_file_name_restore","create_admin_backups_upload","create_admin_debug_openai_by_provider","create_admin_email","create_admin_groups","create_admin_groups_by_group_ai_providers_providers","create_admin_households","create_admin_maintenance_clean_images","create_admin_maintenance_clean_recipe_folders","create_admin_maintenance_clean_temp","create_admin_users","create_admin_users_password_reset_token","create_admin_users_unlock","delete_admin_backups_by_file_name","delete_admin_groups_by_group_ai_providers_providers_by_p","delete_admin_groups_by_item","delete_admin_households_by_item","delete_admin_users_by_item","get_admin_backups_by_file_name","get_admin_groups_by_group_ai_providers_providers_by_prov","get_admin_groups_by_item","get_admin_households_by_item","get_admin_users_by_item","list_admin_about","list_admin_about_check","list_admin_about_statistics","list_admin_backups","list_admin_email","list_admin_groups","list_admin_households","list_admin_maintenance","list_admin_maintenance_storage","list_admin_users","update_admin_groups_by_group_ai_providers_providers_by_p","update_admin_groups_by_item","update_admin_households_by_item","update_admin_users_by_item"]},{"tag":"groups","count":26,"subs":["ai-providers","labels","providers","reports","seeders","settings","households","members","preferences","self","storage","migrations","foods","units"],"tools":["create_groups_ai_providers_providers","create_groups_labels","create_groups_migrations","create_groups_seeders_foods","create_groups_seeders_labels","create_groups_seeders_units","delete_groups_ai_providers_providers_by_provider","delete_groups_labels_by_item","delete_groups_reports_by_item","get_groups_ai_providers_providers_by_provider","get_groups_households_by_household_slug","get_groups_labels_by_item","get_groups_members_by_username_or","get_groups_reports_by_item","list_groups_ai_providers_settings","list_groups_households","list_groups_labels","list_groups_members","list_groups_preferences","list_groups_reports","list_groups_self","list_groups_storage","update_groups_ai_providers_providers_by_provider","update_groups_ai_providers_settings","update_groups_labels_by_item","update_groups_preferences"]},{"tag":"organizers","count":22,"subs":["categories","tags","tools","slug","empty","merge"],"tools":["create_organizers_categories","create_organizers_categories_merge","create_organizers_tags","create_organizers_tags_merge","create_organizers_tools","delete_organizers_categories_by_item","delete_organizers_tags_by_item","delete_organizers_tools_by_item","get_organizers_categories_by_item","get_organizers_categories_slug_by_category_slug","get_organizers_tags_by_item","get_organizers_tags_slug_by_tag_slug","get_organizers_tools_by_item","get_organizers_tools_slug_by_tool_slug","list_organizers_categories","list_organizers_categories_empty","list_organizers_tags","list_organizers_tags_empty","list_organizers_tools","update_organizers_categories_by_item","update_organizers_tags_by_item","update_organizers_tools_by_item"]},{"tag":"users","count":17,"subs":["self","ratings","favorites","api-tokens","register","password","forgot-password","reset-password","image"],"tools":["create_users_api_tokens","create_users_by_id_favorites_by_slug","create_users_by_id_image","create_users_by_id_ratings_by_slug","create_users_forgot_password","create_users_register","create_users_reset_password","delete_users_api_tokens_by_token","delete_users_by_id_favorites_by_slug","get_users_self_ratings_by_recipe","list_users_by_id_favorites","list_users_by_id_ratings","list_users_self","list_users_self_favorites","list_users_self_ratings","update_users_by_item","update_users_password"]},{"tag":"explore","count":15,"subs":["groups","organizers","recipes","foods","households","categories","tags","tools","cookbooks","suggestions"],"tools":["get_explore_groups_by_group_slug_cookbooks_by_item","get_explore_groups_by_group_slug_foods_by_item","get_explore_groups_by_group_slug_households_by_household","get_explore_groups_by_group_slug_organizers_categories_b","get_explore_groups_by_group_slug_organizers_tags_by_item","get_explore_groups_by_group_slug_organizers_tools_by_ite","get_explore_groups_by_group_slug_recipes_by_recipe_slug","list_explore_groups_by_group_slug_cookbooks","list_explore_groups_by_group_slug_foods","list_explore_groups_by_group_slug_households","list_explore_groups_by_group_slug_organizers_categories","list_explore_groups_by_group_slug_organizers_tags","list_explore_groups_by_group_slug_organizers_tools","list_explore_groups_by_group_slug_recipes","list_explore_groups_by_group_slug_recipes_suggestions"]},{"tag":"auth","count":7,"subs":["oauth","token","native","callback","config","refresh","logout"],"tools":["create_auth_logout","create_auth_oauth_native_token","create_auth_refresh","create_auth_token","list_auth_oauth","list_auth_oauth_callback","list_auth_oauth_native_config"]},{"tag":"foods","count":6,"subs":["merge"],"tools":["create_foods","delete_foods_by_item","get_foods_by_item","list_foods","update_foods_by_item","update_foods_merge"]},{"tag":"units","count":6,"subs":["merge"],"tools":["create_units","delete_units_by_item","get_units_by_item","list_units","update_units_by_item","update_units_merge"]},{"tag":"comments","count":5,"subs":[],"tools":["create_comments","delete_comments_by_item","get_comments_by_item","list_comments","update_comments_by_item"]},{"tag":"media","count":5,"subs":["recipes","images","timeline","assets","users","docker","validate.txt"],"tools":["get_media_recipes_by_recipe_assets_by_file_name","get_media_recipes_by_recipe_images_by_file_name","get_media_recipes_by_recipe_images_timeline_by_timeline","get_media_users_by_user_by_file_name","list_media_docker_validate_txt"]},{"tag":"shared","count":4,"subs":["recipes"],"tools":["create_shared_recipes","delete_shared_recipes_by_item","get_shared_recipes_by_item","list_shared_recipes"]},{"tag":"app","count":3,"subs":["about","startup-info","theme"],"tools":["list_app_about","list_app_about_startup_info","list_app_about_theme"]},{"tag":"parser","count":2,"subs":["ingredient","ingredients"],"tools":["create_parser_ingredient","create_parser_ingredients"]},{"tag":"utils","count":1,"subs":["download"],"tools":["list_utils_download"]}]/*GROUPS_END*/;
const TOTAL = GROUPS.reduce((n, g) => n + g.count, 0);
// Per-group wire-char cost by context mode {tag:{leanest,lean,full}} —
// generated from the spec by gen_tools.py. ~4 chars ≈ 1 token.
const COSTS = /*COSTS_START*/{"app":{"leanest":845,"lean":845,"full":3108},"auth":{"leanest":2383,"lean":2439,"full":3029},"users":{"leanest":6945,"lean":7701,"full":16140},"households":{"leanest":94055,"lean":113588,"full":515081},"groups":{"leanest":11522,"lean":12782,"full":31592},"recipes":{"leanest":55020,"lean":67032,"full":159983},"organizers":{"leanest":9549,"lean":10585,"full":33536},"shared":{"leanest":1437,"lean":1577,"full":32397},"comments":{"leanest":2065,"lean":2317,"full":6817},"parser":{"leanest":905,"lean":961,"full":31310},"foods":{"leanest":3126,"lean":3658,"full":12371},"units":{"leanest":3308,"lean":3952,"full":12563},"admin":{"leanest":17914,"lean":19846,"full":72732},"explore":{"leanest":9712,"lean":11392,"full":55623},"media":{"leanest":2282,"lean":2282,"full":2468},"utils":{"leanest":294,"lean":322,"full":338}}/*COSTS_END*/;
const state = {
client:"claude-code",
method:"docker", // docker | source
transport:"stdio",
auth:"token",
url:"http://localhost:9925",
path:"/path/to/better-mealie-mcp",
hosturl:"http://localhost:8000/mcp",
token:"", user:"", pass:"", tags:[], ctx:"lean",
};
const $ = s => document.querySelector(s);
const esc = s => String(s).replace(/[&<>]/g, c => ({ "&":"&","<":"<",">":">" }[c]));
// ---- build client cards ----
const clientsEl = $("#clients");
Object.entries(CLIENTS).forEach(([id, c]) => {
const b = document.createElement("button");
b.type = "button"; b.className = "client"; b.dataset.id = id;
b.setAttribute("aria-pressed", id === state.client);
b.innerHTML = `<span class="cn">${esc(c.name)}</span><span class="cd">${esc(c.desc)}</span>`;
b.addEventListener("click", () => { state.client = id; syncClient(); render(); });
clientsEl.appendChild(b);
});
// ---- preset packs (curated group combos) ----
const has = t => GROUPS.some(g => g.tag === t);
const PACKS = [
{name: "Cooking", tags: ["recipes", "organizers", "foods", "units", "comments", "media"]},
{name: "Meal planning", tags: ["recipes", "households", "organizers", "foods", "units"]},
{name: "Sharing & browse", tags: ["recipes", "explore", "shared", "comments"]},
{name: "Admin & users", tags: ["admin", "groups", "users", "auth"]},
].map(p => ({...p, tags: p.tags.filter(has)}));
function setTags(tags) {
state.tags = tags.slice();
groupsEl.querySelectorAll(".grow").forEach(el =>
el.setAttribute("aria-pressed", state.tags.includes(el.dataset.tag)));
syncPacks();
render();
}
function syncPacks() {
const cur = [...state.tags].sort().join(","); // "" when nothing selected → "All"
packsEl.querySelectorAll(".pack").forEach(el =>
el.setAttribute("aria-pressed", el.dataset.tags === cur));
}
const packsEl = $("#packs");
PACKS.forEach(p => {
const b = document.createElement("button");
b.type = "button"; b.className = "pack"; b.dataset.tags = [...p.tags].sort().join(",");
b.setAttribute("aria-pressed", "false");
b.textContent = p.name;
b.addEventListener("click", () => setTags(state.tags.join(",") === b.dataset.tags ? [] : p.tags));
packsEl.appendChild(b);
});
{ // an "All (no filter)" reset
const b = document.createElement("button");
b.type = "button"; b.className = "pack"; b.dataset.tags = "";
b.textContent = "All"; b.setAttribute("aria-pressed", "true");
b.addEventListener("click", () => setTags([]));
packsEl.appendChild(b);
}
// ---- build tool-group cards (name, count, info popup with every tool) ----
const groupsEl = $("#toolgroups");
$("#allcount").textContent = String(TOTAL);
const CHECK = '<svg viewBox="0 0 16 16" fill="none"><path d="M3 8.5l3.5 3.5L13 4.5" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>';
const INFO = '<svg viewBox="0 0 16 16" fill="currentColor"><path d="M8 1.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13zm0 2.4a.95.95 0 1 1 0 1.9.95.95 0 0 1 0-1.9zM6.9 7h1.9v4.4h.9v1H6.4v-1h.9V8h-.4V7z"/></svg>';
function closePops(except) {
groupsEl.querySelectorAll(".pop").forEach(p => { if (p !== except) p.hidden = true; });
}
GROUPS.forEach(({tag, count, tools}) => {
const card = document.createElement("div");
card.className = "grow"; card.dataset.tag = tag; card.setAttribute("aria-pressed", "false");
const list = (tools || []).map(t => `<li>${esc(t)}</li>`).join("");
card.innerHTML =
`<button type="button" class="gsel">` +
`<span class="box">${CHECK}</span>` +
`<span class="gname">${esc(tag)}<span class="gc">${count}</span></span>` +
`</button>` +
`<button type="button" class="ginfo" aria-label="Show ${esc(tag)} tools">${INFO}</button>` +
`<div class="pop" hidden><h4><b>${esc(tag)}</b> — ${count} tools</h4><ul>${list}</ul></div>`;
const pop = card.querySelector(".pop");
card.querySelector(".gsel").addEventListener("click", () => {
const on = card.getAttribute("aria-pressed") !== "true";
card.setAttribute("aria-pressed", on);
const i = state.tags.indexOf(tag);
if (on && i === -1) state.tags.push(tag); else if (!on && i !== -1) state.tags.splice(i, 1);
syncPacks(); render();
});
card.querySelector(".ginfo").addEventListener("click", (e) => {
e.stopPropagation();
const show = pop.hidden; closePops(pop); pop.hidden = !show;
});
groupsEl.appendChild(card);
});
document.addEventListener("click", (e) => { if (!e.target.closest(".ginfo, .pop")) closePops(null); });
document.addEventListener("keydown", (e) => { if (e.key === "Escape") closePops(null); });
// ---- segmented + inputs ----
function bindSeg(sel, key, after) {
$(sel).querySelectorAll("button").forEach(btn => {
btn.addEventListener("click", () => {
if (btn.disabled) return;
state[key] = btn.dataset.v;
$(sel).querySelectorAll("button").forEach(x => x.setAttribute("aria-pressed", x === btn));
after && after(); render();
});
});
}
bindSeg("#method", "method", syncMethod);
bindSeg("#transport", "transport", syncTransport);
bindSeg("#authmode", "auth", syncAuth);
bindSeg("#ctx", "ctx");
const bindInput = (sel, key) => $(sel).addEventListener("input", e => { state[key] = e.target.value; render(); });
bindInput("#url","url"); bindInput("#path","path"); bindInput("#hosturl","hosturl");
bindInput("#token","token"); bindInput("#user","user"); bindInput("#pass","pass");
const reveal = (btnSel, inSel) => $(btnSel).addEventListener("click", () => {
const i = $(inSel); const show = i.type === "password";
i.type = show ? "text" : "password"; $(btnSel).textContent = show ? "Hide" : "Show";
});
reveal("#revToken","#token"); reveal("#revPass","#pass");
function syncClient() {
clientsEl.querySelectorAll(".client").forEach(b => b.setAttribute("aria-pressed", b.dataset.id === state.client));
const c = CLIENTS[state.client];
const httpBtn = $('#transport button[data-v="http"]');
const stdioBtn = $('#transport button[data-v="stdio"]');
if (c.forceHttp) { state.transport = "http"; httpBtn.disabled = false; stdioBtn.disabled = true; if(state.transport!=="http"){} }
else { stdioBtn.disabled = false; httpBtn.disabled = !c.http; }
if (!c.http && state.transport === "http") state.transport = "stdio";
if (c.forceHttp) state.transport = "http";
$("#transport").querySelectorAll("button").forEach(x => x.setAttribute("aria-pressed", x.dataset.v === state.transport));
syncTransport();
}
function syncMethod() {
$("#installHint").innerHTML = state.method === "docker"
? 'needs <a href="https://docs.docker.com/get-docker/">Docker</a>'
: 'needs Python 3.14+ and <a href="https://docs.astral.sh/uv/">uv</a>';
syncTransport();
}
function syncTransport() {
const stdio = state.transport === "stdio";
// the repo path only matters when running from a source checkout
$("#pathRow").hidden = !stdio || state.method !== "source";
$("#hostRow").hidden = stdio;
}
function syncAuth() {
const tok = state.auth === "token";
$("#tokenRow").hidden = !tok;
$("#userRow").hidden = tok;
$("#passRow").hidden = tok;
}
// ---- env pairs ----
function envPairs() {
const p = [["MEALIE_BASE_URL", state.url || "http://localhost:9925"]];
if (state.auth === "token") p.push(["MEALIE_API_TOKEN", state.token || "YOUR_API_TOKEN"]);
else { p.push(["MEALIE_USERNAME", state.user || "changeme@example.com"]); p.push(["MEALIE_PASSWORD", state.pass || "MyPassword"]); }
if (state.tags.length) p.push(["MEALIE_INCLUDE_TAGS", state.tags.join(",")]);
// Lean is the server default → only emit vars for the other two modes.
if (state.ctx === "leanest") p.push(["MEALIE_SLIM_AGGRESSIVE", "true"]);
else if (state.ctx === "full") { p.push(["MEALIE_SLIM_SCHEMAS", "false"]); p.push(["MEALIE_VALIDATE_OUTPUT", "true"]); }
return p;
}
// Estimated idle-context tokens for the current mode + group selection
// (~4 wire chars ≈ 1 token). COSTS is generated from the spec.
function estimateTokens() {
const mode = state.ctx;
const tags = state.tags.length ? state.tags : Object.keys(COSTS);
const chars = tags.reduce((s, t) => s + ((COSTS[t] && COSTS[t][mode]) || 0), 0);
return Math.round(chars / 4);
}
const fmtK = n => n >= 1000 ? `${(n / 1000).toFixed(n < 10000 ? 1 : 0)}k` : String(n);
function updateContext() {
const full = estimateTokensFor("full");
const cur = estimateTokens();
const save = full > 0 ? Math.round(100 * (full - cur) / full) : 0;
$("#tokbig").textContent = `~${fmtK(cur)}`;
$("#toksave").textContent = (state.ctx !== "full" && save > 0) ? `−${save}% vs Full` : "";
// bar width + a colour that ramps green → amber → orange → red with size
const bar = $("#tokbar");
bar.style.width = MAX_TOKENS > 0 ? `${Math.max(3, Math.round(100 * cur / MAX_TOKENS))}%` : "100%";
const stops = cur >= 150000 ? ["#fb4934", "#cc241d"] // red
: cur >= 120000 ? ["#fe8019", "#fb4934"] // orange→red
: cur >= 80000 ? ["#fabd2f", "#fe8019"] // amber→orange
: ["#8ec07c", "#b8bb26"]; // green
bar.style.background = `linear-gradient(90deg, ${stops[0]}, ${stops[1]})`;
$("#tokbig").style.color = cur >= 120000 ? "#fe8019" : cur >= 80000 ? "#fabd2f" : "";
$("#ctxsum").innerHTML = state.tags.length
? `for the <b>${state.tags.length}</b> selected group${state.tags.length > 1 ? "s" : ""} · ~4 chars ≈ 1 token`
: `for all groups · ~4 chars ≈ 1 token`;
// per-card estimate (reflects current group filter)
document.querySelectorAll(".cc-tok").forEach(el =>
el.textContent = `~${fmtK(estimateTokensFor(el.dataset.mode))} tok`);
const badge = $("#tokbadge");
if (badge) badge.textContent = `~${fmtK(cur)} tok`;
// playful nudge once the context gets heavy
let joke = "";
if (cur >= 150000) joke = "🐘 That's a whole herd of schemas. Your model will need a bigger boat.";
else if (cur >= 120000) joke = "🔥 This context is doing cardio. Consider Lean before it files a complaint.";
else if (cur >= 80000) joke = "😅 That's a chunky context — maybe trim a few groups before your tokens unionize.";
$("#tokjoke").textContent = joke;
}
function estimateTokensFor(mode) {
const tags = state.tags.length ? state.tags : Object.keys(COSTS);
return Math.round(tags.reduce((s, t) => s + ((COSTS[t] && COSTS[t][mode]) || 0), 0) / 4);
}
// Absolute ceiling: every group, Full mode — the bar's 100%.
const MAX_TOKENS = Math.round(Object.keys(COSTS).reduce((s, t) => s + ((COSTS[t] && COSTS[t].full) || 0), 0) / 4);
// ---- method-aware command builders ----
function stdioCmd(env) {
if (state.method === "docker") {
// `-e KEY` (no value) forwards the vars the client sets via `env` below
const args = ["run","-i","--rm"];
env.forEach(([k]) => args.push("-e", k));
args.push(IMAGE);
return { command:"docker", args };
}
return { command:"uv", args:["run","--directory", state.path || DEFPATH,"server.py"] };
}
function stdioShell(env) { // what goes after `--` in `claude mcp add`
if (state.method === "docker")
return `docker run -i --rm ${env.map(([k]) => `-e ${k}`).join(" ")} ${IMAGE}`;
return `uv run --directory ${state.path || DEFPATH} server.py`;
}
function httpStart(env) { // command that starts the HTTP server
const envLine = env.map(([k,v]) => `${k}=${v}`).join(" ");
if (state.method === "docker")
return `docker run --rm -p 8000:8000 \\\n ${env.map(([k,v]) => `-e ${k}=${v}`).join(" \\\n ")} \\\n ${IMAGE} --http 8000`;
return `${envLine} \\\n uv run --directory ${state.path || DEFPATH} server.py --http 8000`;
}
// ---- syntax-highlight helpers ----
// Single-pass: the replacer output is never re-scanned, so injected <span>
// markup can't be matched again (the bug that leaked "tok-punc" into text).
const hlJson = obj => JSON.stringify(obj, null, 2)
.replace(/[&<>]/g, c => ({ "&":"&","<":"<",">":">" }[c]))
.replace(/("(?:[^"\\]|\\.)*")(\s*:)?/g, (m, str, colon) =>
colon ? `<span class="tok-key">${str}</span>${colon}`
: `<span class="tok-str">${str}</span>`);
// ---- config generators ----
function genConfig() {
const c = CLIENTS[state.client];
const env = envPairs();
const blocks = [];
// HTTP transport needs the server running first (except pure remote)
if (state.transport === "http") {
blocks.push({
lbl:"1 · start the HTTP server", code:true,
html: hlShell(httpStart(env))
});
}
if (state.client === "claude-code") {
if (state.transport === "stdio") {
const flags = env.map(([k,v]) => `-e ${k}=${v}`).join(" \\\n ");
blocks.push({ lbl:"run in terminal", code:true, html: hlShell(
`claude mcp add ${ALIAS} -s user \\\n ${flags} \\\n -- ${stdioShell(env)}`) });
} else {
blocks.push({ lbl:"2 · register the URL", code:true, html: hlShell(
`claude mcp add --transport http ${ALIAS} ${state.hosturl || "http://localhost:8000/mcp"}`) });
}
}
else if (state.client === "vscode") {
const server = state.transport === "stdio"
? { type:"stdio", ...stdioCmd(env), env:Object.fromEntries(env) }
: { type:"http", url:state.hosturl || "http://localhost:8000/mcp" };
blocks.push({ lbl:c.file, code:true, json:true, html: hlJson({ servers:{ [ALIAS]:server } }) });
}
else if (state.client === "chatgpt") {
blocks.push({ lbl:"connector URL", code:true, html: hlShell(state.hosturl || "http://localhost:8000/mcp") });
}
else { // claude-desktop, cursor, gemini → mcpServers JSON
const server = state.transport === "stdio"
? { ...stdioCmd(env), env:Object.fromEntries(env) }
: { url:state.hosturl || "http://localhost:8000/mcp" };
const key = state.transport === "stdio" ? "mcpServers"
: (state.client === "gemini" ? "mcpServers" : "mcpServers");
const label = state.transport === "http" ? c.file + " (add url entry)" : c.file;
blocks.push({ lbl:label, code:true, json:true, html: hlJson({ [key]:{ [ALIAS]:server } }) });
}
return blocks;
}
function hlShell(str) {
// One pass, alternation ordered keyword | flag | assignment. Output is not
// re-scanned, so highlighting never matches inside its own injected spans.
return esc(str).replace(
/(\b(?:git|claude|uvx|uv|npx|docker|run|cd)\b)|((?:^|\s)--?[A-Za-z][\w-]*)|(=)([^\s\\]+)/g,
(m, kw, flag, eq, val) => {
if (kw) return `<span class="tok-key">${kw}</span>`;
if (flag) return flag.replace(/(--?[A-Za-z][\w-]*)/, '<span class="tok-punc">$1</span>');
if (eq) return `${eq}<span class="tok-str">${val}</span>`;
return m;
});
}
function genNotes() {
const c = CLIENTS[state.client];
const n = [];
if (state.client === "claude-code") n.push(`Run the command, then <code>claude mcp list</code> — you want <b>${ALIAS} ✔ Connected</b>. Drop <code>-s user</code> to scope it to the current project only.`);
if (state.client === "claude-desktop") n.push(`Merge into <code>${c.file}</code>, then fully quit and reopen Claude Desktop. stdio only — Desktop can't reach an HTTP server.`);
if (state.client === "cursor") n.push(`Save to <code>~/.cursor/mcp.json</code> (global) or <code>.cursor/mcp.json</code> in a project, then toggle the server on in Settings → MCP.`);
if (state.client === "vscode") n.push(`Note the top-level key is <code>servers</code>, not <code>mcpServers</code>. Save to <code>.vscode/mcp.json</code> and start it from the MCP view.`);
if (state.client === "gemini") n.push(`Merge into <code>~/.gemini/settings.json</code>, then restart the Gemini CLI. Verify with <code>/mcp</code>.`);
if (state.client === "chatgpt") n.push(`<span class="warn">ChatGPT connectors are remote-only.</span> Run the HTTP server on a host ChatGPT can reach (public HTTPS via a reverse proxy or tunnel), then add the URL under Settings → Connectors in developer mode.`);
if (state.method === "docker" && /localhost|127\.0\.0\.1/.test(state.url)) n.push(`<span class="warn">Docker can't reach <code>localhost</code> on your machine.</span> If Mealie runs on this host, use <code>http://host.docker.internal:9925</code> (macOS/Windows) or your host's LAN IP (Linux) as the Mealie base URL.`);
if (state.transport === "http") n.push(`Keep the server process running — the client connects to it over HTTP at <code>${esc(state.hosturl||"http://localhost:8000/mcp")}</code>.`);
if (state.auth === "token") n.push(state.token ? `Token embedded above.` : `No token entered yet — the placeholder <code>YOUR_API_TOKEN</code> is shown. Paste yours to bake it in.`);
else n.push(`Server logs in with these credentials at startup to fetch a token. An API token is preferred for anything long-lived.`);
return n.map(x => `<p>${x}</p>`).join("");
}
// ---- render ----
function render() {
const c = CLIENTS[state.client];
$("#outTitle").textContent = c.name;
$("#outFile").textContent = state.transport === "http" && c.file !== "connector" ? c.file + " · http" : c.file;
// Deep-link the token hint straight to this Mealie's token page.
const base = (state.url || "http://localhost:9925").replace(/\/+$/, "");
$("#tokenLink").href = base + "/user/profile/api-tokens";
const blocks = genConfig();
const out = $("#output");
out.innerHTML = blocks.map((b, i) => `
<div class="block ${b.code ? "codewrap" : ""}">
<button class="copy" type="button" data-block="${i}">
<svg viewBox="0 0 16 16" fill="none"><path d="M5.5 5.5V3.2c0-.4.3-.7.7-.7h6.6c.4 0 .7.3.7.7v6.6c0 .4-.3.7-.7.7h-2.3M2.5 6.9c0-.4.3-.7.7-.7h6.6c.4 0 .7.3.7.7v6.6c0 .4-.3.7-.7.7H3.2a.7.7 0 0 1-.7-.7z" stroke="currentColor" stroke-width="1.3"/></svg>
<span>Copy</span>
</button>
<div class="block-lbl">${esc(b.lbl)}</div>
<pre>${b.html}</pre>
</div>`).join("");
// store raw text for copy
out.querySelectorAll(".block").forEach((el, i) => {
el.querySelector("pre").dataset.raw = stripTags(blocks[i].html);
});
out.querySelectorAll(".copy").forEach(btn => {
btn.addEventListener("click", () => {
const pre = btn.parentElement.querySelector("pre");
copyText(pre.dataset.raw, btn);
});
});
$("#notes").innerHTML = genNotes();
renderInstall();
renderDocker();
updateContext();
}
function renderInstall() {
const code = state.method === "docker"
? `docker pull ${IMAGE}`
: "git clone https://github.com/djwmarcx/better-mealie-mcp\ncd better-mealie-mcp\nuv sync";
const pre = $("#installCode");
pre.innerHTML = hlShell(code);
pre.dataset.raw = code;
$("#installNote").innerHTML = state.method === "docker"
? "Optional — <code>docker run</code> pulls the image on first use. Pre-pulling just avoids a slow first launch (which can trip an MCP client's startup timeout)."
: "";
const btn = document.querySelector('[data-copy="install"]');
if (btn && !btn._bound) { btn._bound = true; btn.addEventListener("click", () => copyText(pre.dataset.raw, btn)); }
}
function renderDocker() {
const code = `docker run -d --name mealie -p 9925:9000 \\\n -e ALLOW_SIGNUP=true -e BASE_URL=http://localhost:9925 -e TZ=UTC \\\n ghcr.io/mealie-recipes/mealie:latest`;
$("#dockerCode").innerHTML = hlShell(code);
const btn = document.querySelector('[data-copy="docker"]');
if (btn && !btn._bound) { btn._bound = true; btn.addEventListener("click", () => copyText(code, btn)); }
}
const stripTags = html => { const d = document.createElement("div"); d.innerHTML = html; return d.textContent; };
function copyText(text, btn) {
const done = () => {
btn.classList.add("done");
const span = btn.querySelector("span"); const old = span ? span.textContent : "";
if (span) span.textContent = "Copied";
setTimeout(() => { btn.classList.remove("done"); if (span) span.textContent = old || "Copy"; }, 1400);
};
if (navigator.clipboard && navigator.clipboard.writeText) navigator.clipboard.writeText(text).then(done).catch(fallback);
else fallback();
function fallback() {
const ta = document.createElement("textarea"); ta.value = text; ta.style.position="fixed"; ta.style.opacity="0";
document.body.appendChild(ta); ta.select(); try { document.execCommand("copy"); } catch(e){} ta.remove(); done();
}
}
syncClient(); syncMethod(); syncAuth(); syncPacks(); render();
})();
</script>
</body>
</html>