mcpField
S
Sequential Thinking

Sequential Thinking

精选本地服务
modelcontextprotocol.ioAI 与智能体91.6k今天更新

关于 Sequential Thinking

Sequential Thinking 是面向需要结构化问题求解的 MCP 服务,支持随理解推进而修订思路、分支探索,并动态调整步骤数量。

主要功能

  1. 01将复杂问题拆分为步骤
  2. 02修订先前的思路
  3. 03探索不同推理分支
  4. 04动态调整思考步骤数
  5. 05生成并验证假设

适用场景

  1. 01制定可反复修订的计划
  2. 02分析范围尚不明确的问题
  3. 03逐步排查故障

MCP 相关

向 MCP 客户端提供 `sequential_thinking` 工具,并在客户端连接期间保留思考历史。

配置

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

mcp.json · 通用配置
{
"mcpServers": {
"sequentialthinking": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-sequential-thinking"
]
}
}
}
启动命令npx -y @modelcontextprotocol/server-sequential-thinking

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

安装包
npm@modelcontextprotocol/server-sequential-thinking

工具

1

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

参数类型必填说明
thoughtstring是当前思考步骤
nextThoughtNeededboolean|string是是否需要继续思考
thoughtNumberinteger是当前思考编号(数值,例如 1、2、3)
totalThoughtsinteger是估计所需的思考总数(数值,例如 5、10)
isRevisionboolean|string否此项是否修订了先前的思考
revisesThoughtinteger否正在重新考虑的思考编号
branchFromThoughtinteger否分支起点的思考编号
branchIdstring否分支标识符
needsMoreThoughtsboolean|string否是否需要更多思考

详细介绍

Sequential Thinking MCP Server

一种 MCP 服务实现,提供用于通过结构化思维流程进行动态、反思式问题求解的工具。

在 npm 上发布为 @modelcontextprotocol/server-sequential-thinking。

功能

  • 将复杂问题拆解为易于处理的步骤
  • 随着理解加深,修订并完善思路
  • 分支到其他推理路径
  • 动态调整思考总步数
  • 生成并验证解决方案假设
  • 通过 stdio 同时服务于两个协议时代的客户端:2026-07-28 客户端(server/discover,无需握手)和 2025 时代的客户端(initialize)。在这两个时代中,思考历史都会持续到客户端连接结束

工具

sequential_thinking

通过详细的逐步思考流程,辅助解决问题和进行分析。

输入:

  • thought(string):当前思考步骤
  • nextThoughtNeeded(boolean):是否需要继续思考下一步
  • thoughtNumber(integer):当前思考步数
  • totalThoughts(integer):预计所需的思考总步数
  • isRevision(boolean,可选):是否在修订先前的思考
  • revisesThought(integer,可选):正在重新考虑哪一步思考
  • branchFromThought(integer,可选):开始分支的思考步数
  • branchId(string,可选):分支标识符
  • needsMoreThoughts(boolean,可选):是否需要更多思考

使用方法

Sequential Thinking 工具适用于:

  • 将复杂问题拆解为多个步骤
  • 留有修订空间的规划与设计
  • 可能需要调整方向的分析
  • 初期可能无法明确完整范围的问题
  • 需要在多个步骤中保持上下文的任务
  • 需要过滤无关信息的情况

实际上,除非客户端提供原始工具调用,否则你无需手动直接调用 sequential_thinking。只需将 MCP 服务连接到支持 MCP 的宿主,并要求模型逐步思考问题即可。宿主随后可以决定在处理问题时调用该工具一次或多次。

使用示例

通常适合使用此工具的提示词示例:

  • Plan a database migration from PostgreSQL 14 to 16, list risks, and revise the plan if downtime exceeds 5 minutes.
  • Debug why this deployment only fails in production and show your reasoning step by step.
  • Compare three architecture options for a file sync engine and branch if one assumption turns out to be wrong.
如何确认工具正常工作

如果宿主或检查器会显示工具活动,你应该能看到 sequential_thinking 被反复调用,调用中包含以下字段:

  • thought
  • thoughtNumber
  • totalThoughts
  • nextThoughtNeeded

推理方向发生变化时,你还可能看到修订或分支字段,例如 isRevision、revisesThought、branchFromThought 或 branchId。

快速手动验证

在 MCP 宿主中安装服务后:

  1. 重启或重新加载宿主,使其重新连接到服务。
  2. 确认宿主的 MCP 工具列表或检查器中显示 sequential_thinking 工具。
  3. 要求宿主逐步解决一个有一定难度的问题。
  4. 确认宿主多次调用该工具,而不是只返回一次性答案。

要求

通过 npx 运行服务或从源代码运行时,需要 Node.js 24 或更高版本。

配置

在 Claude Desktop 中使用

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

npx
{
  "mcpServers": {
    "sequential-thinking": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-sequential-thinking"
      ]
    }
  }
}

在 Windows 上,使用 cmd /c 启动 npx:

{
  "mcpServers": {
    "sequential-thinking": {
      "command": "cmd",
      "args": [
        "/c",
        "npx",
        "-y",
        "@modelcontextprotocol/server-sequential-thinking"
      ]
    }
  }
}
docker
{
  "mcpServers": {
    "sequentialthinking": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "mcp/sequentialthinking"
      ]
    }
  }
}

要禁用思考信息日志记录,请将环境变量 DISABLE_THOUGHT_LOGGING 设为 true。

在 VS Code 中使用

如需快速安装,请点击下方的其中一个安装按钮……

Install with NPX in VS Code Install with NPX in VS Code Insiders

Install with Docker in VS Code Install with Docker in VS Code Insiders

如需手动安装,可通过以下任一方式配置 MCP 服务:

方法 1:用户配置(推荐) 将配置添加到用户级 MCP 配置文件中。打开命令面板(Ctrl + Shift + P),然后运行 MCP: Open User Configuration。这将打开用户的 mcp.json 文件,你可以在其中添加服务配置。

方法 2:工作区配置 或者,你也可以在工作区中名为 .vscode/mcp.json 的文件里添加配置。这样便可与他人共享该配置。

有关 VS Code 中 MCP 配置的更多详情,请参阅 VS Code 官方 MCP 文档。

使用 NPX 安装:

{
  "servers": {
    "sequential-thinking": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-sequential-thinking"
      ]
    }
  }
}

在 Windows 上,使用:

{
  "servers": {
    "sequential-thinking": {
      "command": "cmd",
      "args": [
        "/c",
        "npx",
        "-y",
        "@modelcontextprotocol/server-sequential-thinking"
      ]
    }
  }
}

使用 Docker 安装:

{
  "servers": {
    "sequential-thinking": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "mcp/sequentialthinking"
      ]
    }
  }
}
在 Codex CLI 中使用

运行以下命令:

npx
codex mcp add sequential-thinking npx -y @modelcontextprotocol/server-sequential-thinking

构建

Docker:

docker build -t mcp/sequentialthinking -f src/sequentialthinking/Dockerfile .

许可证

此 MCP 服务采用 MIT 许可证授权。这意味着你可以自由使用、修改和分发该软件,但须遵守 MIT 许可证的条款和条件。更多详情请参阅项目仓库中的 LICENSE 文件。

评论

支持 Markdown

第一次接触 MCP?

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

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