MCP Server Official reference

Sequential Thinking

An MCP server exposing a sequential_thinking tool for step-by-step problem solving with revision, branching, and adjustable thought counts.

docker build -t mcp/sequentialthinking -f src/sequentialthinking/Dockerfile .
Sequential Thinking preview image

What it is

Sequential Thinking is an MCP server that provides a single tool, sequential_thinking, for dynamic and reflective problem-solving through a structured thinking process. It lets a model break complex problems into steps, revise earlier thoughts, branch into alternative reasoning paths, and adjust the total number of thoughts as it goes. It is published on npm as @modelcontextprotocol/server-sequential-thinking.

Who it's for

  • Developers using MCP-aware hosts (Claude Desktop, VS Code, Codex CLI) who want structured multi-step reasoning
  • Users tackling complex planning, design, or analysis tasks that may need course correction
  • Those working on problems whose full scope is unclear at the start

Requirements

Requirements

  • An MCP-aware host or client (e.g., Claude Desktop, VS Code, Codex CLI)
  • npx (for the npm package) or Docker (for the mcp/sequentialthinking image)

Setup

  1. Claude Desktop with npx

    Add this to your claude_desktop_config.json.

    json
    {
      "mcpServers": {
        "sequential-thinking": {
          "command": "npx",
          "args": [
            "-y",
            "@modelcontextprotocol/server-sequential-thinking"
          ]
        }
      }
    }
  2. Claude Desktop with Docker

    Run the server from the mcp/sequentialthinking Docker image. To disable logging of thought information, set the env var DISABLE_THOUGHT_LOGGING to true.

    json
    {
      "mcpServers": {
        "sequentialthinking": {
          "command": "docker",
          "args": [
            "run",
            "--rm",
            "-i",
            "mcp/sequentialthinking"
          ]
        }
      }
    }
  3. VS Code with npx

    Add to your user mcp.json (via the Command Palette: MCP: Open User Configuration) or to .vscode/mcp.json in your workspace.

    json
    {
      "servers": {
        "sequential-thinking": {
          "command": "npx",
          "args": [
            "-y",
            "@modelcontextprotocol/server-sequential-thinking"
          ]
        }
      }
    }
  4. Codex CLI

    Add the server with the codex mcp add command.

    bash
    codex mcp add sequential-thinking npx -y @modelcontextprotocol/server-sequential-thinking
  5. Build the Docker image

    Build the image locally from the repository.

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

Examples

Plan a database migration

Prompt
prompt
Plan a database migration from PostgreSQL 14 to 16, list risks, and revise the plan if downtime exceeds 5 minutes.

Expected output: A planning task that benefits from stepwise thinking and revision of earlier thoughts.

Debug a production-only failure

Prompt
prompt
Debug why this deployment only fails in production and show your reasoning step by step.

Expected output: Analysis that may need course correction as understanding develops.

Compare architecture options with branching

Prompt
prompt
Compare three architecture options for a file sync engine and branch if one assumption turns out to be wrong.

Expected output: Shows how the tool's branching capability can be used to explore alternative reasoning paths.

Windows npx configuration for Claude Desktop

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

What it does: On Windows, npx is launched through cmd /c.

Pros & cons

Pros

  • Pro:Supports revising earlier thoughts and branching into alternative reasoning paths
  • Pro:Total thought count can be adjusted dynamically as understanding changes
  • Pro:Multiple install options: npx, Docker, VS Code, Claude Desktop, and Codex CLI
  • Pro:Thought logging can be disabled with DISABLE_THOUGHT_LOGGING

Cons

  • Con:Not usually called directly by hand; it relies on an MCP-aware host and the model deciding to invoke the tool
  • Con:Requires manual verification that the host actually calls the tool multiple times rather than giving a one-shot answer

Images