deepthinking-mcp 3.0.2 → 3.5.0
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 +641 -798
- package/dist/index.js +3328 -699
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,798 +1,641 @@
|
|
|
1
|
-
# DeepThinking MCP
|
|
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
|
-
Use
|
|
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
|
-
DeepThinking MCP includes **397 tests** across **24 test files** with **100% pass rate**:
|
|
643
|
-
|
|
644
|
-
- **Unit Tests**: Core functionality, validators, session management
|
|
645
|
-
- **Integration Tests (94 tests)**: MCP protocol compliance, multi-session scenarios, error handling
|
|
646
|
-
- **Benchmark Tests**: Performance validation (15x speedup with caching)
|
|
647
|
-
- **Mode-Specific Tests**: All 13 reasoning modes thoroughly tested
|
|
648
|
-
|
|
649
|
-
**Test Coverage:**
|
|
650
|
-
```bash
|
|
651
|
-
# Run full test suite
|
|
652
|
-
npm test
|
|
653
|
-
|
|
654
|
-
# Run with coverage report
|
|
655
|
-
npm run test:coverage
|
|
656
|
-
|
|
657
|
-
# Run specific test file
|
|
658
|
-
npm test -- tests/integration/mcp-protocol.test.ts
|
|
659
|
-
```
|
|
660
|
-
|
|
661
|
-
**Test Results:**
|
|
662
|
-
- Test Files: 24 passed
|
|
663
|
-
- Tests: 397 passed
|
|
664
|
-
- Duration: ~7-8 seconds
|
|
665
|
-
- Pass Rate: 100%
|
|
666
|
-
|
|
667
|
-
#### CI/CD Pipeline
|
|
668
|
-
|
|
669
|
-
Automated workflows using GitHub Actions ensure code quality and reliability:
|
|
670
|
-
|
|
671
|
-
**Test Workflow** (`.github/workflows/test.yml`):
|
|
672
|
-
- Multi-OS testing: Ubuntu, Windows, macOS
|
|
673
|
-
- Multi-Node version: 18.x, 20.x, 22.x
|
|
674
|
-
- Runs: TypeScript checks, linter, formatter, full test suite
|
|
675
|
-
- Test result artifacts with 30-day retention
|
|
676
|
-
|
|
677
|
-
**Coverage Workflow** (`.github/workflows/coverage.yml`):
|
|
678
|
-
- Generates detailed coverage reports
|
|
679
|
-
- Codecov integration for coverage tracking
|
|
680
|
-
- PR comments with coverage summary
|
|
681
|
-
- Coverage badge generation
|
|
682
|
-
- Threshold warnings (<60% triggers warning)
|
|
683
|
-
|
|
684
|
-
**Release Workflow** (`.github/workflows/release.yml`):
|
|
685
|
-
- Automated releases on version tags (v*.*.*)
|
|
686
|
-
- Pre-release testing (type check + full test suite)
|
|
687
|
-
- GitHub release creation with changelog
|
|
688
|
-
- npm publishing (requires NPM_TOKEN)
|
|
689
|
-
- Workflow dispatch for manual releases
|
|
690
|
-
|
|
691
|
-
**Branch Protection:**
|
|
692
|
-
See `.github/BRANCH_PROTECTION.md` for recommended settings:
|
|
693
|
-
- Required status checks before merging
|
|
694
|
-
- PR review requirements
|
|
695
|
-
- Linear history enforcement
|
|
696
|
-
- Force push protection
|
|
697
|
-
|
|
698
|
-
#### Integration Tests
|
|
699
|
-
|
|
700
|
-
**MCP Protocol Compliance** (43 tests):
|
|
701
|
-
- Tool schema validation for all 13 modes
|
|
702
|
-
- Required/optional field validation
|
|
703
|
-
- MCP response format compliance
|
|
704
|
-
- Error handling for invalid inputs
|
|
705
|
-
|
|
706
|
-
**Multi-Session Scenarios** (18 tests):
|
|
707
|
-
- Session isolation and concurrent operations
|
|
708
|
-
- Resource management (50+ sessions)
|
|
709
|
-
- State consistency verification
|
|
710
|
-
- Concurrent error handling
|
|
711
|
-
|
|
712
|
-
**Error Handling & Edge Cases** (36 tests):
|
|
713
|
-
- Invalid session operations
|
|
714
|
-
- Boundary conditions (0, 1, MAX_SAFE_INTEGER)
|
|
715
|
-
- Large data handling (100 thoughts, 50 dependencies)
|
|
716
|
-
- Unicode and special character support
|
|
717
|
-
- Mode-specific edge cases
|
|
718
|
-
|
|
719
|
-
## Architecture
|
|
720
|
-
|
|
721
|
-
```
|
|
722
|
-
deepthinking-mcp/
|
|
723
|
-
├── src/
|
|
724
|
-
│ ├── types/ # Type definitions
|
|
725
|
-
│ │ ├── core.ts # Core thought types
|
|
726
|
-
│ │ └── session.ts # Session management types
|
|
727
|
-
│ ├── tools/ # MCP tool definitions
|
|
728
|
-
│ ├── session/ # Session manager
|
|
729
|
-
│ ├── modes/ # Mode implementations
|
|
730
|
-
│ ├── validation/ # Validation logic
|
|
731
|
-
│ └── index.ts # Main MCP server
|
|
732
|
-
├── tests/ # Test suite
|
|
733
|
-
├── docs/ # Documentation
|
|
734
|
-
└── examples/ # Usage examples
|
|
735
|
-
```
|
|
736
|
-
|
|
737
|
-
## Roadmap
|
|
738
|
-
|
|
739
|
-
### Phase 1 (Completed - v1.0)
|
|
740
|
-
- ✅ Core type system
|
|
741
|
-
- ✅ Session management
|
|
742
|
-
- ✅ Unified thinking tool
|
|
743
|
-
- ✅ 5 core reasoning modes
|
|
744
|
-
|
|
745
|
-
### Phase 2 (Completed - v2.0)
|
|
746
|
-
- ✅ Validation engine
|
|
747
|
-
- ✅ 5 advanced reasoning modes (Abductive, Causal, Bayesian, Counterfactual, Analogical)
|
|
748
|
-
- ✅ Comprehensive test suite (77 tests)
|
|
749
|
-
- ✅ Enhanced type safety
|
|
750
|
-
|
|
751
|
-
### Phase 3 (Completed - v3.0.2)
|
|
752
|
-
- ✅ Temporal reasoning mode (v2.1)
|
|
753
|
-
- ✅ Game theory mode (v2.2)
|
|
754
|
-
- ✅ Evidential reasoning mode (v2.3)
|
|
755
|
-
- ✅ Mode recommendation system (v2.4)
|
|
756
|
-
- ✅ Visual exports - Mermaid, DOT, ASCII (v2.5)
|
|
757
|
-
- ✅ Export to LaTeX/Jupyter/HTML (v2.5)
|
|
758
|
-
- ✅ Performance optimization with validation caching (v3.0)
|
|
759
|
-
- ✅ Integration tests & MCP compliance (v3.0.2)
|
|
760
|
-
- ✅ CI/CD pipeline with GitHub Actions (v3.0.2)
|
|
761
|
-
|
|
762
|
-
### Phase 4 (Planned)
|
|
763
|
-
- [ ] Math-MCP integration
|
|
764
|
-
- [ ] Persistence layer
|
|
765
|
-
- [ ] Collaborative thinking sessions
|
|
766
|
-
- [ ] Pattern learning from successful reasoning chains
|
|
767
|
-
- [ ] Advanced visualization dashboard
|
|
768
|
-
- [ ] Real-time reasoning collaboration
|
|
769
|
-
|
|
770
|
-
## Contributing
|
|
771
|
-
|
|
772
|
-
Contributions welcome! Please ensure:
|
|
773
|
-
|
|
774
|
-
1. **All tests pass**: Run `npm test` before submitting PRs
|
|
775
|
-
2. **Type checking passes**: Run `npm run typecheck`
|
|
776
|
-
3. **Code formatting**: Run `npm run format:check` or `npm run format`
|
|
777
|
-
4. **Linting passes**: Run `npm run lint`
|
|
778
|
-
5. **CI/CD workflows pass**: All GitHub Actions checks must pass
|
|
779
|
-
6. **Test coverage**: Maintain or improve test coverage
|
|
780
|
-
7. **Documentation**: Update README.md and CHANGELOG.md for new features
|
|
781
|
-
|
|
782
|
-
See `.github/BRANCH_PROTECTION.md` for branch protection requirements and `.github/workflows/` for CI/CD pipeline details.
|
|
783
|
-
|
|
784
|
-
## License
|
|
785
|
-
|
|
786
|
-
MIT
|
|
787
|
-
|
|
788
|
-
## Credits
|
|
789
|
-
|
|
790
|
-
Built upon:
|
|
791
|
-
- [sequential-thinking](https://github.com/modelcontextprotocol/servers/tree/main/src/sequentialthinking) by Anthropic
|
|
792
|
-
- [shannon-thinking](https://github.com/olaservo/shannon-thinking) by olaservo
|
|
793
|
-
- Enhanced for mathematical and physics reasoning by Daniel Simon Jr.
|
|
794
|
-
|
|
795
|
-
## Support
|
|
796
|
-
|
|
797
|
-
- GitHub Issues: [Report bugs or request features](https://github.com/danielsimonjr/deepthinking-mcp/issues)
|
|
798
|
-
- Documentation: [Full docs](https://github.com/danielsimonjr/deepthinking-mcp/tree/main/docs)
|
|
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 **18 advanced reasoning modes** 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**: v3.5.0 - See [CHANGELOG](CHANGELOG.md) for updates and improvements.
|
|
10
|
+
>
|
|
11
|
+
> 🎉 **New in v3.5.0**: Production-ready architecture, enterprise security, taxonomy classifier, zero TypeScript suppressions, 30/31 implementation tasks complete!
|
|
12
|
+
|
|
13
|
+
## Table of Contents
|
|
14
|
+
|
|
15
|
+
- [Features](#features)
|
|
16
|
+
- [Installation](#installation)
|
|
17
|
+
- [Quick Start](#quick-start)
|
|
18
|
+
- [Reasoning Modes](#reasoning-modes)
|
|
19
|
+
- [Usage Examples](#usage-examples)
|
|
20
|
+
- [Production Features](#production-features)
|
|
21
|
+
- [API Documentation](#api-documentation)
|
|
22
|
+
- [Contributing](#contributing)
|
|
23
|
+
- [License](#license)
|
|
24
|
+
|
|
25
|
+
## Features
|
|
26
|
+
|
|
27
|
+
- **18 Specialized Reasoning Modes** - From sequential thinking to game theory and formal logic
|
|
28
|
+
- **Intelligent Mode Recommendation** - Automatic mode selection based on problem characteristics
|
|
29
|
+
- **Taxonomy Classifier** - 110+ reasoning types across 12 categories for intelligent task classification
|
|
30
|
+
- **Visual Exports** - Generate Mermaid diagrams, DOT graphs, ASCII art, and LaTeX documents
|
|
31
|
+
- **Production-Ready** - Search engine, templates, batch processing, caching, backup/restore
|
|
32
|
+
- **Enterprise Security** - Input validation (Zod), rate limiting, path sanitization, PII redaction
|
|
33
|
+
- **High Performance** - LRU caching with auto-eviction, async I/O, 4-5x validation speedups
|
|
34
|
+
- **Type-Safe** - 100% TypeScript with zero suppressions (down from 231 baseline)
|
|
35
|
+
- **Repository Pattern** - Clean architecture with dependency injection
|
|
36
|
+
- **Extensible** - Plugin architecture for custom reasoning modes
|
|
37
|
+
- **MCP Compatible** - Full integration with Model Context Protocol
|
|
38
|
+
|
|
39
|
+
## Installation
|
|
40
|
+
|
|
41
|
+
### NPM Package
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npm install deepthinking-mcp
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### From Source
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
git clone https://github.com/yourusername/deepthinking-mcp.git
|
|
51
|
+
cd deepthinking-mcp
|
|
52
|
+
npm install
|
|
53
|
+
npm run build
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### MCP Configuration
|
|
57
|
+
|
|
58
|
+
Add to your MCP settings file:
|
|
59
|
+
|
|
60
|
+
```json
|
|
61
|
+
{
|
|
62
|
+
"mcpServers": {
|
|
63
|
+
"deepthinking": {
|
|
64
|
+
"command": "npx",
|
|
65
|
+
"args": ["deepthinking-mcp"]
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Quick Start
|
|
72
|
+
|
|
73
|
+
### Basic Usage
|
|
74
|
+
|
|
75
|
+
```typescript
|
|
76
|
+
import { DeepThinkingServer } from 'deepthinking-mcp';
|
|
77
|
+
|
|
78
|
+
const server = new DeepThinkingServer();
|
|
79
|
+
|
|
80
|
+
// Start a sequential reasoning session
|
|
81
|
+
const session = await server.startThinking({
|
|
82
|
+
mode: 'sequential',
|
|
83
|
+
problem: 'Analyze the scalability challenges of a distributed system'
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
// Add thoughts iteratively
|
|
87
|
+
await server.addThought(session.id, {
|
|
88
|
+
content: 'First, identify the main bottlenecks...'
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
// Export results
|
|
92
|
+
const markdown = await server.exportSession(session.id, 'markdown');
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### MCP Tool Usage
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
// Use via MCP protocol
|
|
99
|
+
{
|
|
100
|
+
"tool": "start_thinking",
|
|
101
|
+
"arguments": {
|
|
102
|
+
"mode": "causal",
|
|
103
|
+
"problem": "What caused the service outage?"
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Reasoning Modes
|
|
109
|
+
|
|
110
|
+
### Core Modes
|
|
111
|
+
|
|
112
|
+
#### Sequential
|
|
113
|
+
Iterative refinement with revision capabilities. Perfect for step-by-step problem solving.
|
|
114
|
+
|
|
115
|
+
```typescript
|
|
116
|
+
mode: 'sequential'
|
|
117
|
+
// Use for: Debugging, algorithmic thinking, systematic analysis
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
#### Shannon
|
|
121
|
+
5-stage systematic problem-solving methodology (problem → constraints → model → proof → implementation).
|
|
122
|
+
|
|
123
|
+
```typescript
|
|
124
|
+
mode: 'shannon'
|
|
125
|
+
// Use for: Engineering problems, system design, complex optimizations
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
#### Mathematics
|
|
129
|
+
Theorem proving, lemma derivation, symbolic computation with LaTeX support.
|
|
130
|
+
|
|
131
|
+
```typescript
|
|
132
|
+
mode: 'mathematics'
|
|
133
|
+
// Use for: Proofs, mathematical modeling, symbolic algebra
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
#### Physics
|
|
137
|
+
Tensor mathematics, dimensional analysis, conservation laws, field theory.
|
|
138
|
+
|
|
139
|
+
```typescript
|
|
140
|
+
mode: 'physics'
|
|
141
|
+
// Use for: Physical modeling, dimensional analysis, scientific computing
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
#### Hybrid
|
|
145
|
+
Intelligently combines multiple reasoning modes based on problem characteristics.
|
|
146
|
+
|
|
147
|
+
```typescript
|
|
148
|
+
mode: 'hybrid'
|
|
149
|
+
// Use for: Complex multi-faceted problems requiring diverse approaches
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Advanced Modes
|
|
153
|
+
|
|
154
|
+
#### Abductive
|
|
155
|
+
Generate and evaluate hypotheses to explain observations.
|
|
156
|
+
|
|
157
|
+
```typescript
|
|
158
|
+
mode: 'abductive'
|
|
159
|
+
// Use for: Debugging, root cause analysis, diagnostic reasoning
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
#### Causal
|
|
163
|
+
Build causal graphs, analyze interventions and effects.
|
|
164
|
+
|
|
165
|
+
```typescript
|
|
166
|
+
mode: 'causal'
|
|
167
|
+
// Use for: Impact analysis, system design, decision making
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
#### Bayesian
|
|
171
|
+
Probabilistic reasoning with priors, likelihoods, and evidence updates.
|
|
172
|
+
|
|
173
|
+
```typescript
|
|
174
|
+
mode: 'bayesian'
|
|
175
|
+
// Use for: Risk assessment, A/B testing, uncertainty quantification
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
#### Counterfactual
|
|
179
|
+
Explore alternative scenarios and compare outcomes.
|
|
180
|
+
|
|
181
|
+
```typescript
|
|
182
|
+
mode: 'counterfactual'
|
|
183
|
+
// Use for: Post-mortems, strategic planning, what-if analysis
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
#### Analogical
|
|
187
|
+
Transfer knowledge across domains by identifying structural similarities.
|
|
188
|
+
|
|
189
|
+
```typescript
|
|
190
|
+
mode: 'analogical'
|
|
191
|
+
// Use for: Design patterns, innovative problem-solving, knowledge transfer
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### Specialized Modes
|
|
195
|
+
|
|
196
|
+
#### Temporal
|
|
197
|
+
Model events, intervals, and temporal relationships using Allen's interval algebra.
|
|
198
|
+
|
|
199
|
+
```typescript
|
|
200
|
+
mode: 'temporal'
|
|
201
|
+
// Use for: Timeline analysis, scheduling, event sequencing
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
#### Game Theory
|
|
205
|
+
Analyze strategic interactions, compute Nash equilibria, build game trees.
|
|
206
|
+
|
|
207
|
+
```typescript
|
|
208
|
+
mode: 'game-theory'
|
|
209
|
+
// Use for: Competitive analysis, mechanism design, strategic decisions
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
#### Evidential
|
|
213
|
+
Dempster-Shafer theory for reasoning with uncertain evidence.
|
|
214
|
+
|
|
215
|
+
```typescript
|
|
216
|
+
mode: 'evidential'
|
|
217
|
+
// Use for: Sensor fusion, intelligence analysis, incomplete information
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
#### First Principles
|
|
221
|
+
Derive conclusions from foundational axioms using deductive reasoning.
|
|
222
|
+
|
|
223
|
+
```typescript
|
|
224
|
+
mode: 'first-principles'
|
|
225
|
+
// Use for: Fundamental analysis, conceptual understanding, basic truths
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
#### Systems Thinking
|
|
229
|
+
Holistic analysis of complex systems, feedback loops, and emergence.
|
|
230
|
+
|
|
231
|
+
```typescript
|
|
232
|
+
mode: 'systems-thinking'
|
|
233
|
+
// Use for: Complex systems, organizational design, ecosystem analysis
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
#### Scientific Method
|
|
237
|
+
Hypothesis-driven experimentation with research design and statistical analysis.
|
|
238
|
+
|
|
239
|
+
```typescript
|
|
240
|
+
mode: 'scientific-method'
|
|
241
|
+
// Use for: Experimental design, hypothesis testing, research
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
#### Optimization
|
|
245
|
+
Constraint satisfaction and optimization with decision variables.
|
|
246
|
+
|
|
247
|
+
```typescript
|
|
248
|
+
mode: 'optimization'
|
|
249
|
+
// Use for: Resource allocation, scheduling, constrained optimization
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
#### Formal Logic
|
|
253
|
+
Rigorous logical reasoning with formal systems and proof verification.
|
|
254
|
+
|
|
255
|
+
```typescript
|
|
256
|
+
mode: 'formal-logic'
|
|
257
|
+
// Use for: Proof verification, logical analysis, formal methods
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
## Usage Examples
|
|
261
|
+
|
|
262
|
+
### Example 1: Debugging with Abductive Reasoning
|
|
263
|
+
|
|
264
|
+
```typescript
|
|
265
|
+
const session = await server.startThinking({
|
|
266
|
+
mode: 'abductive',
|
|
267
|
+
problem: 'Users report intermittent 500 errors on checkout'
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
await server.addThought(session.id, {
|
|
271
|
+
content: 'Observed: Errors occur during high traffic periods',
|
|
272
|
+
type: 'observation'
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
await server.addThought(session.id, {
|
|
276
|
+
content: 'Hypothesis 1: Database connection pool exhaustion',
|
|
277
|
+
type: 'hypothesis',
|
|
278
|
+
likelihood: 0.8
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
const analysis = await server.analyzeSession(session.id);
|
|
282
|
+
// Returns ranked hypotheses with supporting evidence
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
### Example 2: Impact Analysis with Causal Reasoning
|
|
286
|
+
|
|
287
|
+
```typescript
|
|
288
|
+
const session = await server.startThinking({
|
|
289
|
+
mode: 'causal',
|
|
290
|
+
problem: 'Impact of increasing API rate limits'
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
await server.addThought(session.id, {
|
|
294
|
+
content: 'Build causal graph',
|
|
295
|
+
causalGraph: {
|
|
296
|
+
nodes: ['rate_limit', 'server_load', 'response_time', 'user_satisfaction'],
|
|
297
|
+
edges: [
|
|
298
|
+
{ from: 'rate_limit', to: 'server_load', strength: 0.9 },
|
|
299
|
+
{ from: 'server_load', to: 'response_time', strength: 0.85 }
|
|
300
|
+
]
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
const intervention = await server.analyzeIntervention(session.id, {
|
|
305
|
+
variable: 'rate_limit',
|
|
306
|
+
change: '+50%'
|
|
307
|
+
});
|
|
308
|
+
// Returns predicted effects on downstream variables
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
### Example 3: Strategic Analysis with Game Theory
|
|
312
|
+
|
|
313
|
+
```typescript
|
|
314
|
+
const session = await server.startThinking({
|
|
315
|
+
mode: 'game-theory',
|
|
316
|
+
problem: 'Pricing strategy in competitive market'
|
|
317
|
+
});
|
|
318
|
+
|
|
319
|
+
await server.addThought(session.id, {
|
|
320
|
+
content: 'Define game structure',
|
|
321
|
+
game: {
|
|
322
|
+
players: ['us', 'competitor'],
|
|
323
|
+
strategies: {
|
|
324
|
+
us: ['premium', 'competitive', 'discount'],
|
|
325
|
+
competitor: ['premium', 'competitive', 'discount']
|
|
326
|
+
},
|
|
327
|
+
payoffs: {
|
|
328
|
+
// Payoff matrix for each strategy combination
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
});
|
|
332
|
+
|
|
333
|
+
const equilibria = await server.findNashEquilibria(session.id);
|
|
334
|
+
// Returns Nash equilibria and dominant strategies
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
## Production Features
|
|
338
|
+
|
|
339
|
+
### Search Engine
|
|
340
|
+
|
|
341
|
+
Full-text search with faceted filtering, autocomplete, and relevance ranking.
|
|
342
|
+
|
|
343
|
+
```typescript
|
|
344
|
+
const results = await server.search({
|
|
345
|
+
query: 'machine learning optimization',
|
|
346
|
+
facets: ['mode', 'tags'],
|
|
347
|
+
filters: {
|
|
348
|
+
modes: ['optimization', 'mathematics'],
|
|
349
|
+
dateRange: { from: new Date('2024-01-01') }
|
|
350
|
+
}
|
|
351
|
+
});
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
### Template System
|
|
355
|
+
|
|
356
|
+
Pre-built templates for common reasoning patterns.
|
|
357
|
+
|
|
358
|
+
```typescript
|
|
359
|
+
const templates = await server.listTemplates({
|
|
360
|
+
category: 'problem-solving',
|
|
361
|
+
difficulty: 'beginner'
|
|
362
|
+
});
|
|
363
|
+
|
|
364
|
+
const session = await server.instantiateTemplate(templates[0].id, {
|
|
365
|
+
title: 'My Analysis',
|
|
366
|
+
context: 'Specific problem details...'
|
|
367
|
+
});
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
### Batch Processing
|
|
371
|
+
|
|
372
|
+
Process multiple sessions concurrently with job tracking.
|
|
373
|
+
|
|
374
|
+
```typescript
|
|
375
|
+
const jobId = await server.submitBatchJob({
|
|
376
|
+
type: 'export',
|
|
377
|
+
sessionIds: ['session-1', 'session-2', 'session-3'],
|
|
378
|
+
format: 'latex'
|
|
379
|
+
});
|
|
380
|
+
|
|
381
|
+
const status = await server.getJobStatus(jobId);
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
### Backup & Restore
|
|
385
|
+
|
|
386
|
+
Automated backup with compression and local storage.
|
|
387
|
+
|
|
388
|
+
```typescript
|
|
389
|
+
const backupManager = new BackupManager({
|
|
390
|
+
provider: 'local',
|
|
391
|
+
config: { path: './backups' }
|
|
392
|
+
});
|
|
393
|
+
|
|
394
|
+
const backupId = await backupManager.backup(session);
|
|
395
|
+
const restored = await backupManager.restore(backupId);
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
### Session Comparison
|
|
399
|
+
|
|
400
|
+
Compare reasoning sessions to analyze differences and similarities.
|
|
401
|
+
|
|
402
|
+
```typescript
|
|
403
|
+
const comparison = await server.compareSessions(session1, session2);
|
|
404
|
+
|
|
405
|
+
console.log(comparison.similarity); // 0-1 scale
|
|
406
|
+
console.log(comparison.differences); // Detailed diff
|
|
407
|
+
console.log(comparison.metrics); // Quantitative metrics
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
### Security & Validation
|
|
411
|
+
|
|
412
|
+
Enterprise-grade security features with input validation, rate limiting, and PII protection.
|
|
413
|
+
|
|
414
|
+
```typescript
|
|
415
|
+
// Input validation with Zod schemas
|
|
416
|
+
import { validateInput, AddThoughtSchema } from 'deepthinking-mcp/validation';
|
|
417
|
+
|
|
418
|
+
const validated = validateInput(AddThoughtSchema, userInput);
|
|
419
|
+
// Throws ValidationError if invalid
|
|
420
|
+
|
|
421
|
+
// Rate limiting for API protection
|
|
422
|
+
import { RateLimiter } from 'deepthinking-mcp/rate-limit';
|
|
423
|
+
|
|
424
|
+
const limiter = new RateLimiter({
|
|
425
|
+
windowMs: 60000, // 1 minute window
|
|
426
|
+
maxRequests: 100, // 100 requests per window
|
|
427
|
+
keyPrefix: 'api:'
|
|
428
|
+
});
|
|
429
|
+
|
|
430
|
+
await limiter.checkLimit(userId); // Throws RateLimitError if exceeded
|
|
431
|
+
|
|
432
|
+
// Path sanitization prevents directory traversal
|
|
433
|
+
import { sanitizeFilename, validatePath } from 'deepthinking-mcp/utils';
|
|
434
|
+
|
|
435
|
+
const safeFilename = sanitizeFilename(userInput); // Removes dangerous characters
|
|
436
|
+
validatePath(targetPath, baseDir); // Prevents path traversal attacks
|
|
437
|
+
|
|
438
|
+
// Log sanitization for GDPR compliance
|
|
439
|
+
import { sanitizeForLogging } from 'deepthinking-mcp/utils';
|
|
440
|
+
|
|
441
|
+
logger.info('User action', sanitizeForLogging({
|
|
442
|
+
userId: user.id,
|
|
443
|
+
email: user.email, // Will be redacted as [REDACTED]
|
|
444
|
+
action: 'create_session'
|
|
445
|
+
}));
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
### Taxonomy Classifier
|
|
449
|
+
|
|
450
|
+
Intelligent classification of reasoning tasks using 110+ reasoning types across 12 categories.
|
|
451
|
+
|
|
452
|
+
```typescript
|
|
453
|
+
import { TaxonomyClassifier } from 'deepthinking-mcp/taxonomy';
|
|
454
|
+
|
|
455
|
+
const classifier = new TaxonomyClassifier();
|
|
456
|
+
|
|
457
|
+
const result = classifier.classify(
|
|
458
|
+
'How can we prove that the sum of two even numbers is always even?'
|
|
459
|
+
);
|
|
460
|
+
|
|
461
|
+
console.log(result.primaryCategory); // 'deductive'
|
|
462
|
+
console.log(result.primaryType); // 'Mathematical Proof'
|
|
463
|
+
console.log(result.confidence); // 0.95
|
|
464
|
+
console.log(result.secondaryTypes); // ['Formal Logic', 'Theorem Proving']
|
|
465
|
+
|
|
466
|
+
// Use for automatic mode selection
|
|
467
|
+
const mode = result.primaryType.mode; // Suggests best reasoning mode
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
## API Documentation
|
|
471
|
+
|
|
472
|
+
### Core Methods
|
|
473
|
+
|
|
474
|
+
#### `startThinking(options)`
|
|
475
|
+
|
|
476
|
+
Start a new thinking session.
|
|
477
|
+
|
|
478
|
+
**Parameters:**
|
|
479
|
+
- `mode` (string): Reasoning mode to use
|
|
480
|
+
- `problem` (string): Problem description
|
|
481
|
+
- `context?` (object): Additional context
|
|
482
|
+
|
|
483
|
+
**Returns:** `Promise<ThinkingSession>`
|
|
484
|
+
|
|
485
|
+
#### `addThought(sessionId, thought)`
|
|
486
|
+
|
|
487
|
+
Add a thought to an existing session.
|
|
488
|
+
|
|
489
|
+
**Parameters:**
|
|
490
|
+
- `sessionId` (string): Session identifier
|
|
491
|
+
- `thought` (object): Thought content and metadata
|
|
492
|
+
|
|
493
|
+
**Returns:** `Promise<Thought>`
|
|
494
|
+
|
|
495
|
+
#### `exportSession(sessionId, format)`
|
|
496
|
+
|
|
497
|
+
Export session to specified format.
|
|
498
|
+
|
|
499
|
+
**Parameters:**
|
|
500
|
+
- `sessionId` (string): Session identifier
|
|
501
|
+
- `format` ('markdown' | 'latex' | 'json' | 'mermaid' | 'dot' | 'ascii'): Export format
|
|
502
|
+
|
|
503
|
+
**Returns:** `Promise<string>`
|
|
504
|
+
|
|
505
|
+
### Advanced Methods
|
|
506
|
+
|
|
507
|
+
#### `recommendMode(problem, characteristics)`
|
|
508
|
+
|
|
509
|
+
Get intelligent mode recommendations.
|
|
510
|
+
|
|
511
|
+
**Parameters:**
|
|
512
|
+
- `problem` (string): Problem description
|
|
513
|
+
- `characteristics?` (object): Problem characteristics
|
|
514
|
+
|
|
515
|
+
**Returns:** `Promise<ModeRecommendation[]>`
|
|
516
|
+
|
|
517
|
+
#### `validateSession(sessionId)`
|
|
518
|
+
|
|
519
|
+
Validate session structure and content.
|
|
520
|
+
|
|
521
|
+
**Parameters:**
|
|
522
|
+
- `sessionId` (string): Session identifier
|
|
523
|
+
|
|
524
|
+
**Returns:** `Promise<ValidationResult>`
|
|
525
|
+
|
|
526
|
+
For complete API documentation, see [API.md](docs/API.md).
|
|
527
|
+
|
|
528
|
+
## Architecture
|
|
529
|
+
|
|
530
|
+
### Taxonomy System
|
|
531
|
+
|
|
532
|
+
Intelligent reasoning type classification and navigation.
|
|
533
|
+
|
|
534
|
+
```
|
|
535
|
+
taxonomy/
|
|
536
|
+
├── reasoning-types.ts # 100+ reasoning type definitions
|
|
537
|
+
├── navigator.ts # Query and exploration
|
|
538
|
+
├── suggestion-engine.ts # Mode recommendations
|
|
539
|
+
└── adaptive-selector.ts # Dynamic mode selection
|
|
540
|
+
```
|
|
541
|
+
|
|
542
|
+
### Export Formats
|
|
543
|
+
|
|
544
|
+
Multiple visualization and document formats.
|
|
545
|
+
|
|
546
|
+
```
|
|
547
|
+
exports/
|
|
548
|
+
├── latex/ # LaTeX document generation
|
|
549
|
+
├── markdown/ # Markdown formatting
|
|
550
|
+
├── mermaid/ # Mermaid diagrams
|
|
551
|
+
├── dot/ # Graphviz DOT graphs
|
|
552
|
+
└── ascii/ # ASCII art visualizations
|
|
553
|
+
```
|
|
554
|
+
|
|
555
|
+
### Production Systems
|
|
556
|
+
|
|
557
|
+
Enterprise-ready features for production deployment.
|
|
558
|
+
|
|
559
|
+
```
|
|
560
|
+
production/
|
|
561
|
+
├── search/ # Full-text search with facets & autocomplete
|
|
562
|
+
├── templates/ # Session templates with usage tracking
|
|
563
|
+
├── batch/ # Real batch processing (6 operations implemented)
|
|
564
|
+
├── cache/ # LRU caching with auto-eviction
|
|
565
|
+
├── backup/ # Local backup with compression
|
|
566
|
+
├── comparison/ # Session comparison & similarity analysis
|
|
567
|
+
├── validation/ # Zod-based input validation (8 schemas)
|
|
568
|
+
├── rate-limit/ # Sliding window rate limiter
|
|
569
|
+
└── repositories/ # Repository pattern with FileSessionRepository
|
|
570
|
+
```
|
|
571
|
+
|
|
572
|
+
### Security Features
|
|
573
|
+
|
|
574
|
+
Production-grade security and compliance.
|
|
575
|
+
|
|
576
|
+
```
|
|
577
|
+
security/
|
|
578
|
+
├── validation/ # Input validation with Zod schemas
|
|
579
|
+
├── sanitization/ # Path sanitization & traversal prevention
|
|
580
|
+
├── rate-limiting/ # Per-key rate limiting with sliding windows
|
|
581
|
+
├── log-redaction/ # PII redaction for GDPR compliance
|
|
582
|
+
└── error-handling/ # Standardized error hierarchy with context
|
|
583
|
+
```
|
|
584
|
+
|
|
585
|
+
## Contributing
|
|
586
|
+
|
|
587
|
+
We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
588
|
+
|
|
589
|
+
### Development Setup
|
|
590
|
+
|
|
591
|
+
```bash
|
|
592
|
+
# Clone repository
|
|
593
|
+
git clone https://github.com/yourusername/deepthinking-mcp.git
|
|
594
|
+
cd deepthinking-mcp
|
|
595
|
+
|
|
596
|
+
# Install dependencies
|
|
597
|
+
npm install
|
|
598
|
+
|
|
599
|
+
# Run tests
|
|
600
|
+
npm test
|
|
601
|
+
|
|
602
|
+
# Run type checking
|
|
603
|
+
npm run typecheck
|
|
604
|
+
|
|
605
|
+
# Build
|
|
606
|
+
npm run build
|
|
607
|
+
```
|
|
608
|
+
|
|
609
|
+
### Running Tests
|
|
610
|
+
|
|
611
|
+
```bash
|
|
612
|
+
# Run all tests
|
|
613
|
+
npm test
|
|
614
|
+
|
|
615
|
+
# Run specific test file
|
|
616
|
+
npm test -- path/to/test.test.ts
|
|
617
|
+
|
|
618
|
+
# Run with coverage
|
|
619
|
+
npm run test:coverage
|
|
620
|
+
```
|
|
621
|
+
|
|
622
|
+
## License
|
|
623
|
+
|
|
624
|
+
MIT License - see [LICENSE](LICENSE) file for details.
|
|
625
|
+
|
|
626
|
+
## Acknowledgments
|
|
627
|
+
|
|
628
|
+
- Built on the [Model Context Protocol](https://modelcontextprotocol.io)
|
|
629
|
+
- Inspired by research in cognitive science and AI reasoning
|
|
630
|
+
- Community contributions from researchers and practitioners
|
|
631
|
+
|
|
632
|
+
## Support
|
|
633
|
+
|
|
634
|
+
- 📚 [Documentation](docs/)
|
|
635
|
+
- 🐛 [Issue Tracker](https://github.com/yourusername/deepthinking-mcp/issues)
|
|
636
|
+
- 💬 [Discussions](https://github.com/yourusername/deepthinking-mcp/discussions)
|
|
637
|
+
- 📧 Email: support@example.com
|
|
638
|
+
|
|
639
|
+
---
|
|
640
|
+
|
|
641
|
+
Made with ❤️ by the DeepThinking MCP team
|