Deep Thinker

Advanced cognitive thinking MCP server with DAG-based thought graph, multiple reasoning strategies, metacognition, and self-evaluation.

deep-thinker

CI npm version npm downloads license GitHub stars

Advanced cognitive thinking MCP server with DAG-based thought graph, multiple reasoning strategies, metacognition, and self-evaluation.

A significant evolution beyond sequential-thinking MCP, providing structured deep reasoning with graph-based thought management.

Quick Start

npx deep-thinker
{
  "mcpServers": {
    "deep-thinker": {
      "command": "npx",
      "args": ["-y", "deep-thinker"]
    }
  }
}

Examples

ExampleStrategyUse Case
Architecture DecisionDialectic + ParallelMonolith vs microservices
Debugging IncidentAbductiveProduction 500 errors
Feature PrioritizationParallel + DialecticQ3 roadmap planning
Scientific HypothesisAnalogical + AbductiveLNP delivery for CRISPR
Breaking Dead EndsMetacognitive switchServerless cost analysis

Features

  • DAG-Based Thought Graph — Thoughts form a directed acyclic graph with branching, merging, and cross-edges (not just a linear chain)
  • 5 Reasoning Strategies — Sequential, Dialectic (thesis→antithesis→synthesis), Parallel, Analogical, Abductive (inference to best explanation)
  • Confidence Scoring — Multi-factor confidence evaluation with support/contradiction analysis, depth penalties, and knowledge integration boosts
  • Self-Critique — Automatic critique generation with severity levels and confidence adjustments
  • Metacognitive Engine — Detects stuck states, stagnation, declining confidence; suggests strategy switches and corrective actions
  • Knowledge Integration — Attach external knowledge to thoughts, detect gaps, validate consistency across sources
  • Thought Pruning — Dead-end detection, redundancy removal, deep unproductive branch elimination, path optimization
  • High-IQ Reasoning Enhancements — 8 new tools for advanced cognition: visualization, devil's advocate, cross-disciplinary synthesis, temporal projection, ethical evaluation, emotional intelligence analysis, decision explanation, social impact analysis
  • Emotional Intelligence — Analyze emotional tone, empathy, persuasion effectiveness, stakeholder emotions
  • Ethical Frameworks — Evaluate through deontological, consequentialist, virtue ethics, rights-based perspectives
  • Cross-Domain Synthesis — Combine insights from biology, economics, physics, psychology, computer science, art
  • Temporal Reasoning — Project thoughts into future/past scenarios with optimistic, pessimistic, realistic, disruptive scenarios
  • Social Impact Modeling — Analyze stakeholder emotions, group cohesion, persuasion effectiveness, ethical alignment
  • Uncertainty Quantification — Confidence intervals, probability distributions, sensitivity analysis for robust decisions
  • Multi-Language Support — Thoughts in English, Turkish, German, French, Spanish, Japanese, Chinese, Russian
  • Meta-Cognitive Layers — Recursive reasoning across 5 levels of meta-cognition

Installation

Global

npm install -g deep-thinker

npx (no install)

npx deep-thinker

MCP Configuration

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "deep-thinker": {
      "command": "npx",
      "args": ["-y", "deep-thinker"]
    }
  }
}

Or if installed globally:

{
  "mcpServers": {
    "deep-thinker": {
      "command": "deep-thinker"
    }
  }
}

Other MCP Clients

The server communicates over stdio. Point your MCP client to the deep-thinker command or node path/to/dist/index.js.

Tools

think

Add a thought to the cognitive graph using a reasoning strategy.

Parameters:

ParameterTypeRequiredDescription
contentstringYesThe thought content
typestringNoThought type: hypothesis, analysis, evidence, conclusion, question, assumption, insight, critique, synthesis, observation
strategystringNoStrategy: sequential, dialectic, parallel, analogical, abductive
confidencenumberNoInitial confidence 0-1 (default: 0.5)
parentIdstringNoParent node ID (default: last leaf)
branchstringNoBranch name for parallel exploration
tagsstring[]NoTags for categorization
edgeToobjectNoExplicit edge: { targetId, type }
dialecticobjectNoDialectic mode: { thesis, antithesis?, synthesis? }
parallelarrayNoParallel mode: [{ content, type, confidence }]
analogicalobjectNoAnalogical mode: { sourceDomain, mapping, projectedConclusion }
abductiveobjectNoAbductive mode: { observation, explanations[], bestExplanation? }
knowledgeobjectNoAttach knowledge: { source, content, relevance }

Strategy details:

  • Sequential — Linear chain: each thought derives from the previous
  • Dialectic — Thesis → Antithesis → Synthesis pattern to resolve contradictions
  • Parallel — Explore multiple independent branches simultaneously
  • Analogical — Map patterns from a known domain to the current problem
  • Abductive — Generate hypotheses and infer the best explanation

Edge types: derives_from, contradicts, supports, refines, challenges, synthesizes, parallels, abstracts, instantiates

evaluate

Evaluate the thinking process with confidence scoring, critique, and graph health analysis.

Parameters:

ParameterTypeRequiredDescription
nodeIdstringNoSpecific node to evaluate (default: entire graph)
critiquebooleanNoGenerate self-critique (default: true)
findGapsbooleanNoFind knowledge gaps (default: false)
validateKnowledgebooleanNoValidate knowledge consistency (default: false)

metacog

Metacognitive operations — monitor and control the thinking process.

Parameters:

ParameterTypeRequiredDescription
actionstringYesreport = full state, switch = change strategy, auto_update = let system analyze
strategystringNoNew strategy (for switch action)
reasonstringNoReason for switching (for switch action)

The metacognitive engine automatically:

  • Detects stagnation (confidence not improving)
  • Detects declining confidence trends
  • Detects excessive contradictions
  • Suggests strategy switches, pruning, backtracking, or concluding

graph

Query and visualize the thought graph.

Parameters:

ParameterTypeRequiredDescription
actionstringYesvisualize, stats, path, node, branches, best_path, leaves
nodeIdstringNoNode ID (for path, node actions)
targetIdstringNoTarget ID (for path action)

prune

Prune and optimize the thought graph.

Parameters:

ParameterTypeRequiredDescription
actionstringYesanalyze (report only), prune (execute), optimize_path, prune_node
nodeIdstringNoNode to prune (for prune_node)
reasonstringNoReason (for prune_node)

reset

Reset the thought graph and start a fresh session.

Parameters:

ParameterTypeRequiredDescription
problemstringNoNew problem statement

Enhanced Tools (High-IQ Reasoning)

visualize_thought_graph

Generate visual representation of the thought graph as SVG or ASCII.

Parameters:

ParameterTypeRequiredDescription
formatstringNosvg, ascii, or tree (default: ascii)
highlightPathstringNoPath between two node IDs (format: fromId-toId)
showConfidencebooleanNoShow confidence scores (default: true)

simulate_devils_advocate

Generate counterarguments and opposing viewpoints for a given thought.

Parameters:

ParameterTypeRequiredDescription
nodeIdstringYesTarget node ID to challenge
depthnumberNoLevels of counterarguments (1-5, default: 2)
intensitystringNomild, moderate, or aggressive (default: moderate)

cross_disciplinary_synthesis

Combine insights from multiple domains to generate novel perspectives.

Parameters:

ParameterTypeRequiredDescription
sourceDomainsstring[]YesDomains to draw analogies from (e.g., ["biology", "economics", "art"])
targetProblemstringYesProblem to apply cross-domain insights to
maxAnalogiesnumberNoMax analogies to generate (1-10, default: 3)

temporal_projection

Project thoughts into future or past scenarios.

Parameters:

ParameterTypeRequiredDescription
nodeIdstringYesRoot node ID to project from
yearsnumberYesYears forward (positive) or backward (negative)
scenariostringNooptimistic, pessimistic, realistic, disruptive (default: realistic)

ethical_framework_evaluation

Evaluate a thought or decision through multiple ethical frameworks.

Parameters:

ParameterTypeRequiredDescription
nodeIdstringYesNode ID to evaluate ethically
frameworksstring[]NoWhich frameworks: deontological, consequentialist, virtue, rights_based (default: all)

emotional_intelligence_analysis

Analyze emotional tone, stakeholder emotions, and social dynamics.

Parameters:

ParameterTypeRequiredDescription
textstringYesText to analyze for emotional content
contextstringNoContext (e.g., team meeting, customer feedback, crisis situation)
perspectiveTakingnumberNoLevel of perspective-taking 0-1 (default: 0.7)

explain_decision

Generate human-understandable explanation of a decision path.

Parameters:

ParameterTypeRequiredDescription
nodeIdstringYesDecision/conclusion node ID to explain
detailLevelstringNosimple, detailed, technical (default: detailed)
includeCounterfactualsbooleanNoShow what-if scenarios (default: true)

social_impact_analysis

Analyze social impact, stakeholder emotions, group cohesion, and persuasion effectiveness.

Parameters:

ParameterTypeRequiredDescription
nodeIdstringYesNode ID to analyze for social impact
stakeholdersstring[]NoStakeholder groups (default: ["customers", "employees", "investors", "community"])

Usage Examples

Sequential Reasoning

think: "Should we use microservices?" → type: question, confidence: 0.9
think: "Monolith has deployment bottlenecks" → type: analysis, confidence: 0.7
think: "Team lacks DevOps capacity for microservices" → type: evidence, confidence: 0.8
evaluate: → overall confidence 0.73
metacog: auto_update → strategy: sequential, progress: normal

Dialectic Reasoning

think: {
  strategy: "dialectic",
  dialectic: {
    thesis: "Microservices improve scalability",
    antithesis: "But add operational complexity",
    synthesis: "Use modular monolith as middle ground"
  },
  confidence: 0.75
}

Parallel Exploration

think: {
  strategy: "parallel",
  parallel: [
    { content: "Team expertise in Docker/K8s", type: "evidence", confidence: 0.8 },
    { content: "Limited DevOps capacity", type: "evidence", confidence: 0.6 },
    { content: "Budget allows hiring", type: "evidence", confidence: 0.4 }
  ]
}

Abductive Reasoning

think: {
  strategy: "abductive",
  abductive: {
    observation: "The grass is wet",
    explanations: [
      { content: "It rained", plausibility: 0.8 },
      { content: "Sprinklers were on", plausibility: 0.6 }
    ],
    bestExplanation: "It rained"
  },
  confidence: 0.8
}

Metacognitive Guidance

metacog: { action: "auto_update" }
→ ⚠ Stuck: confidence has not improved for 3 steps
→ 💡 Action: [switch_strategy] Try parallel exploration
→   Suggested Strategy: parallel

metacog: { action: "switch", strategy: "parallel", reason: "Break through impasse" }
→ Strategy switched: sequential → parallel

Pruning

prune: { action: "analyze" }
→ Dead Ends: 2
  [thought_7] confidence=0.15: Bad idea...
  [thought_9] confidence=0.10: Another dead end...
→ Redundant Branch Groups: 1
  Keep [thought_5], prune [thought_6]: Redundant analysis...
→ Total prunable: 3 node(s)

prune: { action: "prune" }
→ Pruned 3 node(s) in 3 operations

Architecture

src/
├── index.ts          MCP server & tool handlers
└── core/
    ├── types.ts      Type definitions & constants
    ├── node.ts       ThoughtNode CRUD operations
    ├── graph.ts      DAG-based thought graph
    ├── strategies.ts 5 reasoning strategy implementations
    ├── scorer.ts     Confidence scoring & self-critique
    ├── metacog.ts    Metacognitive engine
    ├── knowledge.ts  Knowledge integration & validation
    └── pruner.ts     Dead-end/redundancy detection & pruning

Comparison with sequential-thinking

Featuresequential-thinkingdeep-thinker
Thought structureLinear chainDAG (branch/merge/cross-edges)
StrategiesSequential only5 strategies (sequential, dialectic, parallel, analogical, abductive)
ConfidenceBasic thought numberMulti-factor scoring with trend analysis
Self-critiqueNoneAutomatic with severity levels
MetacognitionNoneStuck detection, strategy suggestions, auto-switching
KnowledgeNoneExternal references, gap detection, consistency validation
PruningNoneDead-end, redundancy, path optimization
Graph queriesLinear reviewVisualization, best path, branch analysis, statistics

Development

git clone https://github.com/hubinoretros/deep-thinker.git
cd deep-thinker
npm install
npm run build
npm start

Testing

npm run build
node dist/test.js

118 tests covering all modules: Node, Graph, Strategies, Scorer, Metacog, Knowledge, Pruner, Integration, Edge Cases.

Documentation

Contributing

See CONTRIBUTING.md for guidelines. PRs welcome — especially new reasoning strategies and MCP tool ideas.

License

MIT

İlgili Sunucular

NotebookLM Web Importer

Web sayfalarını ve YouTube videolarını tek tıkla NotebookLM'e aktarın. 200.000'den fazla kullanıcı tarafından güveniliyor.

Chrome Eklentisini Yükle