-
-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathindex.html
More file actions
1227 lines (1105 loc) · 51.5 KB
/
index.html
File metadata and controls
1227 lines (1105 loc) · 51.5 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
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>toMCP - Turn Any Website into an MCP Server</title>
<meta name="description" content="Convert any website URL into an MCP server config. Works with Cursor, Claude, Windsurf, VS Code, and Cline. Chat with any website using AI.">
<!-- Favicon -->
<link rel="icon" type="image/svg+xml" href="./logowhite.svg">
<link rel="icon" type="image/png" href="./logo.png">
<link rel="shortcut icon" href="./logo.png">
<link rel="apple-touch-icon" href="./logo.png">
<!-- Open Graph / Social Media -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://tomcp.org/">
<meta property="og:title" content="toMCP - Turn Any Website into an MCP Server">
<meta property="og:description" content="Convert any website URL into an MCP server config for AI tools. Chat with any website using AI.">
<meta property="og:image" content="https://tomcp.org/logoblack.png">
<meta property="og:image:width" content="512">
<meta property="og:image:height" content="512">
<!-- Twitter Card -->
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="toMCP - Turn Any Website into an MCP Server">
<meta name="twitter:description" content="Convert any website URL into an MCP server config for AI tools. Chat with any website using AI.">
<meta name="twitter:image" content="https://tomcp.org/logoblack.png">
<!-- SEO -->
<link rel="canonical" href="https://tomcp.org/">
<meta name="robots" content="index, follow">
<meta name="keywords" content="MCP, Model Context Protocol, AI tools, Cursor, Claude, Windsurf, VS Code, Cline, website to MCP, documentation AI">
<!-- Structured Data -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebApplication",
"name": "toMCP",
"url": "https://tomcp.org",
"description": "Convert any website URL into an MCP server config for AI tools like Cursor, Claude, Windsurf, VS Code, and Cline.",
"applicationCategory": "DeveloperApplication",
"operatingSystem": "Any",
"offers": {
"@type": "Offer",
"price": "0",
"priceCurrency": "USD"
}
}
</script>
<script src="https://cdn.tailwindcss.com"></script>
<script>
tailwindcss.config = {
theme: {
extend: {
colors: {
gray: {
900: '#111111',
800: '#1a1a1a',
700: '#2a2a2a',
600: '#3a3a3a',
500: '#6b7280',
400: '#9ca3af',
}
}
}
}
}
</script>
<style>
body { background: #000; }
.blur-effect {
filter: blur(150px);
opacity: 0.15;
}
/* Chat scrollbar */
#chatMessages::-webkit-scrollbar,
#fullscreenMessages::-webkit-scrollbar {
width: 6px;
}
#chatMessages::-webkit-scrollbar-track,
#fullscreenMessages::-webkit-scrollbar-track {
background: transparent;
}
#chatMessages::-webkit-scrollbar-thumb,
#fullscreenMessages::-webkit-scrollbar-thumb {
background: #374151;
border-radius: 3px;
}
#chatMessages::-webkit-scrollbar-thumb:hover,
#fullscreenMessages::-webkit-scrollbar-thumb:hover {
background: #4b5563;
}
/* Message animation */
#chatMessages > div,
#fullscreenMessages > div {
animation: fadeIn 0.2s ease-out;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(8px); }
to { opacity: 1; transform: translateY(0); }
}
/* Mobile-only styles */
@media (max-width: 639px) {
.mobile-logo {
width: 180px !important;
height: 180px !important;
margin-top: -2rem !important;
margin-bottom: -5rem !important;
}
.mobile-title {
font-size: 1.75rem !important;
}
.mobile-description {
font-size: 1.125rem !important;
white-space: normal !important;
padding-left: 1rem;
padding-right: 1rem;
}
.mobile-examples-label {
font-size: 1rem !important;
}
.mobile-examples {
font-size: 1rem !important;
}
.mobile-input-container {
flex-direction: column !important;
}
.mobile-input-container > input {
width: 100% !important;
}
.mobile-input-buttons {
display: flex !important;
width: 100% !important;
gap: 0.5rem;
}
.mobile-input-buttons > * {
flex: 1 !important;
}
.mobile-tools-grid {
grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}
.mobile-fullscreen-input-row {
flex-direction: column !important;
gap: 0.5rem !important;
}
.mobile-fullscreen-input-row > input {
width: 100% !important;
}
.mobile-fullscreen-input-row > select {
width: 100% !important;
}
.mobile-fullscreen-input-row > button {
width: 100% !important;
}
}
</style>
</head>
<body class="min-h-screen text-white antialiased">
<!-- Background Effects -->
<div class="fixed inset-0 overflow-hidden pointer-events-none">
<div class="absolute -top-40 left-1/4 w-[500px] h-[500px] bg-blue-500 rounded-full blur-effect"></div>
<div class="absolute top-60 right-1/4 w-[400px] h-[400px] bg-purple-500 rounded-full blur-effect"></div>
</div>
<div class="relative max-w-6xl mx-auto px-4 pt-2 pb-16">
<!-- Header -->
<header class="text-center mb-6">
<!-- Big Logo + Title (no gap) -->
<div class="flex flex-col items-center">
<img src="/logo.png" alt="toMCP Logo" class="mobile-logo w-[280px] h-[280px] -mt-12 -mb-28">
<h1 class="mobile-title text-4xl font-semibold text-white tracking-tight mt-2 mb-3">toMCP</h1>
</div>
<!-- Clear explanation -->
<p class="mobile-description text-3xl text-gray-300 mb-6 mx-auto whitespace-nowrap">Convert any website or documentation into an MCP server for your AI tools</p>
<!-- Examples -->
<div class="mb-4">
<p class="mobile-examples-label text-gray-400 text-xl mb-3">add tomcp.org/ before any url and subdomain</p>
<div class="mobile-examples flex flex-col items-center gap-2 text-2xl font-mono">
<span><span class="text-white">tomcp.org/</span><span class="text-blue-400">your-docs.com</span></span>
<span><span class="text-white">tomcp.org/</span><span class="text-blue-400">https://example.com/docs</span></span>
</div>
</div>
<!-- OR divider -->
<div class="flex items-center gap-4 max-w-sm mx-auto mb-4">
<div class="flex-1 h-px bg-gray-800"></div>
<span class="text-gray-500 text-lg">or</span>
<div class="flex-1 h-px bg-gray-800"></div>
</div>
<!-- URL Input -->
<div class="max-w-2xl mx-auto">
<p class="text-gray-400 text-sm mb-3">Paste your URL here:</p>
<div class="mobile-input-container flex gap-2">
<input
type="text"
id="urlInput"
placeholder="docs.stripe.com"
class="flex-1 px-4 py-3 bg-gray-900/50 border border-gray-800 rounded-lg text-white placeholder:text-gray-500 focus:ring-2 focus:ring-blue-500 focus:border-blue-500 focus:outline-none transition-all"
>
<div class="mobile-input-buttons contents">
<button
id="tryExample"
class="px-4 py-3 rounded-lg bg-white hover:bg-gray-100 text-black font-medium transition-colors whitespace-nowrap"
>
Try Example
</button>
</div>
</div>
</div>
</header>
<div class="mb-6 flex justify-center gap-3 lg:hidden">
<a class="github-button" href="https://github.com/ami3466/tomcp" data-color-scheme="no-preference: dark_dimmed; light: light_high_contrast; dark: dark;" data-icon="octicon-star" data-size="large" data-show-count="true" aria-label="Star ami3466/tomcp on GitHub">Star</a>
<a class="github-button" href="https://github.com/ami3466/tomcp#readme" data-color-scheme="no-preference: dark_dimmed; light: light_high_contrast; dark: dark;" data-icon="octicon-book" data-size="large" aria-label="Readme for ami3466/tomcp on GitHub">Readme</a>
</div>
<!-- Side by Side: MCP Config + Chat -->
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6 mb-8">
<!-- Left: MCP Config -->
<main id="mcpSection" class="bg-gray-900/50 border border-gray-800 rounded-xl p-4 backdrop-blur-sm">
<div class="flex items-center gap-2 mb-4">
<svg class="w-5 h-5 text-green-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"/>
</svg>
<h3 class="text-white font-semibold text-lg">MCP Config</h3>
</div>
<!-- AI Tools Tabs -->
<div class="mb-4">
<label class="block text-xs font-medium text-gray-400 mb-2">Select your AI tool</label>
<div id="toolsGrid" class="mobile-tools-grid grid grid-cols-7 gap-1.5">
<!-- Tools will be inserted here -->
</div>
</div>
<!-- Output Section -->
<div id="outputSection" class="hidden space-y-3">
<div class="flex items-center justify-between">
<div>
<label class="block text-sm font-medium text-white">Config for <span id="toolName">Cursor</span></label>
<p id="configPath" class="text-gray-500 text-xs font-mono">~/.cursor/mcp.json</p>
</div>
<button
id="copyBtn"
class="flex items-center gap-2 px-3 py-1.5 bg-white text-black hover:bg-gray-100 rounded-lg text-xs font-medium transition-colors"
>
<svg id="copyIcon" class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<rect x="9" y="9" width="13" height="13" rx="2" stroke-width="2"/>
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" stroke-width="2"/>
</svg>
<span id="copyText">Copy</span>
</button>
</div>
<pre id="codeBlock" class="bg-gray-900/50 border border-gray-800 rounded-lg p-3 overflow-x-auto text-xs">
<code class="text-green-400"></code>
</pre>
<!-- How to Use (collapsed) -->
<details class="bg-gray-800/30 border border-gray-700 rounded-lg">
<summary class="text-white font-medium p-3 cursor-pointer flex items-center gap-2 text-sm">
<svg class="w-4 h-4 text-yellow-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"/>
</svg>
How to use
</summary>
<ol class="text-gray-400 text-xs space-y-1.5 list-decimal list-inside px-3 pb-3">
<li>Copy the config above</li>
<li>Open <code id="stepConfigPath" class="text-gray-300 bg-gray-800 px-1 py-0.5 rounded text-xs">~/.cursor/mcp.json</code></li>
<li>Add or merge into your mcpServers</li>
<li>Restart <span id="stepToolName">Cursor</span></li>
</ol>
</details>
<a
href="https://flowengine.cloud/mcp-merge"
target="_blank"
rel="noopener noreferrer"
class="inline-flex items-center gap-1.5 text-blue-400 hover:text-blue-300 text-xs transition-colors"
>
<svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"/>
</svg>
MCP Merge Tool
</a>
</div>
<!-- Empty State -->
<div id="emptyState" class="text-center py-12 text-gray-500">
<svg class="w-10 h-10 mx-auto mb-3 opacity-50" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<circle cx="12" cy="12" r="10" stroke-width="2"/>
<path stroke-width="2" d="M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/>
</svg>
<p class="text-sm">Paste a URL above to generate config</p>
</div>
</main>
<!-- Right: Chat -->
<div id="chatSection" class="bg-gradient-to-br from-blue-900/20 via-purple-900/20 to-pink-900/20 border border-blue-500/30 rounded-xl p-5 flex flex-col">
<div class="flex items-center gap-2 mb-4">
<svg class="w-5 h-5 text-blue-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"/>
</svg>
<h3 class="text-white font-semibold text-lg">Chat with Website</h3>
<span id="chatUrlBadge" class="hidden ml-2 text-xs bg-blue-600/30 text-blue-300 px-2 py-0.5 rounded-full truncate max-w-[120px]"></span>
<button id="fullscreenBtn" class="ml-auto p-1.5 rounded-lg hover:bg-white/10 text-gray-400 hover:text-white transition-colors" title="Fullscreen">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4"/>
</svg>
</button>
</div>
<!-- Chat Messages Area - Fixed height with scroll -->
<div id="chatMessages" class="h-[350px] bg-gray-900/50 border border-gray-700 rounded-lg p-4 overflow-y-auto space-y-4">
<!-- Empty state shown initially -->
<div id="chatEmptyState" class="h-full flex flex-col items-center justify-center text-gray-400">
<svg class="w-12 h-12 mb-3 opacity-40" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"/>
</svg>
<p class="text-sm text-center mb-4">Paste a URL above to start chatting<br><span class="text-xs text-gray-500">Ask questions about any website's content</span></p>
<button
id="startChatBtn"
disabled
class="px-6 py-2.5 rounded-lg bg-blue-600 hover:bg-blue-500 text-white font-medium transition-colors disabled:opacity-40 disabled:cursor-not-allowed"
>
Start Chat
</button>
</div>
</div>
<!-- Chat Input -->
<div id="chatInputArea" class="mt-4">
<div class="flex gap-2">
<input
type="text"
id="chatInput"
placeholder="Paste a URL above first..."
disabled
class="flex-1 px-4 py-2.5 bg-gray-900/50 border border-gray-700 rounded-lg text-white placeholder:text-gray-500 focus:ring-2 focus:ring-blue-500 focus:border-blue-500 focus:outline-none transition-all disabled:opacity-50 disabled:cursor-not-allowed"
>
<button
id="chatSendBtn"
disabled
class="px-4 py-2.5 bg-blue-600 hover:bg-blue-500 text-white font-medium transition-colors rounded-lg flex items-center disabled:opacity-50 disabled:cursor-not-allowed"
>
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 12h14M12 5l7 7-7 7"/>
</svg>
</button>
</div>
<!-- Model Selector -->
<div class="mt-2">
<select id="modelSelect" class="w-full px-3 py-2 bg-gray-900/50 border border-gray-700 rounded-lg text-gray-300 text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500 focus:outline-none cursor-pointer">
<!-- Options will be inserted here by JS -->
</select>
</div>
<!-- API Key Section -->
<div id="apiKeySection" class="mt-3 hidden">
<div class="bg-gray-800/50 border border-gray-700 rounded-lg p-3 space-y-2">
<!-- How to get API key (collapsed) -->
<details class="bg-gray-900/30 border border-gray-700 rounded-lg">
<summary class="text-blue-400 hover:text-blue-300 font-medium p-2.5 cursor-pointer flex items-center gap-2 text-xs">
<svg class="w-4 h-4 text-blue-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"/>
</svg>
Add API key from Cloudflare Workers AI to use all models
</summary>
<div class="px-3 pb-3">
<ol class="text-gray-400 text-xs space-y-2 list-decimal list-inside">
<li>Go to <a href="https://dash.cloudflare.com/profile/api-tokens" target="_blank" class="text-blue-400 hover:text-blue-300 underline">Cloudflare API Tokens</a></li>
<li>Click <strong class="text-white">"Create Token"</strong></li>
<li>Click <strong class="text-white">"Get started"</strong> under Custom Token</li>
<li>Add permissions:
<ul class="ml-4 mt-1 space-y-0.5 list-disc list-inside text-gray-500">
<li>Account → Account Settings → <strong class="text-gray-300">Read</strong></li>
<li>Account → Workers AI → <strong class="text-gray-300">Edit</strong></li>
</ul>
</li>
<li>Under Account Resources, select <strong class="text-white">your account</strong></li>
<li>Click <strong class="text-white">"Continue to summary"</strong> → <strong class="text-white">"Create Token"</strong></li>
<li>Copy the token and paste it below</li>
</ol>
<p class="text-yellow-500/80 text-xs mt-2 flex items-center gap-1">
<svg class="w-3 h-3" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z" clip-rule="evenodd"/>
</svg>
Note: Use an API Token, not the Global API Key
</p>
</div>
</details>
<div id="apiKeyInputArea" class="flex gap-2">
<input
type="password"
id="apiKeyInput"
placeholder="Paste your API token here..."
class="flex-1 px-3 py-2 bg-gray-900/50 border border-gray-700 rounded-lg text-white text-sm placeholder:text-gray-500 focus:ring-2 focus:ring-blue-500 focus:border-blue-500 focus:outline-none transition-all"
>
<button
id="saveApiKeyBtn"
class="px-4 py-2 rounded-lg bg-blue-600 hover:bg-blue-500 text-white text-sm font-medium transition-colors"
>
Save
</button>
</div>
<div id="apiKeySavedArea" class="hidden flex items-center justify-between">
<span class="text-green-400 text-sm flex items-center gap-1.5">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"/>
</svg>
API key saved - all models unlocked
</span>
<button
id="clearApiKeyBtn"
class="px-3 py-1.5 rounded-lg bg-gray-700 hover:bg-gray-600 text-white text-xs font-medium transition-colors"
>
Remove
</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="mb-8 hidden lg:flex justify-center gap-3">
<a class="github-button" href="https://github.com/ami3466/tomcp" data-color-scheme="no-preference: dark_dimmed; light: light_high_contrast; dark: dark;" data-icon="octicon-star" data-size="large" data-show-count="true" aria-label="Star ami3466/tomcp on GitHub">Star</a>
<a class="github-button" href="https://github.com/ami3466/tomcp#readme" data-color-scheme="no-preference: dark_dimmed; light: light_high_contrast; dark: dark;" data-icon="octicon-book" data-size="large" aria-label="Readme for ami3466/tomcp on GitHub">Readme</a>
</div>
<!-- Fullscreen Chat Modal -->
<div id="fullscreenModal" class="fixed inset-0 bg-black/95 z-50 hidden flex-col p-4">
<div class="flex items-center justify-between mb-4">
<div class="flex items-center gap-2">
<svg class="w-6 h-6 text-blue-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"/>
</svg>
<h2 class="text-white font-semibold text-xl">Chat with Website</h2>
<span id="fullscreenUrlBadge" class="ml-2 text-sm bg-blue-600/30 text-blue-300 px-3 py-1 rounded-full"></span>
</div>
<button id="closeFullscreenBtn" class="p-2 rounded-lg hover:bg-white/10 text-gray-400 hover:text-white transition-colors">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
</svg>
</button>
</div>
<!-- Fullscreen Messages Area -->
<div id="fullscreenMessages" class="flex-1 bg-gray-900/50 border border-gray-700 rounded-lg p-4 overflow-y-auto space-y-4 mb-4"></div>
<!-- Fullscreen Input -->
<div class="mobile-fullscreen-input-row flex gap-2">
<select id="fullscreenModelSelect" class="px-3 py-3 bg-gray-900/50 border border-gray-700 rounded-lg text-white text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500 focus:outline-none">
<!-- Options synced by JS -->
</select>
<input
type="text"
id="fullscreenInput"
placeholder="Type your message..."
class="flex-1 px-4 py-3 bg-gray-900/50 border border-gray-700 rounded-lg text-white placeholder:text-gray-500 focus:ring-2 focus:ring-blue-500 focus:border-blue-500 focus:outline-none transition-all text-lg"
>
<button
id="fullscreenSendBtn"
class="px-6 py-3 rounded-lg bg-blue-600 hover:bg-blue-500 text-white font-medium transition-colors flex items-center justify-center gap-2"
>
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 19l9 2-9-18-9 18 9-2zm0 0v-8"/>
</svg>
Send
</button>
</div>
</div>
<!-- Comparison Table -->
<div class="mb-12">
<!-- Comparison Table - full width like the grid above -->
<div class="bg-gray-900/50 border border-gray-700 rounded-2xl p-8">
<h3 class="text-2xl font-semibold text-white mb-6 text-center">web_fetch vs MCP Resources</h3>
<div class="overflow-x-auto">
<table class="w-full">
<thead>
<tr class="border-b-2 border-gray-600">
<th class="text-left py-4 px-4 text-gray-400 text-lg font-medium"></th>
<th class="text-center py-4 px-6 text-gray-400 text-lg font-medium">web_fetch</th>
<th class="text-center py-4 px-6 text-lg font-medium text-green-400">MCP Resource</th>
</tr>
</thead>
<tbody class="text-lg">
<tr class="border-b border-gray-700/50">
<td class="py-5 px-4 text-gray-300 font-medium">Data Quality</td>
<td class="py-5 px-6 text-center text-gray-400">Raw HTML with noise</td>
<td class="py-5 px-6 text-center text-green-400 font-medium">Clean markdown</td>
</tr>
<tr class="border-b border-gray-700/50">
<td class="py-5 px-4 text-gray-300 font-medium">Token Usage</td>
<td class="py-5 px-6 text-center text-gray-400">High</td>
<td class="py-5 px-6 text-center text-green-400 font-medium">Low</td>
</tr>
<tr class="border-b border-gray-700/50">
<td class="py-5 px-4 text-gray-300 font-medium">Persistence</td>
<td class="py-5 px-6 text-center text-gray-400">Per-request only</td>
<td class="py-5 px-6 text-center text-green-400 font-medium">Always available</td>
</tr>
<tr class="border-b border-gray-700/50">
<td class="py-5 px-4 text-gray-300 font-medium">Hallucination Risk</td>
<td class="py-5 px-6 text-center text-gray-400">Higher</td>
<td class="py-5 px-6 text-center text-green-400 font-medium">Lower</td>
</tr>
<tr>
<td class="py-5 px-4 text-gray-300 font-medium">JavaScript Support</td>
<td class="py-5 px-6 text-center text-green-400 font-medium">Full (SPAs / Dynamic)</td>
<td class="py-5 px-6 text-center text-gray-400">Static only (SSG)</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<!-- Footer -->
<footer class="text-center text-gray-500 text-sm">
<p>
<a href="https://modelcontextprotocol.io" target="_blank" class="text-blue-400 hover:text-blue-300">What is MCP?</a>
· Built with
<a href="https://flowengine.cloud" target="_blank" class="text-blue-400 hover:text-blue-300">FlowEngine</a>
</p>
</footer>
</div>
<script>
const MCP_BASE_URL = 'https://tomcp.org';
const AI_TOOLS = [
{ id: 'cursor', name: 'Cursor', configPath: 'File → Preferences → Cursor Settings → Tools & MCP → Add Custom MCP', icon: 'https://cursor.sh/apple-touch-icon.png' },
{ id: 'claude', name: 'Claude', configPath: '~/Library/Application Support/Claude/claude_desktop_config.json', icon: 'https://www.anthropic.com/images/icons/apple-touch-icon.png' },
{ id: 'windsurf', name: 'Windsurf', configPath: '~/.codeium/windsurf/mcp_config.json', icon: 'https://codeium.com/favicon.svg' },
{ id: 'vscode', name: 'VS Code', configPath: 'Settings → Extensions → Copilot → MCP', icon: 'https://code.visualstudio.com/apple-touch-icon.png' },
{ id: 'cline', name: 'Cline', configPath: 'Cline → ☰ → MCP Servers', icon: 'https://cline.bot/assets/branding/favicons/apple-touch-icon.png' },
{ id: 'antigravity', name: 'Antigravity', configPath: '~/.gemini/antigravity/mcp_config.json', icon: 'https://files.brandlogos.net/svg/HNipmYPqfV/Google_Antigravity-logo_brandlogos.net_e23c83.svg' },
{ id: 'kiro', name: 'Kiro', configPath: '.kiro/settings/mcp.json', icon: 'https://kiro.dev/icon.svg?fe599162bb293ea0' },
];
let selectedTool = AI_TOOLS[0];
let currentDomain = '';
// Render tools grid
function renderTools() {
const grid = document.getElementById('toolsGrid');
grid.innerHTML = AI_TOOLS.map(tool => `
<button
data-tool-id="${tool.id}"
class="tool-btn group relative flex flex-col items-center gap-1.5 p-2 rounded-lg border-2 transition-all duration-200 ${
selectedTool.id === tool.id
? 'border-white/40 bg-white/10 scale-[1.02]'
: 'border-gray-800 bg-gray-900/30 hover:border-gray-600 hover:bg-gray-800/50'
}"
>
<div class="w-8 h-8 rounded-lg bg-gray-800 flex items-center justify-center overflow-hidden">
<img src="${tool.icon}" alt="${tool.name}" class="w-7 h-7 rounded" onerror="this.style.display='none'">
</div>
<span class="text-xs font-medium truncate w-full text-center transition-colors ${
selectedTool.id === tool.id ? 'text-white' : 'text-gray-400 group-hover:text-gray-200'
}">
${tool.name.split(' ')[0]}
</span>
${selectedTool.id === tool.id ? '<div class="absolute -bottom-px left-1/2 -translate-x-1/2 w-6 h-0.5 bg-white rounded-full"></div>' : ''}
</button>
`).join('');
// Add click handlers
document.querySelectorAll('.tool-btn').forEach(btn => {
btn.addEventListener('click', () => {
const toolId = btn.dataset.toolId;
selectedTool = AI_TOOLS.find(t => t.id === toolId);
renderTools();
updateOutput();
});
});
}
// Clean and extract URL parts
function cleanUrl(url) {
if (!url) return { domain: '', fullPath: '' };
// Remove protocol and trailing slash
let cleanUrl = url.trim()
.replace(/^https?:\/\//, '')
.replace(/^www\./, '')
.replace(/\/+$/, '');
const domain = cleanUrl.split('/')[0];
return { domain, fullPath: cleanUrl };
}
// Generate MCP config based on selected tool
function generateConfig(fullPath) {
const domain = fullPath.split('/')[0];
const name = domain.replace(/\./g, '-');
const mcpUrl = `${MCP_BASE_URL}/${fullPath}`;
switch (selectedTool.id) {
case 'cursor':
// Cursor: Remote Server with url
return JSON.stringify({
mcpServers: {
[name]: {
url: mcpUrl,
},
},
}, null, 2);
case 'claude':
// Claude Desktop: Local Server only (no remote URL support)
return JSON.stringify({
mcpServers: {
[name]: {
command: "npx",
args: ["-y", "@anthropic-ai/claude-code-mcp", mcpUrl],
},
},
}, null, 2);
case 'windsurf':
// Windsurf: Remote Server with serverUrl
return JSON.stringify({
mcpServers: {
[name]: {
serverUrl: mcpUrl,
},
},
}, null, 2);
case 'vscode':
// VS Code: uses "mcp" > "servers" with type "http"
return JSON.stringify({
mcp: {
servers: {
[name]: {
type: "http",
url: mcpUrl,
},
},
},
}, null, 2);
case 'cline':
// Cline: uses url with type streamableHttp
return JSON.stringify({
mcpServers: {
[name]: {
url: mcpUrl,
type: "streamableHttp",
},
},
}, null, 2);
case 'antigravity':
// Google Antigravity: Remote Server with serverUrl
return JSON.stringify({
mcpServers: {
[name]: {
serverUrl: mcpUrl,
},
},
}, null, 2);
case 'kiro':
// Kiro: uses type streamable-http with url
return JSON.stringify({
mcpServers: {
[name]: {
type: "streamable-http",
url: mcpUrl,
},
},
}, null, 2);
default:
return JSON.stringify({
mcpServers: {
[name]: {
url: mcpUrl,
},
},
}, null, 2);
}
}
// Update output
function updateOutput() {
const url = document.getElementById('urlInput').value;
const { domain, fullPath } = cleanUrl(url);
currentDomain = fullPath; // Store full path for config generation
const outputSection = document.getElementById('outputSection');
const emptyState = document.getElementById('emptyState');
if (domain) {
outputSection.classList.remove('hidden');
emptyState.classList.add('hidden');
// Update config display
document.getElementById('toolName').textContent = selectedTool.name;
document.getElementById('configPath').textContent = selectedTool.configPath;
document.getElementById('stepConfigPath').textContent = selectedTool.configPath;
document.getElementById('stepToolName').textContent = selectedTool.name;
document.querySelector('#codeBlock code').textContent = generateConfig(fullPath);
} else {
outputSection.classList.add('hidden');
emptyState.classList.remove('hidden');
}
}
// Copy functionality
document.getElementById('copyBtn').addEventListener('click', async () => {
const config = generateConfig(currentDomain);
await navigator.clipboard.writeText(config);
const copyIcon = document.getElementById('copyIcon');
const copyText = document.getElementById('copyText');
copyIcon.innerHTML = '<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"/>';
copyText.textContent = 'Copied!';
setTimeout(() => {
copyIcon.innerHTML = '<rect x="9" y="9" width="13" height="13" rx="2" stroke-width="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" stroke-width="2"/>';
copyText.textContent = 'Copy';
}, 2000);
});
// Try example button
document.getElementById('tryExample').addEventListener('click', () => {
document.getElementById('urlInput').value = 'flowengine.cloud/api-docs';
updateOutput();
// Also update chat URL (since programmatic value change doesn't trigger input event)
// Note: updateChatUrl is defined later but this runs after page load
setTimeout(() => updateChatUrl('flowengine.cloud/api-docs'), 0);
});
// URL input handler (MCP only - chat handler added after enableChat is defined)
document.getElementById('urlInput').addEventListener('input', updateOutput);
// Initialize
renderTools();
// ========== CHAT FUNCTIONALITY ==========
// Use localhost for local dev, production URL otherwise
const isLocalDev = window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1';
const API_BASE = isLocalDev ? 'http://localhost:8787' : 'https://tomcp.org';
const CHAT_API_URL = `${API_BASE}/chat`;
const MODELS_API_URL = `${API_BASE}/models`;
let chatHistory = [];
let chatWebsiteUrl = '';
let isLoading = false;
let chatStarted = false;
let userApiKey = localStorage.getItem('tomcp_api_key') || '';
let userAccountId = localStorage.getItem('tomcp_account_id') || '';
let selectedModel = localStorage.getItem('tomcp_model') || '@cf/meta/llama-3.1-8b-instruct';
// Available AI models - fallback if API fails
let AI_MODELS = [
{ id: '@cf/meta/llama-3.1-8b-instruct', name: 'Llama 3.1 8B', provider: 'Meta', free: true },
{ id: '@cf/qwen/qwen1.5-14b-chat-awq', name: 'Qwen 1.5 14B', provider: 'Alibaba', free: true },
{ id: '@cf/mistral/mistral-7b-instruct-v0.2-lora', name: 'Mistral 7B', provider: 'Mistral', free: true },
];
// Fetch models from API (updates the fallback list)
async function fetchModels() {
try {
const response = await fetch(MODELS_API_URL);
if (response.ok) {
const models = await response.json();
if (models && models.length > 0) {
AI_MODELS = models;
}
}
} catch (error) {
console.error('Failed to fetch models:', error);
}
// Always render models (either from API or fallback)
renderModels();
}
const chatMessages = document.getElementById('chatMessages');
const chatInput = document.getElementById('chatInput');
const chatSendBtn = document.getElementById('chatSendBtn');
const chatEmptyState = document.getElementById('chatEmptyState');
const chatUrlBadge = document.getElementById('chatUrlBadge');
const startChatBtn = document.getElementById('startChatBtn');
const apiKeyInput = document.getElementById('apiKeyInput');
const saveApiKeyBtn = document.getElementById('saveApiKeyBtn');
const clearApiKeyBtn = document.getElementById('clearApiKeyBtn');
const apiKeySection = document.getElementById('apiKeySection');
const apiKeyInputArea = document.getElementById('apiKeyInputArea');
const apiKeySavedArea = document.getElementById('apiKeySavedArea');
// Fullscreen elements
const fullscreenBtn = document.getElementById('fullscreenBtn');
const fullscreenModal = document.getElementById('fullscreenModal');
const closeFullscreenBtn = document.getElementById('closeFullscreenBtn');
const fullscreenMessages = document.getElementById('fullscreenMessages');
const fullscreenInput = document.getElementById('fullscreenInput');
const fullscreenSendBtn = document.getElementById('fullscreenSendBtn');
const fullscreenUrlBadge = document.getElementById('fullscreenUrlBadge');
let isFullscreen = false;
// Update API key UI
function updateApiKeyUI() {
if (userApiKey) {
apiKeyInputArea.classList.add('hidden');
apiKeySavedArea.classList.remove('hidden');
apiKeySavedArea.classList.add('flex');
} else {
apiKeyInputArea.classList.remove('hidden');
apiKeySavedArea.classList.add('hidden');
apiKeySavedArea.classList.remove('flex');
apiKeyInput.value = '';
}
}
// Show API key section (called when chat starts)
function showApiKeySection() {
apiKeySection.classList.remove('hidden');
}
// Save API key with validation
saveApiKeyBtn.addEventListener('click', async () => {
const key = apiKeyInput.value.trim();
if (!key || key.length < 20) {
alert('API key must be at least 20 characters. Cloudflare API tokens are longer.');
return;
}
// Show loading state
saveApiKeyBtn.disabled = true;
saveApiKeyBtn.textContent = 'Validating...';
try {
const response = await fetch(CHAT_API_URL.replace('/chat', '/validate-api-key'), {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ apiKey: key })
});
const result = await response.json();
if (result.valid && result.accountId) {
userApiKey = key;
userAccountId = result.accountId;
localStorage.setItem('tomcp_api_key', key);
localStorage.setItem('tomcp_account_id', result.accountId);
updateApiKeyUI();
// Enable paid models now that we have a valid API key
renderModels();
} else {
alert('Invalid API key: ' + (result.error || 'Please check your Cloudflare API token.'));
}
} catch (error) {
alert('Failed to validate API key. Please try again.');
}
saveApiKeyBtn.disabled = false;
saveApiKeyBtn.textContent = 'Save';
});
// Clear API key
clearApiKeyBtn.addEventListener('click', () => {
userApiKey = '';
userAccountId = '';
localStorage.removeItem('tomcp_api_key');
localStorage.removeItem('tomcp_account_id');
updateApiKeyUI();
renderModels(); // Re-render to disable paid models
});
// Initialize API key UI
updateApiKeyUI();
// Render model selector dropdown (both main and fullscreen)
function renderModels() {
const selects = [
document.getElementById('modelSelect'),
document.getElementById('fullscreenModelSelect')
].filter(Boolean);
const hasApiKey = !!userApiKey && userApiKey.length > 20;
// Show all models, disable paid ones unless user has API key
const optionsHtml = AI_MODELS.map(model => {
const isPaid = !model.free;
const isDisabled = isPaid && !hasApiKey;
const label = isPaid
? (hasApiKey ? `${model.name} (${model.provider})` : `${model.name} (add api key)`)
: `${model.name} (${model.provider})`;
return `<option value="${model.id}" ${selectedModel === model.id ? 'selected' : ''} ${isDisabled ? 'disabled' : ''}>${label}</option>`;
}).join('');
selects.forEach(select => {
select.innerHTML = optionsHtml;
// Set first available model as default if current selection is invalid/disabled
const availableModels = AI_MODELS.filter(m => m.free || hasApiKey);
if (!availableModels.some(m => m.id === selectedModel) && availableModels.length > 0) {
selectedModel = availableModels[0].id;
localStorage.setItem('tomcp_model', selectedModel);
}
select.value = selectedModel;
select.onchange = (e) => {
selectedModel = e.target.value;
localStorage.setItem('tomcp_model', selectedModel);
// Sync all dropdowns
selects.forEach(s => s.value = selectedModel);
};
});
}
// Initialize model selector - render fallbacks immediately, then fetch from API
renderModels();
fetchModels();
// Add message to chat
function addMessage(role, content) {
// Remove empty state if present
if (chatEmptyState) chatEmptyState.remove();
const messageDiv = document.createElement('div');
messageDiv.className = role === 'user'
? 'flex justify-end'
: 'flex justify-start';
const bubble = document.createElement('div');
bubble.className = role === 'user'
? 'max-w-[85%] px-4 py-2.5 rounded-2xl rounded-br-md bg-blue-600 text-white text-sm'
: 'max-w-[85%] px-4 py-2.5 rounded-2xl rounded-bl-md bg-gray-700 text-gray-100 text-sm';
// Simple markdown-like formatting for AI responses
if (role === 'assistant') {
content = content
.replace(/\*\*(.*?)\*\*/g, '<strong>$1</strong>')
.replace(/\*(.*?)\*/g, '<em>$1</em>')
.replace(/`(.*?)`/g, '<code class="bg-gray-800 px-1 rounded text-xs">$1</code>')
.replace(/\n/g, '<br>');
bubble.innerHTML = content;
} else {
bubble.textContent = content;
}
messageDiv.appendChild(bubble);
chatMessages.appendChild(messageDiv);
chatMessages.scrollTop = chatMessages.scrollHeight;
}
// Add loading indicator
function addLoadingIndicator() {
const loadingDiv = document.createElement('div');
loadingDiv.id = 'chatLoading';
loadingDiv.className = 'flex justify-start';
loadingDiv.innerHTML = `
<div class="px-4 py-2.5 rounded-2xl rounded-bl-md bg-gray-700 text-gray-400 flex items-center gap-2 text-sm">
<svg class="w-4 h-4 animate-spin" fill="none" viewBox="0 0 24 24">
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
</svg>
Thinking...
</div>
`;
chatMessages.appendChild(loadingDiv);
chatMessages.scrollTop = chatMessages.scrollHeight;
}
// Remove loading indicator
function removeLoadingIndicator() {
const loading = document.getElementById('chatLoading');
if (loading) loading.remove();
}
// Send message to API
async function sendMessage(message) {
if (isLoading || !message.trim() || !chatWebsiteUrl) return;
isLoading = true;
chatSendBtn.disabled = true;
chatInput.disabled = true;
// Add user message
addMessage('user', message);
chatHistory.push({ role: 'user', content: message });
// Show loading
addLoadingIndicator();
try {
const requestBody = {
url: chatWebsiteUrl,