A community-driven registry for the Claude Code ecosystem. Not affiliated with Anthropic.
Are you the author? Sign in to claim
Advanced cognitive reasoning MCP server — DAG thought graph, 10 strategies, metacognition, self-critique, knowledge inte
Advanced cognitive thinking MCP server with DAG-based thought graph, 10 reasoning strategies (including auto-selection), 17 tools, node aliases, session persistence, structured responses, and intelligent error handling.
A significant evolution beyond sequential-thinking MCP, providing structured deep reasoning with graph-based thought management, schema validation, and intelligent strategy selection.
npx deep-thinker
{
"mcpServers": {
"deep-thinker": {
"command": "npx",
"args": ["-y", "deep-thinker"]
}
}
}
| Example | Strategy | Use Case |
|---|---|---|
| Architecture Decision | Dialectic + Parallel | Monolith vs microservices |
| Debugging Incident | Abductive | Production 500 errors |
| Feature Prioritization | Parallel + Dialectic | Q3 roadmap planning |
| Scientific Hypothesis | Analogical + Abductive | LNP delivery for CRISPR |
| Breaking Dead Ends | Metacognitive switch | Serverless cost analysis |
"last", "best", "root" instead of cryptic node IDs for any nodeId parameterMCPResponse JSON with status, summary, confidence, nextSuggested action~/.deep-thinker/sessions/; resume across MCP restarts with reset({ resume: "name" })"confidence 0 ile 1 arasında...")npm install -g deep-thinker
npx deep-thinker
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"
}
}
}
The server communicates over stdio. Point your MCP client to the deep-thinker command or node path/to/dist/index.js.
All tool responses follow the MCPResponse structure:
{
"status": "ok | error | warning",
"nodeId": "thought_3",
"summary": "sequential stratejisiyle \"Should we use microservices?...\" eklendi",
"confidence": 0.75,
"data": { "...": "tool-specific data" },
"nextSuggested": {
"tool": "evaluate",
"params": { "critique": true },
"reason": "Düşük confidence — değerlendirme önerilir"
},
"warnings": ["Stuck detected: ..."]
}
The nextSuggested field always recommends the next logical step, making it easy to chain tool calls without guessing.
Instead of looking up cryptic node IDs, use aliases for any nodeId, parentId, or targetId parameter:
| Alias | Resolves To |
|---|---|
"last" | Most recently added node (insertion order) |
"best" | Node with highest confidence score |
"root" | First node with no incoming edges |
evaluate({ nodeId: "last" }) → evaluates the latest thought
simulate_devils_advocate({ nodeId: "best", depth: 2 }) → challenges the strongest thought
graph({ action: "path", nodeId: "root", targetId: "best" }) → traces from root to best conclusion
Thought graphs are automatically saved after every think call. Sessions are stored in ~/.deep-thinker/sessions/.
// Save current session explicitly
reset({ save: true, saveName: "my-analysis" })
// List saved sessions
reset({ listSessions: true })
// Resume a saved session after MCP restart
reset({ resume: "my-analysis" })
thinkAdd a thought to the cognitive graph using a reasoning strategy.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
content | string | Yes | The thought content |
type | string | No | Thought type: hypothesis, analysis, evidence, conclusion, question, assumption, insight, critique, synthesis, observation |
strategy | string | No | Strategy: sequential, dialectic, parallel, analogical, abductive, first_principles, counterfactual, systems_thinking, mcts, auto |
confidence | number | No | Initial confidence 0-1 (default: 0.5) |
parentId | string | No | Parent node ID or alias (default: last leaf) |
branch | string | No | Branch name for parallel exploration |
tags | string[] | No | Tags for categorization |
edgeTo | object | No | Explicit edge: { targetId, type } |
dialectic | object | No | Dialectic mode: { thesis, antithesis?, synthesis? } |
parallel | array | No | Parallel mode: [{ content, type, confidence }] |
analogical | object | No | Analogical mode: { sourceDomain, mapping, projectedConclusion } |
abductive | object | No | Abductive mode: { observation, explanations[], bestExplanation? } |
firstPrinciples | object | No | First Principles mode: { problem, assumptions?, depth?, domain? } |
counterfactual | object | No | Counterfactual mode: { currentState?, variablesToChange, rippleDepth? } |
systemsThinking | object | No | Systems Thinking mode: { systemDescription?, components, focusArea? } |
mcts | object | No | MCTS mode: { problem?, possibleActions, numSimulations? } |
knowledge | object | No | Attach knowledge: { source, content, relevance } |
Strategy details:
| Strategy | Description | Best For |
|---|---|---|
| Sequential | Linear chain: each thought derives from the previous | Step-by-step reasoning |
| Dialectic | Thesis → Antithesis → Synthesis pattern to resolve contradictions | Resolving conflicts |
| Parallel | Explore multiple independent branches simultaneously | Brainstorming options |
| Analogical | Map patterns from a known domain to the current problem | Cross-domain insights |
| Abductive | Generate hypotheses and infer the best explanation | Root cause analysis |
| First Principles | Deconstruct to fundamental truths, challenge assumptions | Breaking conventions |
| Counterfactual | "What-if" scenarios with multi-stage ripple effects | Risk/impact analysis |
| Systems Thinking | Feedback loops, leverage points, emergent properties | Complex systems |
| MCTS | Monte Carlo Tree Search for optimal decision selection | Optimization problems |
| Auto | Automatically selects strategy based on content signals and graph context | Hands-off reasoning |
How auto strategy works:
The auto strategy analyzes your content for keywords and the current graph state:
abductivecounterfactualdialecticsystems_thinkingfirst_principlesparallel (break through impasse)sequentialdialectic (introduce opposing view)sequentialEdge types: derives_from, contradicts, supports, refines, challenges, synthesizes, parallels, abstracts, instantiates
evaluateEvaluate the thinking process with confidence scoring, critique, and graph health analysis.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
nodeId | string | No | Specific node to evaluate (accepts aliases: last, best, root) |
critique | boolean | No | Generate self-critique (default: true) |
findGaps | boolean | No | Find knowledge gaps (default: false) |
validateKnowledge | boolean | No | Validate knowledge consistency (default: false) |
metacogMetacognitive operations — monitor and control the thinking process.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
action | string | Yes | report = full state, switch = change strategy, auto_update = let system analyze |
strategy | string | No | New strategy (for switch action) |
reason | string | No | Reason for switching (for switch action) |
The metacognitive engine automatically:
graphQuery and visualize the thought graph.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
action | string | Yes | visualize, stats, path, node, branches, best_path, leaves |
nodeId | string | No | Node ID or alias (for path, node actions) |
targetId | string | No | Target ID or alias (for path action) |
prunePrune and optimize the thought graph.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
action | string | Yes | analyze (report only), prune (execute), optimize_path, prune_node |
nodeId | string | No | Node to prune — accepts aliases (for prune_node) |
reason | string | No | Reason (for prune_node) |
resetReset the thought graph and start a fresh session, save, or resume a saved session.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
problem | string | No | New problem statement |
save | boolean | No | Save current session before resetting (default: false) |
saveName | string | No | Name for saved session (recommended if save: true) |
resume | string | No | Resume a previously saved session by name |
listSessions | boolean | No | List all saved sessions |
concludeAnalyze the entire thought graph and produce a comprehensive summary-conclusion with action items and graph health report.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
detailLevel | string | No | brief, detailed, technical (default: detailed) |
includeCounterfactuals | boolean | No | Include counterfactual analysis (default: false) |
format | string | No | prose, structured, executive (default: structured) |
Response includes:
primaryFinding — Top conclusion with confidencesupportingEvidence — Additional high-confidence nodesstrategiesUsed — Which strategies contributedkeyInsights — Insight-type nodes from the best pathactionItems — Prioritized actions derived from conclusionsgraphHealth — Node count, dead ends, avg confidence, recommendationnextSuggested — Logical next step (prune if unhealthy, save if done)helpDiscover deep-thinker tools and learn usage workflows.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
category | string | No | all, core, advanced, workflow (default: all) |
Categories:
visualize_thought_graphGenerate visual representation of the thought graph as SVG or ASCII.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
format | string | No | svg, ascii, or tree (default: ascii) |
highlightPath | string | No | Path between two node IDs (format: fromId-toId) |
showConfidence | boolean | No | Show confidence scores (default: true) |
simulate_devils_advocateGenerate counterarguments and opposing viewpoints for a given thought.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
nodeId | string | Yes | Target node ID or alias (last, best, root) |
depth | number | No | Levels of counterarguments (1-5, default: 2) |
intensity | string | No | mild, moderate, or aggressive (default: moderate) |
cross_disciplinary_synthesisCombine insights from multiple domains to generate novel perspectives.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
sourceDomains | string[] | Yes | Domains to draw analogies from (e.g., ["biology", "economics", "art"]) |
targetProblem | string | Yes | Problem to apply cross-domain insights to |
maxAnalogies | number | No | Max analogies to generate (1-10, default: 3) |
temporal_projectionProject thoughts into future or past scenarios.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
nodeId | string | Yes | Root node ID or alias |
years | number | Yes | Years forward (positive) or backward (negative) |
scenario | string | No | optimistic, pessimistic, realistic, disruptive (default: realistic) |
ethical_framework_evaluationEvaluate a thought or decision through multiple ethical frameworks.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
nodeId | string | Yes | Node ID or alias |
frameworks | string[] | No | Which frameworks: deontological, consequentialist, virtue, rights_based (default: all) |
emotional_intelligence_analysisAnalyze emotional tone, stakeholder emotions, and social dynamics.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Text to analyze for emotional content |
context | string | No | Context (e.g., team meeting, customer feedback, crisis situation) |
perspectiveTaking | number | No | Level of perspective-taking 0-1 (default: 0.7) |
explain_decisionGenerate human-understandable explanation of a decision path.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
nodeId | string | Yes | Decision/conclusion node ID or alias |
detailLevel | string | No | simple, detailed, technical (default: detailed) |
includeCounterfactuals | boolean | No | Show what-if scenarios (default: true) |
social_impact_analysisAnalyze social impact, stakeholder emotions, group cohesion, and persuasion effectiveness.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
nodeId | string | Yes | Node ID or alias |
stakeholders | string[] | No | Stakeholder groups (default: ["customers", "employees", "investors", "community"]) |
optimize_promptPromptOptimizer (Node Zero) — transform vague prompts into optimized Super Prompts with strategy routing.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
originalPrompt | string | Yes | User's raw, potentially vague prompt |
userContext | object | No | { expertiseLevel, domainKnowledge[], preferences } |
conversationHistory | array | No | Previous messages for context (max 20) |
optimizationLevel | string | No | light, standard, aggressive (default: standard) |
targetModel | string | No | claude, gpt4, gpt35, local, generic (default: generic) |
autoRoute | boolean | No | Auto-route to recommended strategy (default: false) |
think: { content: "Eğer mikroservis kullansaydık ne olurdu?" }
→ Auto-selects strategy: counterfactual (detected "Eğer" = "if" signal)
think: { content: "Why is the server crashing?" }
→ Auto-selects strategy: abductive (detected "why" signal)
think: { content: "Monolith vs microservices?" }
→ Auto-selects strategy: dialectic (detected "vs" comparison signal)
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: { nodeId: "last", critique: true }
→ { status: "ok", confidence: 0.73, nextSuggested: { tool: "metacog" } }
think: {
strategy: "dialectic",
dialectic: {
thesis: "Microservices improve scalability",
antithesis: "But add operational complexity",
synthesis: "Use modular monolith as middle ground"
},
confidence: 0.75
}
evaluate({ nodeId: "last" }) → evaluate latest thought
simulate_devils_advocate({ nodeId: "best", depth: 3 }) → challenge strongest thought
graph({ action: "path", nodeId: "root", targetId: "best" }) → trace reasoning path
think({ parentId: "root", content: "Alternative..." }) → branch from root
// Work on a problem...
think({ content: "Analysis...", strategy: "auto" })
think({ content: "Another insight..." })
// Save before closing
reset({ save: true, saveName: "architecture-review" })
// ... MCP restarts ...
// Resume exactly where you left off
reset({ resume: "architecture-review" })
→ { status: "ok", summary: "architecture-review oturumu geri yüklendi — 5 node ile devam ediliyor" }
think: {
strategy: "first_principles",
firstPrinciples: {
problem: "How to improve battery efficiency?",
assumptions: ["Batteries must use lithium", "Charging takes hours"],
depth: 3,
domain: "physics"
}
}
→ Creates: Problem → Assumptions Challenged → Fundamental Truths → Reconstructed Solution
think: {
strategy: "counterfactual",
counterfactual: {
currentState: "Office-based work with 5-day commute",
variablesToChange: [
{ variable: "work_location", currentValue: "office", hypotheticalValue: "remote", impactWeight: 0.9 },
{ variable: "commute_days", currentValue: 5, hypotheticalValue: 0, impactWeight: 0.8 }
],
timeHorizon: "medium_term",
rippleDepth: 3
}
}
→ Creates: Baseline → Variable Changes → Stage 1/2/3 Ripple Effects → Scenarios → Risk Analysis
think: {
strategy: "systems_thinking",
systemsThinking: {
systemDescription: "Software development team dynamics",
components: [
{ name: "FeatureBacklog", type: "stock", description: "Pending work" },
{ name: "DeveloperCapacity", type: "stock", description: "Available developers" },
{ name: "CodeReviews", type: "flow", description: "Review process" },
{ name: "Quality", type: "converter", description: "Quality gates" }
],
focusArea: "feedback_loops"
}
}
→ Creates: System Overview → Components → Feedback Loops → Leverage Points → Recommendations
think: {
strategy: "mcts",
mcts: {
problem: "Which architecture pattern to choose?",
possibleActions: [
{ id: "microservices", description: "Microservices architecture", estimatedReward: 0.7 },
{ id: "monolith", description: "Monolithic architecture", estimatedReward: 0.5 },
{ id: "modular", description: "Modular monolith", estimatedReward: 0.8 }
],
numSimulations: 100,
pruningThreshold: 0.2
}
}
→ Creates: Root → Actions → Simulations → Pruning Analysis → Optimal Path
conclude({ detailLevel: "detailed" })
→ {
status: "ok",
summary: "12 dusunce, 3 dal, sequential+counterfactual stratejileriyle analiz tamamlandi",
data: {
conclusion: { primaryFinding: "...", confidence: 0.85 },
actionItems: [{ action: "Investigate...", priority: "high" }, ...],
graphHealth: { totalThoughts: 12, avgConfidence: 0.72, recommendation: "Graf saglikli gorunuyor" }
},
nextSuggested: { tool: "reset", params: { save: true }, reason: "Analizi kaydetmeyi unutmayin" }
}
metacog: { action: "auto_update" }
→ Stuck detected + suggested action in nextSuggested
metacog: { action: "switch", strategy: "parallel", reason: "Break through impasse" }
→ Strategy switched + next step recommended
prune: { action: "analyze" }
→ Dead Ends, Redundant Branches, Total prunable count
prune: { action: "prune" }
→ Nodes pruned + metacog updated + nextSuggested
help() → all tools, all categories, all workflows
help({ category: "core" }) → 7 core tools with quick-start examples
help({ category: "advanced" }) → 9 advanced tools
help({ category: "workflow" }) → 3 recommended workflows
When validation fails, you get human-readable errors instead of raw Zod output:
think({ confidence: 1.5 })
→ {
status: "error",
error: "VALIDATION_ERROR",
message: "\"confidence\" parametresinde hata: ...",
field: "confidence",
hint: "confidence 0 ile 1 arasında bir sayı olmalı. Örnek: confidence: 0.7"
}
evaluate({ nodeId: "nonexistent" })
→ {
status: "error",
error: "NODE_NOT_FOUND",
provided: "nonexistent",
hint: "Geçerli alias'lar: \"last\", \"best\", \"root\" veya graph aracıyla node ID alın"
}
src/
├── index.ts MCP server & 17 tool handlers
├── test.ts Core functionality tests (118 tests)
├── test_enhanced_strategies.ts Strategy tests (13 tests)
├── core/
│ ├── types.ts Type definitions, MCPResponse, NextAction
│ ├── schemas.ts Zod validation schemas (10 strategies incl. auto)
│ ├── node.ts ThoughtNode CRUD operations
│ ├── graph.ts DAG-based thought graph + resolveNodeId + aliases
│ ├── strategies.ts 10 reasoning strategies + selectStrategy (auto)
│ ├── scorer.ts Confidence scoring & self-critique
│ ├── metacog.ts Metacognitive engine with smart triggers
│ ├── knowledge.ts Knowledge integration & validation
│ ├── pruner.ts Dead-end/redundancy detection & pruning
│ ├── session.ts Session persistence (save/load/resume)
│ └── errors.ts Friendly error formatting (Zod + unknown)
└── enhancements/
├── visualization.ts SVG & ASCII graph visualization
├── devils_advocate.ts Counterargument generation
├── cross_disciplinary.ts Cross-domain analogy engine
├── temporal_projection.ts Future/past thought projection
├── ethical_evaluation.ts 4 ethical frameworks
├── emotional_intelligence.ts Emotion & sentiment analysis
├── explanation.ts Decision explainability
└── social_impact.ts Stakeholder & social impact
| Feature | Description |
|---|---|
| Node Aliases | Use "last", "best", "root" instead of node IDs for all nodeId params |
| MCPResponse | Structured JSON responses with status, summary, confidence, nextSuggested |
| Session Persistence | Auto-save to ~/.deep-thinker/sessions/, resume across restarts |
| Friendly Errors | Zod errors → human-readable hints with field-specific guidance |
| help Tool | 3-category tool discovery with workflow examples |
| conclude Tool | Graph summary with primaryFinding, actionItems, graphHealth |
| strategy: auto | Automatic strategy selection based on content keywords + graph state |
| Feature | sequential-thinking | deep-thinker |
|---|---|---|
| Thought structure | Linear chain | DAG (branch/merge/cross-edges) |
| Strategies | Sequential only | 10 strategies (incl. auto-selection) |
| Schema Validation | None | Zod schemas for all strategies |
| Confidence | Basic thought number | Multi-factor scoring with trend analysis |
| Self-critique | None | Automatic with severity levels |
| Metacognition | None | Stuck detection, smart strategy triggers, auto-switching |
| Knowledge | None | External references, gap detection, consistency validation |
| Pruning | None | Dead-end, redundancy, path optimization |
| Graph queries | Linear review | Visualization, best path, branch analysis, statistics |
| Node references | By ID only | Aliases: last, best, root |
| Response format | Plain text | Structured MCPResponse with nextSuggested |
| Session persistence | None | Auto-save, save/load/resume |
| Error messages | Raw errors | Human-readable with hints |
| Tool discovery | None | help tool with categories & workflows |
| Conclusion | Manual review | conclude tool with actionItems |
| Strategy selection | Manual only | auto strategy based on content |
git clone https://github.com/hubinoretros/deep-thinker.git
cd deep-thinker
npm install
npm run build
npm start
npm run build
npm test
131 tests covering all modules: Node, Graph, 10 Strategies (including auto), Scorer, Metacog, Knowledge, Pruner, Integration, Edge Cases, Schema Validation.
See CONTRIBUTING.md for guidelines. PRs welcome — especially new reasoning strategies and MCP tool ideas.
MIT
Run Claude Code as an MCP server so any agent can delegate coding tasks to it
Browser automation using accessibility snapshots instead of screenshots
Secure MCP server for MySQL database interaction, queries, and schema management
English-first Korean equity intelligence MCP — DART filings, foreign-holder 5%-rule flows, activist filings, KRX news. F
via CLI