deep-thinker

deep-thinker

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.

Category
访问服务器

README

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

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

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

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:

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
confidence number No Initial confidence 0-1 (default: 0.5)
parentId string No Parent node ID (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? }
knowledge object No Attach 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:

Parameter Type Required Description
nodeId string No Specific node to evaluate (default: entire graph)
critique boolean No Generate self-critique (default: true)
findGaps boolean No Find knowledge gaps (default: false)
validateKnowledge boolean No Validate knowledge consistency (default: false)

metacog

Metacognitive 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:

  • 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:

Parameter Type Required Description
action string Yes visualize, stats, path, node, branches, best_path, leaves
nodeId string No Node ID (for path, node actions)
targetId string No Target ID (for path action)

prune

Prune 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 (for prune_node)
reason string No Reason (for prune_node)

reset

Reset the thought graph and start a fresh session.

Parameters:

Parameter Type Required Description
problem string No New problem statement

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

Feature sequential-thinking deep-thinker
Thought structure Linear chain DAG (branch/merge/cross-edges)
Strategies Sequential only 5 strategies (sequential, dialectic, parallel, analogical, abductive)
Confidence Basic thought number Multi-factor scoring with trend analysis
Self-critique None Automatic with severity levels
Metacognition None Stuck detection, strategy suggestions, 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

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

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选