Break down complex problems with branching, revision, and dynamic chain-of-thought via @modelcontextprotocol/server-sequential-thinking (npm) — Anthropic reference server
Anthropic's official reference MCP server for sequential thinking. Gives agents a structured scratchpad where each thought step is numbered, revisable, and branchable — the server tracks the full thought history and active branches. Useful for: complex problem decomposition, design decisions with exploration of alternatives, hypothesis-and-verify loops, and any workflow that needs an auditable chain-of-thought separate from the LLM's own reasoning.
Recipe: Sequential thinking with branching and revision via @modelcontextprotocol/server-sequential-thinking
Install: npm install @modelcontextprotocol/server-sequential-thinking Launch: node node_modules/@modelcontextprotocol/server-sequential-thinking/dist/index.js (stdio)
Tool: sequentialthinking
Required params: thought (string), nextThoughtNeeded (boolean), thoughtNumber (integer ≥ 1), totalThoughts (integer ≥ 1) Optional params: isRevision (bool), revisesThought (int), branchFromThought (int), branchId (string), needsMoreThoughts (bool)
Returns (structured): { thoughtNumber, totalThoughts, nextThoughtNeeded, branches: string[], thoughtHistoryLength }
What it does
A server-side reasoning scratchpad that tracks numbered thought steps, supports branching to explore alternatives (with named branch IDs), revision of earlier thoughts, and dynamic extension of the total thought count. The server maintains the full thought history across the session — the agent gets back the current position, active branches, and history depth after each step.
Trace 1 — Linear 3-step chain (rate limiter design)
tools/call → sequentialthinking
{ thought: "I need to design a rate limiter...", nextThoughtNeeded: true, thoughtNumber: 1, totalThoughts: 3 }
← { thoughtNumber: 1, totalThoughts: 3, nextThoughtNeeded: true, branches: [], thoughtHistoryLength: 1 } (2ms)
tools/call → sequentialthinking
{ thought: "Token bucket is best for bursty traffic...", nextThoughtNeeded: true, thoughtNumber: 2, totalThoughts: 3 }
← { thoughtNumber: 2, totalThoughts: 3, nextThoughtNeeded: true, branches: [], thoughtHistoryLength: 2 } (0ms)
tools/call → sequentialthinking
{ thought: "Final design: Redis MULTI/EXEC with token bucket...", nextThoughtNeeded: false, thoughtNumber: 3, totalThoughts: 3 }
← { thoughtNumber: 3, totalThoughts: 3, nextThoughtNeeded: false, branches: [], thoughtHistoryLength: 3 } (1ms)Trace 2 — Branching + revision (database choice)
tools/call → sequentialthinking [initial thought]
{ thought: "Should I use SQL or NoSQL for analytics?", nextThoughtNeeded: true, thoughtNumber: 1, totalThoughts: 3 }
← { thoughtNumber: 1, ..., branches: [], thoughtHistoryLength: 1 }
tools/call → sequentialthinking [branch from thought 1]
{ thought: "NoSQL/ClickHouse handles columnar queries faster...", nextThoughtNeeded: true, thoughtNumber: 2, totalThoughts: 4, branchFromThought: 1, branchId: "nosql-path" }
← { thoughtNumber: 2, ..., branches: ["nosql-path"], thoughtHistoryLength: 2 } (1ms)
tools/call → sequentialthinking [revise thought 1]
{ thought: "PostgreSQL+TimescaleDB gives both SQL AND columnar...", nextThoughtNeeded: true, thoughtNumber: 3, totalThoughts: 4, isRevision: true, revisesThought: 1 }
← { thoughtNumber: 3, ..., branches: ["nosql-path"], thoughtHistoryLength: 3 } (1ms)
tools/call → sequentialthinking [conclude]
{ thought: "Hybrid: PG+TimescaleDB for structured, ClickHouse for events", nextThoughtNeeded: false, thoughtNumber: 4, totalThoughts: 4 }
← { thoughtNumber: 4, totalThoughts: 4, nextThoughtNeeded: false, branches: ["nosql-path"], thoughtHistoryLength: 4 } (1ms)Key observations
- Sub-2ms latency on every call — zero network overhead (stdio)
- Dynamic totalThoughts — you can increase it mid-chain without penalty
- Branches are tracked — the response includes all active branch IDs
- Revisions reference prior thoughts by number — useful for audit trails
- No validation on phantom references — the server accepts
revisesThought: 99even if only 2 thoughts exist (known behavior, not a bug per se) - Session-scoped — thought history resets when the server restarts
{ "server": "@modelcontextprotocol/server-sequential-thinking", "version": "2025.12.18", "transport": "stdio", "install": "npm install @modelcontextprotocol/server-sequential-thinking", "launch": "node node_modules/@modelcontextprotocol/server-sequential-thinking/dist/index.js", "tools": ["sequentialthinking"], "tool_schema": { "required": ["thought", "nextThoughtNeeded", "thoughtNumber", "totalThoughts"], "optional": ["isRevision", "revisesThought", "branchFromThought", "branchId", "needsMoreThoughts"] }, "output_schema": { "fields": ["thoughtNumber", "totalThoughts", "nextThoughtNeeded", "branches", "thoughtHistoryLength"] }, "traces": [ { "label": "linear-3-step-chain", "calls": 3, "latencies_ms": [2, 0, 1], "final_output": { "thoughtNumber": 3, "totalThoughts": 3, "nextThoughtNeeded": false, "branches": [], "thoughtHistoryLength": 3 } }, { "label": "branch-and-revision", "calls": 4, "features_used": ["branchFromThought", "branchId", "isRevision", "revisesThought"], "latencies_ms": [1, 1, 1, 1], "final_output": { "thoughtNumber": 4, "totalThoughts": 4, "nextThoughtNeeded": false, "branches": ["nosql-path"], "thoughtHistoryLength": 4 } } ], "probed_at": "2026-06-20T16:10:00Z" }