Multi-step reasoning chain via sequential-thinking MCP
How do I use the @modelcontextprotocol/server-sequential-thinking MCP to build a multi-step reasoning chain with numbered thoughts, branching support, and a final conclusion?
Recipe: Multi-step reasoning chain via @modelcontextprotocol/server-sequential-thinking
Launch
npx -y @modelcontextprotocol/server-sequential-thinkingNo args needed — stateless server, keeps thought chains in memory per session.
Server info
- name:
sequential-thinking-server - version:
0.2.0 - protocol:
2024-11-05
Single tool: sequentialthinking
Required params:
thought(string) — your current reasoning stepnextThoughtNeeded(boolean) —trueto continue,falseto concludethoughtNumber(integer, ≥1) — current step numbertotalThoughts(integer, ≥1) — estimated total (can adjust up/down mid-chain)
Optional params for advanced use:
isRevision(boolean) — marks this thought as revising a previous onerevisesThought(integer) — which thought number is being reconsideredbranchFromThought(integer) — fork from a specific thoughtbranchId(string) — identifier for the branchneedsMoreThoughts(boolean) — signal that you need to extend beyondtotalThoughts
Response shape
{
"thoughtNumber": 3,
"totalThoughts": 3,
"nextThoughtNeeded": false,
"branches": [],
"thoughtHistoryLength": 3
}The server echoes back state: current position, whether more thoughts are needed, active branches, and total history length. It also returns structuredContent alongside the text representation.
Usage pattern
- Send thought 1 with
nextThoughtNeeded: true— problem decomposition - Send thought 2+ with
nextThoughtNeeded: true— working steps - Send final thought with
nextThoughtNeeded: false— conclusion
You can revise earlier thoughts (isRevision: true, revisesThought: N) or branch (branchFromThought: N, branchId: "alt-approach") at any point. Adjust totalThoughts freely as the problem unfolds.
Latency
Sub-5ms per thought (p50 = 3ms from sentinel probes). Pure state tracking, no LLM calls inside.
Runs
3 sequential thoughts executed successfully, all returned correct state.
{ "server": "@modelcontextprotocol/server-sequential-thinking", "version": "0.2.0", "transport": "stdio", "launch": "npx -y @modelcontextprotocol/server-sequential-thinking", "traces": [ { "tool": "sequentialthinking", "request": { "name": "sequentialthinking", "arguments": { "thought": "I need to determine whether 91 is prime. Let me check divisibility by small primes.", "nextThoughtNeeded": true, "thoughtNumber": 1, "totalThoughts": 3 } }, "response": { "structuredContent": { "thoughtNumber": 1, "totalThoughts": 3, "nextThoughtNeeded": true, "branches": [], "thoughtHistoryLength": 1 } }, "success": true }, { "tool": "sequentialthinking", "request": { "name": "sequentialthinking", "arguments": { "thought": "91 / 7 = 13. So 91 = 7 * 13, meaning it is NOT prime.", "nextThoughtNeeded": true, "thoughtNumber": 2, "totalThoughts": 3 } }, "response": { "structuredContent": { "thoughtNumber": 2, "totalThoughts": 3, "nextThoughtNeeded": true, "branches": [], "thoughtHistoryLength": 2 } }, "success": true }, { "tool": "sequentialthinking", "request": { "name": "sequentialthinking", "arguments": { "thought": "91 is composite: 91 = 7 × 13.", "nextThoughtNeeded": false, "thoughtNumber": 3, "totalThoughts": 3 } }, "response": { "structuredContent": { "thoughtNumber": 3, "totalThoughts": 3, "nextThoughtNeeded": false, "branches": [], "thoughtHistoryLength": 3 } }, "success": true } ] }