deepthinking-mcp 8.2.1 → 9.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1038 -899
- package/dist/index.js +41286 -29738
- package/dist/index.js.map +1 -1
- package/package.json +6 -2
package/README.md
CHANGED
|
@@ -1,899 +1,1038 @@
|
|
|
1
|
-
# DeepThinking MCP
|
|
2
|
-
|
|
3
|
-
[](https://www.typescriptlang.org/)
|
|
4
|
-
[](https://opensource.org/licenses/MIT)
|
|
5
|
-
[](https://modelcontextprotocol.io)
|
|
6
|
-
|
|
7
|
-
A comprehensive Model Context Protocol (MCP) server featuring **
|
|
8
|
-
|
|
9
|
-
> 📋 **Latest Release**:
|
|
10
|
-
>
|
|
11
|
-
> 🎉 **New in
|
|
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
|
-
- **Intelligent Mode Recommendation** - Automatic mode selection based on problem characteristics
|
|
43
|
-
- **Taxonomy Classifier** - 69 reasoning types across 12 categories for intelligent task classification (110 planned)
|
|
44
|
-
- **Visual Exports** - Generate Mermaid diagrams, DOT graphs, ASCII art, SVG graphics, and LaTeX documents
|
|
45
|
-
- **
|
|
46
|
-
- **
|
|
47
|
-
- **
|
|
48
|
-
- **
|
|
49
|
-
- **
|
|
50
|
-
- **Extensible** - Plugin architecture for custom reasoning modes
|
|
51
|
-
- **MCP Compatible** - Full integration with Model Context Protocol
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
npm
|
|
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
|
-
```typescript
|
|
220
|
-
mode: '
|
|
221
|
-
// Use for:
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
####
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
```typescript
|
|
228
|
-
mode: '
|
|
229
|
-
// Use for:
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
####
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
```typescript
|
|
236
|
-
mode: '
|
|
237
|
-
// Use for:
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
####
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
```typescript
|
|
244
|
-
mode: '
|
|
245
|
-
// Use for:
|
|
246
|
-
```
|
|
247
|
-
|
|
248
|
-
###
|
|
249
|
-
|
|
250
|
-
####
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
```typescript
|
|
254
|
-
mode: '
|
|
255
|
-
// Use for:
|
|
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
|
-
```typescript
|
|
286
|
-
mode: '
|
|
287
|
-
// Use for:
|
|
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
|
-
|
|
1
|
+
# DeepThinking MCP
|
|
2
|
+
|
|
3
|
+
[](https://www.typescriptlang.org/)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
[](https://modelcontextprotocol.io)
|
|
6
|
+
|
|
7
|
+
A comprehensive Model Context Protocol (MCP) server featuring **34 reasoning modes** (30 with dedicated thought types, 4 advanced runtime modes) including historical reasoning, meta-reasoning for strategic oversight, with intelligent mode recommendation, taxonomy-based classification, enterprise security, and production-ready features for complex problem-solving, analysis, and decision-making.
|
|
8
|
+
|
|
9
|
+
> 📋 **Latest Release**: v9.1.0 - See [CHANGELOG](CHANGELOG.md) for updates and improvements.
|
|
10
|
+
>
|
|
11
|
+
> 🎉 **New in v9.1.0**: Historical Reasoning Mode - Analyze historical events, evaluate sources, identify patterns, trace causal chains, and define periods with 5 thought types.
|
|
12
|
+
>
|
|
13
|
+
> ✨ **Codebase**: 237 TypeScript files | 102,500 LOC | 15 modules | 5,048+ tests passing
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## Table of Contents
|
|
17
|
+
|
|
18
|
+
- [Features](#features)
|
|
19
|
+
- [Installation](#installation)
|
|
20
|
+
- [Quick Start](#quick-start)
|
|
21
|
+
- [Reasoning Modes](#reasoning-modes)
|
|
22
|
+
- [Proof Decomposition](#proof-decomposition)
|
|
23
|
+
- [Usage Examples](#usage-examples)
|
|
24
|
+
- [Production Features](#production-features)
|
|
25
|
+
- [API Documentation](#api-documentation)
|
|
26
|
+
- [Contributing](#contributing)
|
|
27
|
+
- [License](#license)
|
|
28
|
+
|
|
29
|
+
## Features
|
|
30
|
+
|
|
31
|
+
- **34 Specialized Reasoning Modes** - From sequential thinking to historical analysis, game theory, formal logic, and meta-reasoning (30 with full thought types, 4 advanced runtime modes)
|
|
32
|
+
- **ModeHandler Architecture (v9.x)** - Strategy pattern with 37 specialized handlers providing advanced validation and enhancements for all 34 modes
|
|
33
|
+
- **Historical Reasoning (v9.1.0)** - Event analysis, source evaluation, pattern identification, causal chains, periodization with 5 thought types
|
|
34
|
+
- **Specialized Handler Enhancements** - Systems Archetypes (8 patterns), Socratic Questions (6 categories), auto Bayesian posteriors, Nash equilibria, source reliability scoring
|
|
35
|
+
- **Visual Builder APIs** - 14 fluent builder classes: DOTGraphBuilder, MermaidGraphBuilder, MermaidGanttBuilder, MermaidStateDiagramBuilder, ASCIIDocBuilder, SVGBuilder, TikZBuilder, UMLBuilder, HTMLDocBuilder, MarkdownBuilder, ModelicaBuilder, JSONExportBuilder, GraphMLBuilder, SVGGroupBuilder
|
|
36
|
+
- **Academic Research Modes** - Synthesis (literature review), Argumentation (Toulmin), Critique (peer review), Analysis (qualitative methods)
|
|
37
|
+
- **Algorithmic Reasoning** - Comprehensive CLRS coverage with 100+ named algorithms, complexity analysis, design patterns
|
|
38
|
+
- **Historical Computing Extensions** - Computability (Turing machines), Cryptanalytic (decibans), extended Game Theory (von Neumann)
|
|
39
|
+
- **Proof Decomposition** - Break proofs into atomic statements, detect gaps, track assumption chains
|
|
40
|
+
- **Native SVG Export** - Direct SVG generation without external tools for proof visualizations
|
|
41
|
+
- **Meta-Reasoning** - Strategic oversight that monitors effectiveness, recommends mode switches, and assesses quality
|
|
42
|
+
- **Intelligent Mode Recommendation** - Automatic mode selection based on problem characteristics
|
|
43
|
+
- **Taxonomy Classifier** - 69 reasoning types across 12 categories for intelligent task classification (110 planned)
|
|
44
|
+
- **Visual Exports** - Generate Mermaid diagrams, DOT graphs, ASCII art, SVG graphics, and LaTeX documents
|
|
45
|
+
- **File Export System** - Export sessions to files with configurable output directory and profiles
|
|
46
|
+
- **Production-Ready** - Search engine, session management, caching, multi-instance support
|
|
47
|
+
- **Enterprise Security** - Input validation (Zod), path sanitization, PII redaction
|
|
48
|
+
- **High Performance** - LRU caching with auto-eviction, async I/O
|
|
49
|
+
- **Type-Safe** - 100% TypeScript with comprehensive type coverage
|
|
50
|
+
- **Extensible** - Plugin architecture for custom reasoning modes
|
|
51
|
+
- **MCP Compatible** - Full integration with Model Context Protocol
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
## Installation
|
|
55
|
+
|
|
56
|
+
### NPM Package
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
npm install deepthinking-mcp
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### From Source
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
git clone https://github.com/danielsimonjr/deepthinking-mcp.git
|
|
66
|
+
cd deepthinking-mcp
|
|
67
|
+
npm install
|
|
68
|
+
npm run build
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### MCP Configuration
|
|
72
|
+
|
|
73
|
+
Add to your MCP settings file:
|
|
74
|
+
|
|
75
|
+
```json
|
|
76
|
+
{
|
|
77
|
+
"mcpServers": {
|
|
78
|
+
"deepthinking": {
|
|
79
|
+
"command": "npx",
|
|
80
|
+
"args": ["deepthinking-mcp"]
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Configuration with Environment Variables
|
|
87
|
+
|
|
88
|
+
Configure the server with environment variables:
|
|
89
|
+
|
|
90
|
+
```json
|
|
91
|
+
{
|
|
92
|
+
"mcpServers": {
|
|
93
|
+
"deepthinking": {
|
|
94
|
+
"command": "npx",
|
|
95
|
+
"args": ["deepthinking-mcp"],
|
|
96
|
+
"env": {
|
|
97
|
+
"MCP_EXPORT_PATH": "C:/deepthinking-exports",
|
|
98
|
+
"MCP_EXPORT_OVERWRITE": "false",
|
|
99
|
+
"MCP_LOG_LEVEL": "info"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
| Variable | Description | Default |
|
|
107
|
+
|----------|-------------|---------|
|
|
108
|
+
| `MCP_EXPORT_PATH` | Default directory for file exports | `` (returns content) |
|
|
109
|
+
| `MCP_EXPORT_OVERWRITE` | Overwrite existing files | `false` |
|
|
110
|
+
| `MCP_LOG_LEVEL` | Log level (debug/info/warn/error) | `info` |
|
|
111
|
+
| `MCP_MAX_SESSIONS` | Maximum active sessions | `100` |
|
|
112
|
+
| `MCP_SESSION_TIMEOUT_MS` | Session timeout (0 = none) | `0` |
|
|
113
|
+
| `SESSION_DIR` | Shared session storage for multi-instance | `` (in-memory) |
|
|
114
|
+
|
|
115
|
+
## Quick Start
|
|
116
|
+
|
|
117
|
+
### MCP Tool Usage
|
|
118
|
+
|
|
119
|
+
DeepThinking MCP provides 13 focused tools for different reasoning domains:
|
|
120
|
+
|
|
121
|
+
| Tool | Modes | Description |
|
|
122
|
+
|------|-------|-------------|
|
|
123
|
+
| `deepthinking_core` | inductive, deductive, abductive | Fundamental reasoning |
|
|
124
|
+
| `deepthinking_standard` | sequential, shannon, hybrid | Standard workflow modes |
|
|
125
|
+
| `deepthinking_mathematics` | mathematics, physics, computability | Math/physics/computability |
|
|
126
|
+
| `deepthinking_temporal` | temporal | Time-based reasoning |
|
|
127
|
+
| `deepthinking_probabilistic` | bayesian, evidential | Probabilistic reasoning |
|
|
128
|
+
| `deepthinking_causal` | causal, counterfactual | Cause-effect analysis |
|
|
129
|
+
| `deepthinking_strategic` | gametheory, optimization | Strategic reasoning |
|
|
130
|
+
| `deepthinking_analytical` | analogical, firstprinciples, metareasoning, cryptanalytic | Analytical reasoning |
|
|
131
|
+
| `deepthinking_scientific` | scientificmethod, systemsthinking, formallogic | Scientific reasoning |
|
|
132
|
+
| `deepthinking_engineering` | engineering, algorithmic | Engineering/algorithmic |
|
|
133
|
+
| `deepthinking_academic` | synthesis, argumentation, critique, analysis | Academic research |
|
|
134
|
+
| `deepthinking_session` | - | Session management |
|
|
135
|
+
| `deepthinking_analyze` | Multi-mode | Analysis with presets and merge strategies |
|
|
136
|
+
|
|
137
|
+
### Example: Sequential Reasoning
|
|
138
|
+
|
|
139
|
+
```json
|
|
140
|
+
{
|
|
141
|
+
"tool": "deepthinking_standard",
|
|
142
|
+
"arguments": {
|
|
143
|
+
"mode": "sequential",
|
|
144
|
+
"thought": "First, identify the main bottlenecks in the distributed system",
|
|
145
|
+
"thoughtNumber": 1,
|
|
146
|
+
"totalThoughts": 5,
|
|
147
|
+
"nextThoughtNeeded": true
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Example: Causal Analysis
|
|
153
|
+
|
|
154
|
+
```json
|
|
155
|
+
{
|
|
156
|
+
"tool": "deepthinking_causal",
|
|
157
|
+
"arguments": {
|
|
158
|
+
"mode": "causal",
|
|
159
|
+
"thought": "Analyzing the root cause of the service outage",
|
|
160
|
+
"thoughtNumber": 1,
|
|
161
|
+
"totalThoughts": 3,
|
|
162
|
+
"nextThoughtNeeded": true,
|
|
163
|
+
"causalGraph": {
|
|
164
|
+
"nodes": [
|
|
165
|
+
{"id": "n1", "name": "High Load", "type": "cause"},
|
|
166
|
+
{"id": "n2", "name": "Memory Exhaustion", "type": "mediator"},
|
|
167
|
+
{"id": "n3", "name": "Service Crash", "type": "effect"}
|
|
168
|
+
],
|
|
169
|
+
"edges": [
|
|
170
|
+
{"from": "n1", "to": "n2", "strength": 0.9},
|
|
171
|
+
{"from": "n2", "to": "n3", "strength": 0.95}
|
|
172
|
+
]
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### Example: Session Export
|
|
179
|
+
|
|
180
|
+
```json
|
|
181
|
+
{
|
|
182
|
+
"tool": "deepthinking_session",
|
|
183
|
+
"arguments": {
|
|
184
|
+
"action": "export",
|
|
185
|
+
"sessionId": "session-123",
|
|
186
|
+
"exportFormat": "markdown"
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
## Reasoning Modes
|
|
192
|
+
|
|
193
|
+
The server supports 34 reasoning modes organized into categories:
|
|
194
|
+
|
|
195
|
+
- **Core Modes (5)**: Sequential, Shannon, Mathematics, Physics, Hybrid
|
|
196
|
+
- **Causal/Probabilistic (7)**: Causal, Bayesian, Counterfactual, Temporal, Historical, GameTheory, Evidential
|
|
197
|
+
- **Historical Computing (2)**: Computability (Turing), Cryptanalytic (Turing) - *v7.2.0*
|
|
198
|
+
- **Algorithmic (1)**: Algorithmic (CLRS) - *v7.3.0*
|
|
199
|
+
- **Academic Research (4)**: Synthesis, Argumentation, Critique, Analysis - *v7.4.0*
|
|
200
|
+
- **Advanced Runtime Modes (6)**: Metareasoning, Recursive, Modal, Stochastic, Constraint, Optimization
|
|
201
|
+
- **Fundamental Modes (3)**: Inductive, Deductive, Abductive
|
|
202
|
+
- **Systems/Scientific (3)**: SystemsThinking, ScientificMethod, FormalLogic
|
|
203
|
+
- **Analogical (2)**: Analogical, FirstPrinciples
|
|
204
|
+
- **Engineering (1)**: Engineering
|
|
205
|
+
|
|
206
|
+
### Core Modes
|
|
207
|
+
|
|
208
|
+
#### Sequential
|
|
209
|
+
Iterative refinement with revision capabilities. Perfect for step-by-step problem solving.
|
|
210
|
+
|
|
211
|
+
```typescript
|
|
212
|
+
mode: 'sequential'
|
|
213
|
+
// Use for: Debugging, algorithmic thinking, systematic analysis
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
#### Shannon
|
|
217
|
+
5-stage systematic problem-solving methodology (problem → constraints → model → proof → implementation).
|
|
218
|
+
|
|
219
|
+
```typescript
|
|
220
|
+
mode: 'shannon'
|
|
221
|
+
// Use for: Engineering problems, system design, complex optimizations
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
#### Mathematics
|
|
225
|
+
Theorem proving, lemma derivation, symbolic computation with LaTeX support.
|
|
226
|
+
|
|
227
|
+
```typescript
|
|
228
|
+
mode: 'mathematics'
|
|
229
|
+
// Use for: Proofs, mathematical modeling, symbolic algebra
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
#### Physics
|
|
233
|
+
Tensor mathematics, dimensional analysis, conservation laws, field theory.
|
|
234
|
+
|
|
235
|
+
```typescript
|
|
236
|
+
mode: 'physics'
|
|
237
|
+
// Use for: Physical modeling, dimensional analysis, scientific computing
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
#### Hybrid
|
|
241
|
+
Intelligently combines multiple reasoning modes based on problem characteristics.
|
|
242
|
+
|
|
243
|
+
```typescript
|
|
244
|
+
mode: 'hybrid'
|
|
245
|
+
// Use for: Complex multi-faceted problems requiring diverse approaches
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
### Historical Reasoning (v9.1.0)
|
|
249
|
+
|
|
250
|
+
#### Historical
|
|
251
|
+
Comprehensive historical analysis with source evaluation, pattern recognition, and causal chain analysis.
|
|
252
|
+
|
|
253
|
+
```typescript
|
|
254
|
+
mode: 'historical'
|
|
255
|
+
// Use for: Historical research, source criticism, event analysis, periodization
|
|
256
|
+
// Features: 5 thought types, aggregate reliability scoring, pattern detection
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
**5 Thought Types:**
|
|
260
|
+
- `event_analysis` - Analyze historical events with significance ratings
|
|
261
|
+
- `source_evaluation` - Evaluate primary/secondary/tertiary sources with reliability scoring
|
|
262
|
+
- `pattern_identification` - Identify recurring patterns across time (cyclical, structural, contingent)
|
|
263
|
+
- `causal_chain` - Trace cause-effect relationships with confidence scores
|
|
264
|
+
- `periodization` - Define and analyze historical periods with characteristics
|
|
265
|
+
|
|
266
|
+
**Data Structures:**
|
|
267
|
+
- `HistoricalEvent` - Events with dates, actors, causes/effects, significance levels
|
|
268
|
+
- `HistoricalSource` - Sources with type, reliability (0-1), bias analysis, corroboration
|
|
269
|
+
- `HistoricalPeriod` - Time periods with characteristics, key events, transitions
|
|
270
|
+
- `CausalChain` - Linked causal relationships with evidence and confidence
|
|
271
|
+
- `HistoricalActor` - Individuals, groups, institutions, nations, movements
|
|
272
|
+
|
|
273
|
+
**Handler Features:**
|
|
274
|
+
- Aggregate reliability calculation (weighted by source type with corroboration bonus)
|
|
275
|
+
- Causal chain continuity validation
|
|
276
|
+
- Automatic pattern detection from events
|
|
277
|
+
- Temporal span calculation
|
|
278
|
+
- Cross-reference validation (events ↔ sources ↔ actors)
|
|
279
|
+
|
|
280
|
+
### Advanced Modes
|
|
281
|
+
|
|
282
|
+
#### Causal
|
|
283
|
+
Build causal graphs, analyze interventions and effects.
|
|
284
|
+
|
|
285
|
+
```typescript
|
|
286
|
+
mode: 'causal'
|
|
287
|
+
// Use for: Impact analysis, system design, decision making
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
#### Bayesian
|
|
291
|
+
Probabilistic reasoning with priors, likelihoods, and evidence updates.
|
|
292
|
+
|
|
293
|
+
```typescript
|
|
294
|
+
mode: 'bayesian'
|
|
295
|
+
// Use for: Risk assessment, A/B testing, uncertainty quantification
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
#### Counterfactual
|
|
299
|
+
Explore alternative scenarios and compare outcomes.
|
|
300
|
+
|
|
301
|
+
```typescript
|
|
302
|
+
mode: 'counterfactual'
|
|
303
|
+
// Use for: Post-mortems, strategic planning, what-if analysis
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
#### Analogical
|
|
307
|
+
Transfer knowledge across domains by identifying structural similarities.
|
|
308
|
+
|
|
309
|
+
```typescript
|
|
310
|
+
mode: 'analogical'
|
|
311
|
+
// Use for: Design patterns, innovative problem-solving, knowledge transfer
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
### Specialized Modes
|
|
315
|
+
|
|
316
|
+
#### Temporal
|
|
317
|
+
Model events, intervals, and temporal relationships using Allen's interval algebra.
|
|
318
|
+
|
|
319
|
+
```typescript
|
|
320
|
+
mode: 'temporal'
|
|
321
|
+
// Use for: Timeline analysis, scheduling, event sequencing
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
#### Game Theory
|
|
325
|
+
Analyze strategic interactions, compute Nash equilibria, build game trees.
|
|
326
|
+
|
|
327
|
+
```typescript
|
|
328
|
+
mode: 'game-theory'
|
|
329
|
+
// Use for: Competitive analysis, mechanism design, strategic decisions
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
#### Evidential
|
|
333
|
+
Dempster-Shafer theory for reasoning with uncertain evidence.
|
|
334
|
+
|
|
335
|
+
```typescript
|
|
336
|
+
mode: 'evidential'
|
|
337
|
+
// Use for: Sensor fusion, intelligence analysis, incomplete information
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
#### First Principles
|
|
341
|
+
Derive conclusions from foundational axioms using deductive reasoning.
|
|
342
|
+
|
|
343
|
+
```typescript
|
|
344
|
+
mode: 'first-principles'
|
|
345
|
+
// Use for: Fundamental analysis, conceptual understanding, basic truths
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
#### Meta-Reasoning
|
|
349
|
+
Strategic oversight of reasoning process - monitors effectiveness, recommends mode switches, assesses quality.
|
|
350
|
+
|
|
351
|
+
```typescript
|
|
352
|
+
mode: 'metareasoning'
|
|
353
|
+
// Use for: Strategy evaluation, adaptive mode switching, quality assessment
|
|
354
|
+
// Metrics: Effectiveness, Efficiency, Confidence, Quality (6 dimensions)
|
|
355
|
+
// Auto-switches at effectiveness < 0.3
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
See [full documentation](docs/modes/METAREASONING.md) for detailed usage.
|
|
359
|
+
|
|
360
|
+
#### Systems Thinking
|
|
361
|
+
Holistic analysis of complex systems, feedback loops, and emergence.
|
|
362
|
+
|
|
363
|
+
```typescript
|
|
364
|
+
mode: 'systems-thinking'
|
|
365
|
+
// Use for: Complex systems, organizational design, ecosystem analysis
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
#### Scientific Method
|
|
369
|
+
Hypothesis-driven experimentation with research design and statistical analysis.
|
|
370
|
+
|
|
371
|
+
```typescript
|
|
372
|
+
mode: 'scientific-method'
|
|
373
|
+
// Use for: Experimental design, hypothesis testing, research
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
#### Optimization
|
|
377
|
+
Constraint satisfaction and optimization with decision variables.
|
|
378
|
+
|
|
379
|
+
```typescript
|
|
380
|
+
mode: 'optimization'
|
|
381
|
+
// Use for: Resource allocation, scheduling, constrained optimization
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
#### Formal Logic
|
|
385
|
+
Rigorous logical reasoning with formal systems and proof verification.
|
|
386
|
+
|
|
387
|
+
```typescript
|
|
388
|
+
mode: 'formal-logic'
|
|
389
|
+
// Use for: Proof verification, logical analysis, formal methods
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
### Advanced Runtime Modes
|
|
393
|
+
|
|
394
|
+
#### Recursive
|
|
395
|
+
Recursive problem decomposition - break complex problems into smaller subproblems.
|
|
396
|
+
|
|
397
|
+
```typescript
|
|
398
|
+
mode: 'recursive'
|
|
399
|
+
// Use for: Divide-and-conquer, tree-structured problems, recursive algorithms
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
#### Modal
|
|
403
|
+
Possibility and necessity reasoning using modal logic.
|
|
404
|
+
|
|
405
|
+
```typescript
|
|
406
|
+
mode: 'modal'
|
|
407
|
+
// Use for: What's possible vs necessary, requirement analysis, constraint exploration
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
#### Stochastic
|
|
411
|
+
Probabilistic state transitions and Markov chain reasoning.
|
|
412
|
+
|
|
413
|
+
```typescript
|
|
414
|
+
mode: 'stochastic'
|
|
415
|
+
// Use for: Process modeling, state machines, probabilistic sequences
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
#### Constraint
|
|
419
|
+
Constraint satisfaction problem solving.
|
|
420
|
+
|
|
421
|
+
```typescript
|
|
422
|
+
mode: 'constraint'
|
|
423
|
+
// Use for: Scheduling, resource allocation, constraint propagation
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
### Fundamental Modes
|
|
427
|
+
|
|
428
|
+
#### Inductive
|
|
429
|
+
Reasoning from specific observations to general principles.
|
|
430
|
+
|
|
431
|
+
```typescript
|
|
432
|
+
mode: 'inductive'
|
|
433
|
+
// Use for: Pattern recognition, generalization, empirical reasoning
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
#### Deductive
|
|
437
|
+
Reasoning from general principles to specific conclusions.
|
|
438
|
+
|
|
439
|
+
```typescript
|
|
440
|
+
mode: 'deductive'
|
|
441
|
+
// Use for: Logical proofs, applying rules, deriving conclusions
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
#### Abductive
|
|
445
|
+
Generate and evaluate hypotheses to explain observations.
|
|
446
|
+
|
|
447
|
+
```typescript
|
|
448
|
+
mode: 'abductive'
|
|
449
|
+
// Use for: Debugging, root cause analysis, diagnostic reasoning
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
### Historical Computing Modes (v7.2.0)
|
|
453
|
+
|
|
454
|
+
Tributes to Alan Turing and John von Neumann's foundational work.
|
|
455
|
+
|
|
456
|
+
#### Computability
|
|
457
|
+
Turing machines, decidability proofs, reductions, and diagonalization arguments.
|
|
458
|
+
|
|
459
|
+
```typescript
|
|
460
|
+
mode: 'computability'
|
|
461
|
+
// Use for: Decidability analysis, algorithm limits, computational complexity
|
|
462
|
+
// Features: Turing machine simulation, reduction chains, halting problem analysis
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
#### Cryptanalytic
|
|
466
|
+
Turing's deciban evidence system from Bletchley Park.
|
|
467
|
+
|
|
468
|
+
```typescript
|
|
469
|
+
mode: 'cryptanalytic'
|
|
470
|
+
// Use for: Evidence quantification, hypothesis testing, code-breaking analysis
|
|
471
|
+
// Features: Deciban accumulation (10 db ≈ 10:1 odds), frequency analysis, Banburismus
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
#### Extended Game Theory (v7.2.0)
|
|
475
|
+
Von Neumann's minimax theorem, cooperative games, and Shapley values.
|
|
476
|
+
|
|
477
|
+
```typescript
|
|
478
|
+
mode: 'gametheory'
|
|
479
|
+
// Enhanced with: Minimax analysis, cooperative game theory, coalition analysis
|
|
480
|
+
// Use for: Zero-sum games, fair value distribution, strategic decision-making
|
|
481
|
+
```
|
|
482
|
+
|
|
483
|
+
### Algorithmic Mode (v7.3.0)
|
|
484
|
+
|
|
485
|
+
#### Algorithmic
|
|
486
|
+
Comprehensive coverage of algorithms from "Introduction to Algorithms" (CLRS) with 100+ named algorithms.
|
|
487
|
+
|
|
488
|
+
```typescript
|
|
489
|
+
mode: 'algorithmic'
|
|
490
|
+
// Use for: Algorithm design, complexity analysis, correctness proofs
|
|
491
|
+
// Features: Divide-and-conquer, dynamic programming, greedy, graph algorithms
|
|
492
|
+
// Coverage: Sorting, searching, graph, string, computational geometry
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
### Academic Research Modes (v7.4.0)
|
|
496
|
+
|
|
497
|
+
Designed for PhD students and scientific paper writing.
|
|
498
|
+
|
|
499
|
+
#### Synthesis
|
|
500
|
+
Literature review and knowledge integration.
|
|
501
|
+
|
|
502
|
+
```typescript
|
|
503
|
+
mode: 'synthesis'
|
|
504
|
+
// Use for: Literature reviews, theme extraction, knowledge integration
|
|
505
|
+
// Features: Source synthesis, pattern identification, gap analysis
|
|
506
|
+
```
|
|
507
|
+
|
|
508
|
+
#### Argumentation
|
|
509
|
+
Academic argumentation using the Toulmin model.
|
|
510
|
+
|
|
511
|
+
```typescript
|
|
512
|
+
mode: 'argumentation'
|
|
513
|
+
// Use for: Building arguments, dialectical reasoning, rhetorical analysis
|
|
514
|
+
// Features: Toulmin model (claim, data, warrant, backing), counter-arguments
|
|
515
|
+
```
|
|
516
|
+
|
|
517
|
+
#### Critique
|
|
518
|
+
Critical analysis and peer review frameworks.
|
|
519
|
+
|
|
520
|
+
```typescript
|
|
521
|
+
mode: 'critique'
|
|
522
|
+
// Use for: Peer review, methodology evaluation, evidence assessment
|
|
523
|
+
// Features: Systematic critique, strengths/weaknesses analysis
|
|
524
|
+
```
|
|
525
|
+
|
|
526
|
+
#### Analysis
|
|
527
|
+
Qualitative analysis methods.
|
|
528
|
+
|
|
529
|
+
```typescript
|
|
530
|
+
mode: 'analysis'
|
|
531
|
+
// Use for: Thematic analysis, grounded theory, discourse analysis
|
|
532
|
+
// Features: Multiple qualitative analysis frameworks, coding support
|
|
533
|
+
```
|
|
534
|
+
|
|
535
|
+
### Specialized Mode Handlers (v9.x)
|
|
536
|
+
|
|
537
|
+
The ModeHandler system provides 37 specialized handlers with advanced validation and enhancements. Key examples:
|
|
538
|
+
|
|
539
|
+
| Handler | Mode | Key Enhancements |
|
|
540
|
+
|---------|------|------------------|
|
|
541
|
+
| **HistoricalHandler** | historical | Aggregate reliability scoring, causal chain validation, pattern detection |
|
|
542
|
+
| **CausalHandler** | causal | Validates graph structure, detects cycles, propagates interventions |
|
|
543
|
+
| **BayesianHandler** | bayesian | Auto-calculates posteriors from prior × likelihood, validates probability sums |
|
|
544
|
+
| **GameTheoryHandler** | gametheory | Validates payoff matrix dimensions, computes Nash equilibria |
|
|
545
|
+
| **CounterfactualHandler** | counterfactual | Tracks world states, validates divergence points, compares outcomes |
|
|
546
|
+
| **SynthesisHandler** | synthesis | Tracks source coverage, validates theme extraction, detects contradictions |
|
|
547
|
+
| **SystemsThinkingHandler** | systemsthinking | Detects 8 Systems Archetypes, adds warning signs and interventions |
|
|
548
|
+
| **CritiqueHandler** | critique | 6 Socratic question categories for rigorous critical analysis |
|
|
549
|
+
|
|
550
|
+
#### Systems Archetypes Detection
|
|
551
|
+
|
|
552
|
+
SystemsThinkingHandler automatically detects Peter Senge's 8 archetypes:
|
|
553
|
+
|
|
554
|
+
- **Fixes that Fail** - Short-term fixes with unintended consequences
|
|
555
|
+
- **Shifting the Burden** - Symptomatic vs fundamental solutions
|
|
556
|
+
- **Limits to Growth** - Growth hitting constraints
|
|
557
|
+
- **Success to the Successful** - Winner-take-all dynamics
|
|
558
|
+
- **Tragedy of the Commons** - Shared resource depletion
|
|
559
|
+
- **Escalation** - Competitive escalation spirals
|
|
560
|
+
- **Accidental Adversaries** - Alliance deterioration
|
|
561
|
+
- **Growth and Underinvestment** - Capacity constraints
|
|
562
|
+
|
|
563
|
+
#### Socratic Question Framework
|
|
564
|
+
|
|
565
|
+
CritiqueHandler uses Richard Paul's 6 categories:
|
|
566
|
+
|
|
567
|
+
- **Clarification** - "What do you mean by...?"
|
|
568
|
+
- **Assumptions** - "What are you assuming?"
|
|
569
|
+
- **Evidence** - "What evidence supports this?"
|
|
570
|
+
- **Perspectives** - "Are there alternative viewpoints?"
|
|
571
|
+
- **Implications** - "What are the consequences?"
|
|
572
|
+
- **Meta** - "Why is this question important?"
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
## Proof Decomposition
|
|
576
|
+
|
|
577
|
+
**New in v7.0.0!** The proof decomposition system provides advanced mathematical reasoning capabilities:
|
|
578
|
+
|
|
579
|
+
### Components
|
|
580
|
+
|
|
581
|
+
| Component | Purpose |
|
|
582
|
+
|-----------|---------|
|
|
583
|
+
| **ProofDecomposer** | Breaks proofs into atomic statements with dependency tracking |
|
|
584
|
+
| **GapAnalyzer** | Detects missing steps, unjustified leaps, and implicit assumptions |
|
|
585
|
+
| **AssumptionTracker** | Traces conclusions back to their supporting assumptions |
|
|
586
|
+
| **InconsistencyDetector** | Detects circular dependencies and contradictions |
|
|
587
|
+
| **MathematicsReasoningEngine** | Integrated proof analysis with improvement suggestions |
|
|
588
|
+
|
|
589
|
+
### Features
|
|
590
|
+
|
|
591
|
+
- **Atomic Statement Types**: axiom, hypothesis, definition, derived, lemma, conclusion
|
|
592
|
+
- **Inference Rules**: algebraic_manipulation, substitution, modus_ponens, universal_instantiation, etc.
|
|
593
|
+
- **Gap Detection**: Identify missing steps with severity levels (minor, significant, critical)
|
|
594
|
+
- **Rigor Levels**: informal, textbook, rigorous, formal
|
|
595
|
+
- **Visual Export**: Mermaid, DOT, ASCII, and native SVG formats
|
|
596
|
+
|
|
597
|
+
### Example: Proof Analysis
|
|
598
|
+
|
|
599
|
+
```json
|
|
600
|
+
{
|
|
601
|
+
"tool": "deepthinking_mathematics",
|
|
602
|
+
"arguments": {
|
|
603
|
+
"mode": "mathematics",
|
|
604
|
+
"thought": "Analyzing the proof that n² is even when n is even",
|
|
605
|
+
"thoughtNumber": 1,
|
|
606
|
+
"totalThoughts": 3,
|
|
607
|
+
"nextThoughtNeeded": true,
|
|
608
|
+
"proofDecomposition": {
|
|
609
|
+
"theorem": "If n is even, then n² is even",
|
|
610
|
+
"atoms": [
|
|
611
|
+
{"id": "a1", "content": "n is an even integer", "type": "hypothesis"},
|
|
612
|
+
{"id": "a2", "content": "n = 2k for some integer k", "type": "definition"},
|
|
613
|
+
{"id": "a3", "content": "n² = 4k² = 2(2k²)", "type": "derived"},
|
|
614
|
+
{"id": "a4", "content": "n² is even", "type": "conclusion"}
|
|
615
|
+
],
|
|
616
|
+
"dependencies": {
|
|
617
|
+
"nodes": ["a1", "a2", "a3", "a4"],
|
|
618
|
+
"edges": [
|
|
619
|
+
{"from": "a1", "to": "a2"},
|
|
620
|
+
{"from": "a2", "to": "a3"},
|
|
621
|
+
{"from": "a3", "to": "a4"}
|
|
622
|
+
]
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
```
|
|
628
|
+
|
|
629
|
+
### Visual Export Formats
|
|
630
|
+
|
|
631
|
+
Export proof decompositions to multiple visual formats:
|
|
632
|
+
|
|
633
|
+
```typescript
|
|
634
|
+
// Native SVG (no external tools required)
|
|
635
|
+
exportProofDecomposition(decomposition, {
|
|
636
|
+
format: 'svg',
|
|
637
|
+
colorScheme: 'default', // 'default' | 'pastel' | 'monochrome'
|
|
638
|
+
includeMetrics: true,
|
|
639
|
+
svgWidth: 1200,
|
|
640
|
+
svgHeight: 800
|
|
641
|
+
});
|
|
642
|
+
|
|
643
|
+
// Mermaid diagram
|
|
644
|
+
exportProofDecomposition(decomposition, { format: 'mermaid' });
|
|
645
|
+
|
|
646
|
+
// GraphViz DOT
|
|
647
|
+
exportProofDecomposition(decomposition, { format: 'dot' });
|
|
648
|
+
|
|
649
|
+
// ASCII text
|
|
650
|
+
exportProofDecomposition(decomposition, { format: 'ascii' });
|
|
651
|
+
```
|
|
652
|
+
|
|
653
|
+
## Usage Examples
|
|
654
|
+
|
|
655
|
+
### Example 1: Debugging with Abductive Reasoning
|
|
656
|
+
|
|
657
|
+
```json
|
|
658
|
+
// Step 1: Start with observation
|
|
659
|
+
{
|
|
660
|
+
"tool": "deepthinking_core",
|
|
661
|
+
"arguments": {
|
|
662
|
+
"mode": "abductive",
|
|
663
|
+
"thought": "Observed: Users report intermittent 500 errors on checkout during high traffic periods",
|
|
664
|
+
"thoughtNumber": 1,
|
|
665
|
+
"totalThoughts": 4,
|
|
666
|
+
"nextThoughtNeeded": true,
|
|
667
|
+
"observations": ["Errors occur during high traffic", "Checkout page affected", "Intermittent pattern"]
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
// Step 2: Generate hypothesis
|
|
672
|
+
{
|
|
673
|
+
"tool": "deepthinking_core",
|
|
674
|
+
"arguments": {
|
|
675
|
+
"sessionId": "session-from-step-1",
|
|
676
|
+
"mode": "abductive",
|
|
677
|
+
"thought": "Hypothesis: Database connection pool exhaustion under load",
|
|
678
|
+
"thoughtNumber": 2,
|
|
679
|
+
"totalThoughts": 4,
|
|
680
|
+
"nextThoughtNeeded": true,
|
|
681
|
+
"hypotheses": [{
|
|
682
|
+
"id": "h1",
|
|
683
|
+
"explanation": "Connection pool exhausted",
|
|
684
|
+
"assumptions": ["Fixed pool size", "No connection recycling"],
|
|
685
|
+
"predictions": ["Errors correlate with traffic spikes"],
|
|
686
|
+
"score": 0.8
|
|
687
|
+
}]
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
```
|
|
691
|
+
|
|
692
|
+
### Example 2: Impact Analysis with Causal Reasoning
|
|
693
|
+
|
|
694
|
+
```json
|
|
695
|
+
{
|
|
696
|
+
"tool": "deepthinking_causal",
|
|
697
|
+
"arguments": {
|
|
698
|
+
"mode": "causal",
|
|
699
|
+
"thought": "Analyzing impact of increasing API rate limits on system behavior",
|
|
700
|
+
"thoughtNumber": 1,
|
|
701
|
+
"totalThoughts": 3,
|
|
702
|
+
"nextThoughtNeeded": true,
|
|
703
|
+
"causalGraph": {
|
|
704
|
+
"nodes": [
|
|
705
|
+
{"id": "rate_limit", "name": "Rate Limit", "type": "cause", "description": "API rate limit setting"},
|
|
706
|
+
{"id": "server_load", "name": "Server Load", "type": "mediator", "description": "CPU/Memory usage"},
|
|
707
|
+
{"id": "response_time", "name": "Response Time", "type": "effect", "description": "API latency"},
|
|
708
|
+
{"id": "satisfaction", "name": "User Satisfaction", "type": "effect", "description": "User experience"}
|
|
709
|
+
],
|
|
710
|
+
"edges": [
|
|
711
|
+
{"from": "rate_limit", "to": "server_load", "strength": 0.9, "confidence": 0.85},
|
|
712
|
+
{"from": "server_load", "to": "response_time", "strength": 0.85, "confidence": 0.9},
|
|
713
|
+
{"from": "response_time", "to": "satisfaction", "strength": -0.7, "confidence": 0.8}
|
|
714
|
+
]
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
```
|
|
719
|
+
|
|
720
|
+
### Example 3: Strategic Analysis with Game Theory
|
|
721
|
+
|
|
722
|
+
```json
|
|
723
|
+
{
|
|
724
|
+
"tool": "deepthinking_strategic",
|
|
725
|
+
"arguments": {
|
|
726
|
+
"mode": "gametheory",
|
|
727
|
+
"thought": "Analyzing pricing strategy in competitive market using game theory",
|
|
728
|
+
"thoughtNumber": 1,
|
|
729
|
+
"totalThoughts": 3,
|
|
730
|
+
"nextThoughtNeeded": true,
|
|
731
|
+
"game": {
|
|
732
|
+
"type": "strategic",
|
|
733
|
+
"players": ["Company A", "Company B"],
|
|
734
|
+
"strategies": {
|
|
735
|
+
"Company A": ["premium", "competitive", "discount"],
|
|
736
|
+
"Company B": ["premium", "competitive", "discount"]
|
|
737
|
+
},
|
|
738
|
+
"payoffMatrix": [
|
|
739
|
+
[{"A": 10, "B": 10}, {"A": 5, "B": 15}, {"A": 2, "B": 12}],
|
|
740
|
+
[{"A": 15, "B": 5}, {"A": 8, "B": 8}, {"A": 4, "B": 10}],
|
|
741
|
+
[{"A": 12, "B": 2}, {"A": 10, "B": 4}, {"A": 6, "B": 6}]
|
|
742
|
+
]
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
```
|
|
747
|
+
|
|
748
|
+
## Production Features
|
|
749
|
+
|
|
750
|
+
> **Note**: DeepThinking MCP is an MCP server, not a library. These features are accessed through MCP tools and internal architecture. The examples below describe the internal capabilities.
|
|
751
|
+
|
|
752
|
+
### Proof Decomposition (v7.0.0)
|
|
753
|
+
|
|
754
|
+
Advanced mathematical reasoning with proof analysis:
|
|
755
|
+
|
|
756
|
+
- **ProofDecomposer**: Break proofs into atomic statements with dependency graphs
|
|
757
|
+
- **GapAnalyzer**: Detect missing steps, unjustified leaps, implicit assumptions
|
|
758
|
+
- **AssumptionTracker**: Trace conclusions to their supporting assumptions
|
|
759
|
+
- **InconsistencyDetector**: Find circular dependencies and contradictions
|
|
760
|
+
- **Native SVG Export**: Generate proof visualizations without external tools
|
|
761
|
+
|
|
762
|
+
### Search Engine
|
|
763
|
+
|
|
764
|
+
Full-text search with faceted filtering and relevance ranking. Used internally to search across reasoning sessions by mode, tags, date ranges, and content.
|
|
765
|
+
|
|
766
|
+
### Template System
|
|
767
|
+
|
|
768
|
+
Pre-built templates for common reasoning patterns, accessible through session creation.
|
|
769
|
+
|
|
770
|
+
### File Export System
|
|
771
|
+
|
|
772
|
+
Export reasoning sessions directly to files with automatic directory organization:
|
|
773
|
+
|
|
774
|
+
- **Automatic File Output** - Configure `MCP_EXPORT_PATH` to write exports to disk instead of returning content
|
|
775
|
+
- **Session Subdirectories** - Files organized by session ID for easy management
|
|
776
|
+
- **Export Profiles** - Pre-configured bundles: `academic` (LaTeX+Markdown+JSON), `presentation` (Mermaid+HTML+ASCII), `documentation`, `archive`, `minimal`
|
|
777
|
+
- **8 Export Formats** - Markdown, LaTeX, JSON, HTML, Jupyter, Mermaid, DOT, ASCII
|
|
778
|
+
- **Overwrite Protection** - Files won't be overwritten unless `overwrite: true` or `MCP_EXPORT_OVERWRITE=true`
|
|
779
|
+
|
|
780
|
+
```json
|
|
781
|
+
// Export single format
|
|
782
|
+
{ "action": "export", "sessionId": "...", "exportFormat": "mermaid" }
|
|
783
|
+
|
|
784
|
+
// Export with profile
|
|
785
|
+
{ "action": "export", "sessionId": "...", "exportProfile": "academic" }
|
|
786
|
+
|
|
787
|
+
// Export all 8 formats
|
|
788
|
+
{ "action": "export_all", "sessionId": "..." }
|
|
789
|
+
```
|
|
790
|
+
|
|
791
|
+
### Security & Validation
|
|
792
|
+
|
|
793
|
+
Enterprise-grade security features built into the MCP server:
|
|
794
|
+
|
|
795
|
+
- **Input Validation** - Zod schemas validate all 33 mode inputs
|
|
796
|
+
- **Rate Limiting** - Sliding window rate limiter for API protection
|
|
797
|
+
- **Path Sanitization** - Prevents directory traversal attacks
|
|
798
|
+
- **PII Redaction** - GDPR-compliant log sanitization
|
|
799
|
+
|
|
800
|
+
### Taxonomy Classifier
|
|
801
|
+
|
|
802
|
+
Intelligent classification of reasoning tasks using 69 reasoning types across 12 categories. Use the `recommend_mode` action in `deepthinking_session` to get mode recommendations based on problem characteristics.
|
|
803
|
+
|
|
804
|
+
## API Documentation
|
|
805
|
+
|
|
806
|
+
### MCP Tool Interface
|
|
807
|
+
|
|
808
|
+
All reasoning is done through MCP tools. Each tool accepts arguments and returns JSON responses.
|
|
809
|
+
|
|
810
|
+
#### Common Parameters (all thinking tools)
|
|
811
|
+
|
|
812
|
+
| Parameter | Type | Required | Description |
|
|
813
|
+
|-----------|------|----------|-------------|
|
|
814
|
+
| `sessionId` | string | No | Session ID (auto-created if omitted) |
|
|
815
|
+
| `thought` | string | Yes | The reasoning content |
|
|
816
|
+
| `thoughtNumber` | integer | Yes | Current thought number (1-based) |
|
|
817
|
+
| `totalThoughts` | integer | Yes | Estimated total thoughts |
|
|
818
|
+
| `nextThoughtNeeded` | boolean | Yes | Whether more reasoning needed |
|
|
819
|
+
| `mode` | string | Yes | The reasoning mode |
|
|
820
|
+
|
|
821
|
+
#### Session Actions (`deepthinking_session`)
|
|
822
|
+
|
|
823
|
+
| Action | Parameters | Description |
|
|
824
|
+
|--------|------------|-------------|
|
|
825
|
+
| `summarize` | `sessionId` | Generate session summary |
|
|
826
|
+
| `export` | `sessionId`, `exportFormat` | Export to format (json, markdown, latex, html, jupyter, mermaid, dot, ascii, svg) |
|
|
827
|
+
| `get_session` | `sessionId` | Get session details |
|
|
828
|
+
| `switch_mode` | `sessionId`, `newMode` | Switch reasoning mode |
|
|
829
|
+
| `recommend_mode` | `problemType` or `problemCharacteristics` | Get mode recommendations |
|
|
830
|
+
|
|
831
|
+
#### Example Response
|
|
832
|
+
|
|
833
|
+
```json
|
|
834
|
+
{
|
|
835
|
+
"sessionId": "session-abc123",
|
|
836
|
+
"thoughtId": "thought-xyz789",
|
|
837
|
+
"thoughtNumber": 1,
|
|
838
|
+
"mode": "sequential",
|
|
839
|
+
"nextThoughtNeeded": true,
|
|
840
|
+
"sessionComplete": false,
|
|
841
|
+
"totalThoughts": 3
|
|
842
|
+
}
|
|
843
|
+
```
|
|
844
|
+
|
|
845
|
+
For architecture details, see [docs/architecture/](docs/architecture/).
|
|
846
|
+
|
|
847
|
+
## Project Stats
|
|
848
|
+
|
|
849
|
+
| Metric | Value |
|
|
850
|
+
|--------|-------|
|
|
851
|
+
| TypeScript Files | 237 |
|
|
852
|
+
| Lines of Code | ~102,500 |
|
|
853
|
+
| Test Files | 181 |
|
|
854
|
+
| Passing Tests | 5,048 |
|
|
855
|
+
| Thinking Modes | 34 (30 with thought types) |
|
|
856
|
+
| ModeHandlers | 37 specialized handlers |
|
|
857
|
+
| MCP Tools | 13 focused tools |
|
|
858
|
+
| Export Formats | 8 + native SVG |
|
|
859
|
+
| Visual Exporters | 42 files (24 mode-specific) |
|
|
860
|
+
| Builder Classes | 14 fluent APIs |
|
|
861
|
+
| Reasoning Types | 69 (110 planned) |
|
|
862
|
+
| Modules | 15 |
|
|
863
|
+
| Total Exports | 1,275 (571 re-exports) |
|
|
864
|
+
|
|
865
|
+
|
|
866
|
+
## Architecture
|
|
867
|
+
|
|
868
|
+
The codebase is organized into 15 modules with clean separation of concerns. See [docs/architecture/DEPENDENCY_GRAPH.md](docs/architecture/DEPENDENCY_GRAPH.md) for the complete dependency graph.
|
|
869
|
+
|
|
870
|
+
### Core Structure
|
|
871
|
+
|
|
872
|
+
```
|
|
873
|
+
src/
|
|
874
|
+
├── index.ts # MCP server entry point (tool handlers)
|
|
875
|
+
├── types/ # Type definitions including 33 mode types (36 files)
|
|
876
|
+
│ ├── core.ts # ThinkingMode enum, Thought union type
|
|
877
|
+
│ └── modes/ # One file per reasoning mode
|
|
878
|
+
├── services/ # Business logic layer (2 files)
|
|
879
|
+
│ ├── ThoughtFactory.ts # Thought creation with handler integration
|
|
880
|
+
│ └── ExportService.ts # Multi-format export handling
|
|
881
|
+
├── session/ # SessionManager, persistence, storage (4 files)
|
|
882
|
+
├── modes/ # ModeHandler architecture (v9.x) - 52 files
|
|
883
|
+
│ ├── handlers/ # 38 specialized handlers (all modes covered)
|
|
884
|
+
│ │ ├── CausalHandler.ts # Graph validation, cycle detection
|
|
885
|
+
│ │ ├── BayesianHandler.ts # Auto posterior calculation
|
|
886
|
+
│ │ ├── GameTheoryHandler.ts # Nash equilibria detection
|
|
887
|
+
│ │ ├── CounterfactualHandler.ts # World state tracking
|
|
888
|
+
│ │ ├── SynthesisHandler.ts # Source coverage tracking
|
|
889
|
+
│ │ ├── SystemsThinkingHandler.ts # 8 Systems Archetypes
|
|
890
|
+
│ │ ├── CritiqueHandler.ts # 6 Socratic categories
|
|
891
|
+
│ │ └── [+ 31 more specialized handlers]
|
|
892
|
+
│ └── registry.ts # ModeHandlerRegistry singleton
|
|
893
|
+
├── proof/ # Proof decomposition system (13 files)
|
|
894
|
+
│ ├── decomposer.ts # ProofDecomposer class
|
|
895
|
+
│ ├── gap-analyzer.ts # GapAnalyzer class
|
|
896
|
+
│ └── assumption-tracker.ts # AssumptionTracker class
|
|
897
|
+
└── tools/ # MCP tool definitions and schemas (18 files)
|
|
898
|
+
```
|
|
899
|
+
|
|
900
|
+
### ModeHandler Architecture (v9.x)
|
|
901
|
+
|
|
902
|
+
The ModeHandler pattern (Strategy pattern) provides mode-specific processing, with **all 33 modes fully covered**:
|
|
903
|
+
|
|
904
|
+
```typescript
|
|
905
|
+
// Handler interface
|
|
906
|
+
interface ModeHandler {
|
|
907
|
+
mode: ThinkingMode;
|
|
908
|
+
validate(input: ThinkingToolInput): ValidationResult;
|
|
909
|
+
enhance(thought: Thought, context: SessionContext): Thought;
|
|
910
|
+
getSuggestions(thought: Thought): string[];
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
// Registry manages all 38 handlers
|
|
914
|
+
const registry = ModeHandlerRegistry.getInstance();
|
|
915
|
+
registry.hasSpecializedHandler('causal'); // true for ALL 33 modes
|
|
916
|
+
```
|
|
917
|
+
|
|
918
|
+
**Benefits:**
|
|
919
|
+
- All 33 modes have specialized validation logic
|
|
920
|
+
- Automatic enhancements (posteriors, equilibria, archetypes)
|
|
921
|
+
- Mode-specific suggestions and warnings
|
|
922
|
+
- Clean separation from ThoughtFactory
|
|
923
|
+
- 38 total handlers (33 modes + GenericModeHandler + CustomHandler + utilities)
|
|
924
|
+
|
|
925
|
+
### Feature Modules
|
|
926
|
+
|
|
927
|
+
```
|
|
928
|
+
src/
|
|
929
|
+
├── taxonomy/ # 69 reasoning types, classifier, suggestion engine (5 files)
|
|
930
|
+
│ ├── reasoning-types.ts # Full taxonomy definitions
|
|
931
|
+
│ ├── classifier.ts # Task classification
|
|
932
|
+
│ └── suggestion-engine.ts # Mode recommendations
|
|
933
|
+
├── export/ # Visual and document exporters (44 files)
|
|
934
|
+
│ ├── visual/ # Mode-specific visual exporters + native SVG
|
|
935
|
+
│ │ ├── proof-decomposition.ts # Proof visualization
|
|
936
|
+
│ │ ├── utils/ # 14 builder classes
|
|
937
|
+
│ │ └── modes/ # 22 mode-specific exporters
|
|
938
|
+
│ └── latex.ts # LaTeX document generation
|
|
939
|
+
├── search/ # Full-text search with TF-IDF (3 files)
|
|
940
|
+
├── cache/ # LRU caching strategies (3 files)
|
|
941
|
+
├── validation/ # Zod schemas (44 files, 35 validators)
|
|
942
|
+
└── utils/ # Utility functions (6 files)
|
|
943
|
+
```
|
|
944
|
+
|
|
945
|
+
### Security Features
|
|
946
|
+
|
|
947
|
+
Security is built into multiple modules:
|
|
948
|
+
|
|
949
|
+
- **validation/** - Input validation with Zod schemas for all 33 modes (35 validators)
|
|
950
|
+
- **utils/sanitization.ts** - Path sanitization & traversal prevention
|
|
951
|
+
- **utils/log-sanitizer.ts** - PII redaction for GDPR compliance
|
|
952
|
+
- **utils/errors.ts** - Standardized error hierarchy with context
|
|
953
|
+
|
|
954
|
+
## Contributing
|
|
955
|
+
|
|
956
|
+
We welcome contributions! Please open an issue or pull request on [GitHub](https://github.com/danielsimonjr/deepthinking-mcp).
|
|
957
|
+
|
|
958
|
+
### Adding New Reasoning Modes
|
|
959
|
+
|
|
960
|
+
Want to add a new reasoning mode? We've made it easy:
|
|
961
|
+
|
|
962
|
+
📖 **[Complete Guide: Adding a New Mode](docs/ADDING_NEW_MODE.md)**
|
|
963
|
+
|
|
964
|
+
This guide includes:
|
|
965
|
+
- Step-by-step instructions for all 8 required files
|
|
966
|
+
- Template files in `templates/mode-scaffolding/`
|
|
967
|
+
- Code examples and common patterns
|
|
968
|
+
- Complete checklist to ensure nothing is missed
|
|
969
|
+
- Testing guidelines
|
|
970
|
+
|
|
971
|
+
**Quick Start**:
|
|
972
|
+
```bash
|
|
973
|
+
# Copy template files
|
|
974
|
+
cp templates/mode-scaffolding/example-mode.type.ts src/types/modes/yourmode.ts
|
|
975
|
+
cp templates/mode-scaffolding/example-mode.validator.ts src/validation/validators/modes/yourmode.ts
|
|
976
|
+
|
|
977
|
+
# Follow the guide
|
|
978
|
+
cat docs/ADDING_NEW_MODE.md
|
|
979
|
+
```
|
|
980
|
+
|
|
981
|
+
### Development Setup
|
|
982
|
+
|
|
983
|
+
```bash
|
|
984
|
+
# Clone repository
|
|
985
|
+
git clone https://github.com/danielsimonjr/deepthinking-mcp.git
|
|
986
|
+
cd deepthinking-mcp
|
|
987
|
+
|
|
988
|
+
# Install dependencies
|
|
989
|
+
npm install
|
|
990
|
+
|
|
991
|
+
# Run tests
|
|
992
|
+
npm test
|
|
993
|
+
|
|
994
|
+
# Run type checking
|
|
995
|
+
npm run typecheck
|
|
996
|
+
|
|
997
|
+
# Build
|
|
998
|
+
npm run build
|
|
999
|
+
```
|
|
1000
|
+
|
|
1001
|
+
### Running Tests
|
|
1002
|
+
|
|
1003
|
+
```bash
|
|
1004
|
+
# Run all tests
|
|
1005
|
+
npm test
|
|
1006
|
+
|
|
1007
|
+
# Run specific test file
|
|
1008
|
+
npm test -- path/to/test.test.ts
|
|
1009
|
+
|
|
1010
|
+
# Run with coverage
|
|
1011
|
+
npm run test:coverage
|
|
1012
|
+
```
|
|
1013
|
+
|
|
1014
|
+
## License
|
|
1015
|
+
|
|
1016
|
+
MIT License - see [LICENSE](LICENSE) file for details.
|
|
1017
|
+
|
|
1018
|
+
## Acknowledgments
|
|
1019
|
+
|
|
1020
|
+
This project builds upon foundational work from the MCP community:
|
|
1021
|
+
|
|
1022
|
+
- **[Anthropic's sequential-thinking MCP](https://github.com/modelcontextprotocol/servers/tree/main/src/sequentialthinking)** - The original sequential thinking server that inspired this project's core architecture
|
|
1023
|
+
- **[olaservo's shannon-thinking MCP](https://github.com/olaservo/shannon-thinking)** - Introduced the Shannon 5-stage methodology that became one of our core reasoning modes
|
|
1024
|
+
|
|
1025
|
+
Additional acknowledgments:
|
|
1026
|
+
- Built on the [Model Context Protocol](https://modelcontextprotocol.io)
|
|
1027
|
+
- Inspired by research in cognitive science and AI reasoning
|
|
1028
|
+
- Community contributions from researchers and practitioners
|
|
1029
|
+
|
|
1030
|
+
## Support
|
|
1031
|
+
|
|
1032
|
+
- 📚 [Documentation](docs/)
|
|
1033
|
+
- 🐛 [Issue Tracker](https://github.com/danielsimonjr/deepthinking-mcp/issues)
|
|
1034
|
+
- 💬 [Discussions](https://github.com/danielsimonjr/deepthinking-mcp/discussions)
|
|
1035
|
+
|
|
1036
|
+
---
|
|
1037
|
+
|
|
1038
|
+
Made with ❤️ by the DeepThinking MCP team
|