Structured sequential thinking with revision and branching via @modelcontextprotocol/server-sequential-thinking (npx) — Anthropic reference server
@modelcontextprotocol/server-sequential-thinking v2025.12.18 — Verified Recipe
Package: @modelcontextprotocol/server-sequential-thinking (Anthropic official reference server) Install: npm install @modelcontextprotocol/server-sequential-thinking Entry: dist/index.js — runs on stdio, stateful within a server session (no file persistence) Version tested: 2025.12.18
Tools (1)
| Tool | Params | Description |
|---|---|---|
sequentialthinking | thought, thoughtNumber, totalThoughts, nextThoughtNeeded (required) + isRevision, revisesThought, branchFromThought, branchId, needsMoreThoughts (optional) | Record one step in a chain of reasoning |
Parameters detail
- `thought` (string, required): The content of this thinking step
- `thoughtNumber` (int, required): Current step number (1-indexed)
- `totalThoughts` (int, required): Expected total steps — can increase dynamically
- `nextThoughtNeeded` (bool, required):
trueto continue chain,falseto end - `isRevision` (bool): Mark this thought as revising a prior one
- `revisesThought` (int): Which thought number is being revised
- `branchFromThought` (int): Fork from a specific earlier thought
- `branchId` (string): Label for the branch
- `needsMoreThoughts` (bool): Signal that totalThoughts should increase
Execution trace — 6 calls, 100% success
Tested a multi-step caching architecture design with revision and branching:
- Thought 1/5 — Define problem (API caching at 10K req/s)
→ Response: {thoughtNumber:1, totalThoughts:5, nextThoughtNeeded:true, branches:[], thoughtHistoryLength:1} → Server prints 💭 Thought 1/5 box to stderr
- Thought 2/5 — Analyze cache-aside vs stale-while-revalidate
→ {thoughtNumber:2, totalThoughts:5, branches:[], thoughtHistoryLength:2}
- Revision 3/5 (revising thought 2) —
isRevision:true, revisesThought:2
→ Server prints 🔄 Revision 3/5 (revising thought 2) to stderr → {thoughtNumber:3, totalThoughts:5, branches:[], thoughtHistoryLength:3}
- Branch 4/6 (from thought 2, ID: "cdn-approach") —
branchFromThought:2, branchId:"cdn-approach",totalThoughts:6
→ Server prints 🌿 Branch 4/6 (from thought 2, ID: cdn-approach) to stderr → {thoughtNumber:4, totalThoughts:6, branches:["cdn-approach"], thoughtHistoryLength:4} → Note: totalThoughts dynamically increased from 5→6
- Thought 5/6 — Synthesize two-layer approach
→ {thoughtNumber:5, totalThoughts:6, branches:["cdn-approach"], thoughtHistoryLength:5}
- Thought 6/6 — Final decision,
nextThoughtNeeded:false
→ {thoughtNumber:6, totalThoughts:6, nextThoughtNeeded:false, branches:["cdn-approach"], thoughtHistoryLength:6}
Key observations
- Single tool, rich semantics — all reasoning operations (think, revise, branch, extend) use the same
sequentialthinkingtool with different flag combinations. - Dynamic chain length —
totalThoughtscan increase mid-chain (went from 5→6 when branching). - Revision tracking —
isRevision:true+revisesThought:Nmarks a thought as correcting a prior one. Server labels it🔄 Revisionin stderr output. - Branching —
branchFromThought:N+branchId:"label"forks the reasoning. Branch IDs accumulate in the response'sbranchesarray. - Stderr decoration — server prints formatted boxes with emoji (
💭,🔄,🌿) to stderr for human-readable logging. MCP response is clean JSON. - No persistence — thought chain lives in server memory only. Restarting the server loses all thoughts.
- No retrieval tool — there is no way to read back earlier thoughts via MCP. The server tracks
thoughtHistoryLengthbut doesn't expose agetThoughtstool. The agent must maintain its own context. - Response shape — always returns
{thoughtNumber, totalThoughts, nextThoughtNeeded, branches[], thoughtHistoryLength}.
Key gotchas
- **⚠️ No re
{ "server": "@modelcontextprotocol/server-sequential-thinking", "version": "2025.12.18", "transport": "stdio", "tools": 1, "calls": 6, "success_rate": "100%", "features_tested": { "basic_thought": true, "revision": true, "branching": true, "dynamic_total_increase": true, "chain_termination": true }, "response_shape": { "thoughtNumber": "int", "totalThoughts": "int", "nextThoughtNeeded": "bool", "branches": "string[]", "thoughtHistoryLength": "int" }, "key_findings": { "no_readback_tool": true, "write_only_scratchpad": true, "no_persistence": true, "phantom_refs_accepted": true, "total_thoughts_advisory": true, "stderr_decorated_logging": true, "emoji_labels": ["💭 Thought", "🔄 Revision", "🌿 Branch"] } }