mcpField
D
Deep Thinker

Deep Thinker

本地服务
github.com/hubinoretrosAI 与智能体1523 周前更新

关于 Deep Thinker

Deep Thinker 是用于结构化推理的 MCP 服务,通过有向无环图管理思路,并提供多种推理策略、评估和会话恢复。适合需要分析复杂问题并检查推理过程的 Agent。

主要功能

  1. 01以有向无环图组织思路
  2. 02支持 10 种推理策略
  3. 03评估置信度并生成自我批评
  4. 04检测停滞并建议策略切换
  5. 05保存并恢复推理会话
  6. 06查询、修剪和优化思路图

适用场景

  1. 01比较架构方案并整理论据
  2. 02分析故障并探索可能原因
  3. 03评估选项、风险和决策影响
  4. 04恢复先前保存的分析会话

MCP 相关

该 MCP 服务向客户端提供 17 个推理与图管理工具,包含思考、评估、元认知监控和图查询。工具响应采用结构化格式,并建议后续操作。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

mcp.json · 通用配置
{
"mcpServers": {
"deep-thinker": {
"command": "npx",
"args": [
"-y",
"deep-thinker"
]
}
}
}
启动命令npx -y deep-thinker

本地服务需要在你的电脑上安装运行环境(如 Node.js 18+)。各客户端的配置文件位置不同,请参考客户端文档。

安装包
npmdeep-thinker

工具

17

收录的工具列表 · 更新于 3 周前

参数类型必填说明
contentstring是思考内容
typeenum否思考类型(默认值:analysis)hypothesis | analysis | evidence | conclusion | question | assumption | insight | critique | synthesis | observation
strategyenum否要使用的推理策略(默认值:来自元认知的当前策略)。使用 'auto' 自动选择策略。新策略:first_principles=分解至基本原理,counterfactual=假设分析,systems_thinking=反馈回路和杠杆点,mcts=用于优化的蒙特卡洛树搜索sequential | dialectic | parallel | analogical | abductive | first_principles | counterfactual | systems_thinking | mcts | auto
confidencenumber否此思考的初始置信度,范围为 0–1(默认值:0.5)
parentIdstring否要连接的父思考 ID(默认值:最后一个活动叶节点)
branchstring否用于并行探索的分支名称(默认值:main)
tagsarray否用于对思考进行分类的标签
edgeToobject否创建一条指向其他节点的显式边
edgeTo.targetIdstring否目标节点 ID
edgeTo.typeenum否边类型derives_from | contradicts | supports | refines | challenges | synthesizes | parallels | abstracts | instantiates
dialecticobject否辩证模式:提供 thesis(可选提供 antithesis/synthesis)
dialectic.thesisstring否论题/命题
dialectic.antithesisstring否对立观点(可选)
dialectic.synthesisstring否综合结论(可选)
parallelarray否并行模式:同时探索多个相互独立的思路
analogicalobject否类比模式:源领域、映射关系和推导结论
analogical.sourceDomainstring否用于进行类比的已知领域
analogical.mappingstring否各领域之间的对应关系
analogical.projectedConclusionstring否通过类比推导出的结论
abductiveobject否溯因模式:观察结果、可能的解释和最佳解释
abductive.observationstring否需要解释的观察结果
abductive.explanationsarray否可能的解释及其合理性评分
abductive.bestExplanationstring否最佳解释(如已确定)
firstPrinciplesobject否第一性原理模式:将问题分解为基本事实并重新构建
firstPrinciples.problemstring否要分解的问题(默认:使用内容)
firstPrinciples.assumptionsarray否需要质疑的假设
firstPrinciples.depthnumber否分解深度(默认:3)
firstPrinciples.domainstring否可选的领域背景(例如,'physics'、'economics')
counterfactualobject否反事实模式:分析假设情景及其连锁影响
counterfactual.currentStatestring否当前状态的描述(默认:使用内容)
counterfactual.variablesToChangearray是假设情景中要修改的变量
counterfactual.timeHorizonenum否影响的时间范围immediate | short_term | medium_term | long_term
counterfactual.rippleDepthnumber否涟漪效应阶段数(默认值:3)
systemsThinkingobject否系统思维模式:分析反馈回路和杠杆点
systemsThinking.systemDescriptionstring否系统描述(默认使用内容)
systemsThinking.boundariesarray否系统边界
systemsThinking.componentsarray是系统组件(至少需要 2 个)
systemsThinking.timeScaleenum否分析时间尺度immediate | short_term | medium_term | long_term
systemsThinking.focusAreaenum否分析重点feedback_loops | leverage_points | emergence | resilience | all
mctsobject否MCTS 模式:用于选择最优路径的蒙特卡洛树搜索
mcts.problemstring否要解决的问题(默认使用内容)
mcts.possibleActionsarray是待评估的可能操作(至少 2 个)
mcts.simulationDepthnumber否模拟深度(默认值:5)
mcts.numSimulationsnumber否模拟次数(默认值:100)
mcts.explorationConstantnumber否UCB1 探索常数(默认值:1.414)
mcts.pruningThresholdnumber否剪枝阈值(默认值:0.2)
knowledgeobject否将外部知识附加到此思考中
knowledge.sourcestring否知识来源
knowledge.contentstring否知识内容
knowledge.relevancenumber否与此思考的相关性(0-1)

详细介绍

deep-thinker

CI npm version npm downloads license GitHub stars

高级认知思考 MCP 服务,具备基于 DAG 的思维图、10 种推理策略(包括自动选择)、17 个工具、节点别名、会话持久化、结构化响应和智能错误处理。

相比顺序思考 MCP,这是一次重大升级,通过基于图的思维管理、架构验证和智能策略选择,提供结构化的深度推理。

快速开始

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

示例

示例策略使用场景
架构决策辩证 + 并行单体与微服务之争
调试事故溯因生产环境 500 错误
功能优先级排序并行 + 辩证Q3 路线图规划
科学假设类比 + 溯因用于 CRISPR 的 LNP 递送
打破死胡同元认知切换无服务器成本分析

功能

  • 基于 DAG 的思维图 — 思维构成有向无环图,支持分支、合并和跨边(不只是线性链)
  • 10 种推理策略 — 顺序、辩证(论题→反题→合题)、并行、类比、溯因、第一性原理(分解至基本原理)、反事实(假设情景及其连锁影响)、系统思维(反馈回路和杠杆点)、MCTS(蒙特卡洛优化)、自动(根据内容和图状态智能选择)
  • 节点别名 — 对任何 nodeId 参数使用 "last"、"best"、"root",无需使用难以理解的节点 ID
  • 结构化响应 — 所有工具响应均返回格式一致的 MCPResponse JSON,包含 status、summary、confidence、nextSuggested
  • 会话持久化 — 自动将思维图保存到 ~/.deep-thinker/sessions/;通过 reset({ resume: "name" }) 在 MCP 重启后恢复会话
  • 友好的错误消息 — 将 Zod 验证错误转换为易于理解的提示(例如,"confidence 0 ile 1 arasında...")
  • 置信度评分 — 多因素置信度评估,包含支持/矛盾分析、深度惩罚和知识整合加成
  • 自我批判 — 自动生成带有严重程度等级的批判,并调整置信度
  • 元认知引擎 — 检测卡住、停滞、置信度下降等状态;建议切换策略并采取纠正措施
  • 知识整合 — 为思维附加外部知识、检测知识缺口、验证不同来源之间的一致性
  • 思维修剪 — 检测死胡同、移除冗余、清理无成效的深层分支、优化路径
  • help 工具 — 按类别(核心/高级/工作流)查看全部 17 个工具,并提供快速入门示例
  • conclude 工具 — 全面的图摘要,包含 primaryFinding、actionItems、graphHealth 和 nextSuggested
  • 高智商推理增强功能 — 8 种高级工具:可视化、唱反调、跨学科综合、时间投射、伦理评估、情商分析、决策说明、社会影响分析
  • 情商 — 分析情感基调、同理心、说服效果和利益相关方的情绪
  • 伦理框架 — 从义务论、结果主义、美德伦理和权利视角进行评估
  • 跨领域综合 — 综合生物学、经济学、物理学、心理学、计算机科学和艺术领域的见解
  • 时间推理 — 将思维投射到未来/过去情境中,涵盖乐观、悲观、现实和颠覆性情境
  • 社会影响建模 — 分析利益相关方的情绪、群体凝聚力、说服效果和伦理一致性
  • 不确定性量化 — 通过置信区间、概率分布和敏感性分析,支持稳健决策
  • 多语言支持 — 支持以英语、土耳其语、德语、法语、西班牙语、日语、中文和俄语进行思考
  • 元认知层级 — 在 5 个元认知层级上进行递归推理
  • PromptOptimizer(节点零) — 入口点,可将模糊提示词转换为优化后的超级提示词,并自动路由策略

安装

全局安装
npm install -g deep-thinker
npx(无需安装)
npx deep-thinker

MCP 配置

Claude Desktop

将以下内容添加到你的 claude_desktop_config.json:

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

如果已全局安装:

{
  "mcpServers": {
    "deep-thinker": {
      "command": "deep-thinker"
    }
  }
}
其他 MCP 客户端

该服务通过 stdio 通信。将 MCP 客户端指向 deep-thinker 命令或 node path/to/dist/index.js。

响应格式

所有工具响应均遵循 MCPResponse 结构:

{
  "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: ..."]
}

nextSuggested 字段始终会推荐下一步的合理操作,让你无需猜测即可串联调用工具。

节点别名

无需查找晦涩的节点 ID,即可将别名用于任何 nodeId、parentId 或 targetId 参数:

别名解析为
"last"最近添加的节点(按插入顺序)
"best"置信度得分最高的节点
"root"第一个没有入边的节点
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

会话持久化

每次调用 think 后,思维图都会自动保存。会话存储在 ~/.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" })

工具

核心工具
think

使用推理策略向认知图谱添加一条想法。

参数:

参数类型必填描述
contentstring是想法内容
typestring否想法类型:hypothesis、analysis、evidence、conclusion、question、assumption、insight、critique、synthesis、observation
strategystring否策略:sequential、dialectic、parallel、analogical、abductive、first_principles、counterfactual、systems_thinking、mcts、auto
confidencenumber否初始置信度,范围为 0-1(默认值:0.5)
parentIdstring否父节点 ID 或别名(默认值:最后一个叶节点)
branchstring否并行探索的分支名称
tagsstring[]否用于分类的标签
edgeToobject否显式边:{ targetId, type }
dialecticobject否辩证模式:{ thesis, antithesis?, synthesis? }
parallelarray否并行模式:[{ content, type, confidence }]
analogicalobject否类比模式:{ sourceDomain, mapping, projectedConclusion }
abductiveobject否溯因模式:{ observation, explanations[], bestExplanation? }
firstPrinciplesobject否第一性原理模式:{ problem, assumptions?, depth?, domain? }
counterfactualobject否反事实模式:{ currentState?, variablesToChange, rippleDepth? }
systemsThinkingobject否系统思维模式:{ systemDescription?, components, focusArea? }
mctsobject否MCTS 模式:{ problem?, possibleActions, numSimulations? }
knowledgeobject否附加知识:{ source, content, relevance }

策略详情:

策略描述最适用场景
Sequential线性链:每条想法都从上一条推导而来逐步推理
Dialectic通过正题 → 反题 → 合题模式解决矛盾解决冲突
Parallel同时探索多个相互独立的分支集思广益
Analogical将已知领域中的模式映射到当前问题跨领域洞见
Abductive生成假设并推断最佳解释根因分析
First Principles将问题分解为基本事实,并质疑假设打破常规
Counterfactual探索具有多阶段连锁影响的“假如”情景风险/影响分析
Systems Thinking反馈回路、杠杆点和涌现属性复杂系统
MCTS使用蒙特卡洛树搜索选择最优决策优化问题
Auto根据内容信号和图谱上下文自动选择策略无需手动干预的推理

auto 策略的工作原理:

auto 策略会分析内容中的关键词和当前图谱状态:

  • 内容包含“why”/“neden”/“how”/“nasıl” → abductive
  • 内容包含“if”/“eğer”/“what if”/“varsayalım” → counterfactual
  • 内容包含“vs”/“veya”/“compare”/“karşılaştır” → dialectic
  • 内容包含“system”/“sistem”/“loop”/“döngü” → systems_thinking
  • 内容包含“fundamental”/“temel”/“assumption”/“varsayım” → first_principles
  • 平均置信度较低且节点较多 → parallel(突破僵局)
  • 第一条想法 → sequential
  • 连续添加 4 条或更多想法后 → dialectic(引入对立观点)
  • 默认 → sequential

边类型: derives_from、contradicts、supports、refines、challenges、synthesizes、parallels、abstracts、instantiates

evaluate

通过置信度评分、批判和图健康状况分析来评估思考过程。

参数:

参数类型必填描述
nodeIdstring否要评估的特定节点(接受别名:last、best、root)
critiqueboolean否生成自我批判(默认:true)
findGapsboolean否查找知识缺口(默认:false)
validateKnowledgeboolean否验证知识一致性(默认:false)
metacog

元认知操作——监控和控制思考过程。

参数:

参数类型必填描述
actionstring是report = 完整状态,switch = 更改策略,auto_update = 让系统分析
strategystring否新策略(用于 switch 操作)
reasonstring否切换原因(用于 switch 操作)

元认知引擎会自动:

  • 检测停滞(置信度没有提升)
  • 检测置信度下降趋势
  • 检测过多矛盾
  • 建议切换策略、修剪、回溯或结束
graph

查询和可视化思维图。

参数:

参数类型必填描述
actionstring是visualize、stats、path、node、branches、best_path、leaves
nodeIdstring否节点 ID 或别名(用于 path、node 操作)
targetIdstring否目标 ID 或别名(用于 path 操作)
prune

修剪和优化思维图。

参数:

参数类型必填描述
actionstring是analyze(仅报告)、prune(执行)、optimize_path、prune_node
nodeIdstring否要修剪的节点——接受别名(用于 prune_node)
reasonstring否原因(用于 prune_node)
reset

重置思维图并开始新会话、保存会话或恢复已保存的会话。

参数:

参数类型必填描述
problemstring否新的问题陈述
saveboolean否重置前保存当前会话(默认:false)
saveNamestring否已保存会话的名称(如果 save: true,建议填写)
resumestring否按名称恢复之前保存的会话
listSessionsboolean否列出所有已保存的会话
conclude

分析整个思维图,并生成包含行动项和图健康状况报告的综合总结与结论。

参数:

参数类型必填描述
detailLevelstring否brief、detailed、technical(默认:detailed)
includeCounterfactualsboolean否包含反事实分析(默认:false)
formatstring否prose、structured、executive(默认:structured)

响应包含:

  • primaryFinding — 最主要的结论及其置信度
  • supportingEvidence — 其他高置信度节点
  • strategiesUsed — 采用了哪些策略
  • keyInsights — 最佳路径上的洞见类节点
  • actionItems — 根据结论得出的优先行动项
  • graphHealth — 节点数量、死胡同、平均置信度、建议
  • nextSuggested — 合乎逻辑的下一步(状态不佳时修剪,完成后保存)
help

发现深度思考工具并了解使用工作流。

参数:

参数类型必填说明
categorystring否all、core、advanced、workflow(默认值:all)

类别:

  • core — 7 个日常使用的工具(think、evaluate、metacog、graph、prune、reset、conclude)
  • advanced — 8 个深度分析工具(可视化、唱反调、跨学科、时间推演、伦理、情感、解释、社会影响、提示词优化器)
  • workflow — 3 个推荐工作流:
    • 快速决策 — reset → 并行 think → evaluate → conclude
    • 深度分析 — reset → first_principles → counterfactual → devil's advocate → evaluate → metacog → prune → conclude
    • 打破僵局 — metacog 报告 → 切换策略 → cross-disciplinary → abductive
增强型工具(高智商推理)
visualize_thought_graph

将思维图生成为 SVG 或 ASCII 可视化表示。

参数:

参数类型必填说明
formatstring否svg、ascii 或 tree(默认值:ascii)
highlightPathstring否两个节点 ID 之间的路径(格式:fromId-toId)
showConfidenceboolean否显示置信度分数(默认值:true)
simulate_devils_advocate

为给定的想法生成反驳论点和对立观点。

参数:

参数类型必填说明
nodeIdstring是目标节点 ID 或别名(last、best、root)
depthnumber否反驳论点的层级(1-5,默认值:2)
intensitystring否mild、moderate 或 aggressive(默认值:moderate)
cross_disciplinary_synthesis

结合多个领域的见解,生成新颖的观点。

参数:

参数类型必填说明
sourceDomainsstring[]是用于类比的领域(例如,["biology", "economics", "art"])
targetProblemstring是要应用跨领域见解的问题
maxAnalogiesnumber否要生成的最多类比数量(1-10,默认值:3)
temporal_projection

将想法投射到未来或过去的情境中。

参数:

参数类型必填说明
nodeIdstring是根节点 ID 或别名
yearsnumber是向前(正数)或向后(负数)的年数
scenariostring否optimistic、pessimistic、realistic、disruptive(默认值:realistic)
ethical_framework_evaluation

通过多种伦理框架评估想法或决策。

参数:

参数类型必填说明
nodeIdstring是节点 ID 或别名
frameworksstring[]否采用哪些框架:deontological、consequentialist、virtue、rights_based(默认值:全部)
emotional_intelligence_analysis

分析情感基调、利益相关者的情绪和社会动态。

参数:

参数类型必填说明
textstring是要分析其情感内容的文本
contextstring否上下文(例如,team meeting、customer feedback、crisis situation)
perspectiveTakingnumber否换位思考程度,范围为 0-1(默认值:0.7)
explain_decision

生成易于人理解的决策路径解释。

参数:

参数类型必填描述
nodeIdstring是决策/结论节点 ID 或别名
detailLevelstring否simple、detailed、technical(默认值:detailed)
includeCounterfactualsboolean否显示假设情景(默认值:true)
social_impact_analysis

分析社会影响、利益相关者情绪、群体凝聚力和说服效果。

参数:

参数类型必填描述
nodeIdstring是节点 ID 或别名
stakeholdersstring[]否利益相关者群体(默认值:["customers", "employees", "investors", "community"])
optimize_prompt

PromptOptimizer(Node Zero)——将模糊的提示词转化为经过优化的超级提示词,并进行策略路由。

参数:

参数类型必填描述
originalPromptstring是用户原始的、可能模糊的提示词
userContextobject否{ expertiseLevel, domainKnowledge[], preferences }
conversationHistoryarray否用于提供上下文的历史消息(最多 20 条)
optimizationLevelstring否light、standard、aggressive(默认值:standard)
targetModelstring否claude、gpt4、gpt35、local、generic(默认值:generic)
autoRouteboolean否自动路由至推荐策略(默认值: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
MCTS(蒙特卡洛树搜索)
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

友好的错误消息

验证失败时,你会看到易于理解的错误,而不是原始的 Zod 输出:

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

v3.0.0 新功能

功能描述
节点别名所有 nodeId 参数均可使用 "last"、"best"、"root" 代替节点 ID
MCPResponse结构化 JSON 响应,包含 status、summary、confidence、nextSuggested
会话持久化自动保存至 ~/.deep-thinker/sessions/,并可在重启后恢复
友好的错误消息将 Zod 错误转换为易于理解的提示,并提供针对字段的指引
help 工具提供 3 类工具发现功能和工作流示例
conclude 工具生成图表摘要,包含 primaryFinding、actionItems、graphHealth
strategy: auto根据内容关键词和图状态自动选择策略

与 sequential-thinking 的比较

特性sequential-thinkingdeep-thinker
思考结构线性链DAG(分支/合并/交叉边)
策略仅顺序策略10 种策略(包括自动选择)
Schema 验证无所有策略均使用 Zod schema
置信度基本的思考编号多因素评分与趋势分析
自我批判无自动执行,并设有严重级别
元认知无卡住检测、智能策略触发、自动切换
知识无外部参考、缺口检测、一致性验证
剪枝无死路、冗余、路径优化
图查询线性回顾可视化、最佳路径、分支分析、统计
节点引用仅按 ID 引用别名:last、best、root
响应格式纯文本结构化 MCPResponse,包含 nextSuggested
会话持久化无自动保存、保存/加载/恢复
错误消息原始错误易于理解,并提供提示
工具发现无带分类和工作流的 help 工具
结论手动回顾带有 actionItems 的 conclude 工具
策略选择仅手动选择根据内容自动选择策略

开发

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 项测试覆盖所有模块:Node、Graph、10 种策略(包括自动策略)、Scorer、Metacog、Knowledge、Pruner、集成测试、边缘情况和 Schema 验证。

文档

贡献

请参阅 CONTRIBUTING.md 了解指南。欢迎提交 PR,尤其是新的推理策略和 MCP 工具创意。

许可证

MIT

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。