The Sequential Thinking MCP enables systematic, verifiable, step-by-step reasoning via an agentic plan-execute-reflect loop, allowing the AI to dynamically correct course.
Domain:
wiki.omp.loca.zone| ID:omp-sequential-thinking| Version: 1.0.0
Native OMP extension. Enforces cognitive steps before tool execution via ExtensionAPI. Zero-latency. In-memory state. Active blocking.
๐ Architecture Hooks
Replaces stdio MCP:
pi.registerFlag: CLI argspi.getFlag: CLI argspi.registerCommand: TUI slash commandspi.registerTool: Nativesequential_thinkingtoolpi.on(context): InjectsforcedThoughtsinstructionpi.on(tool_call): Blocks non-cognitive tools until threshold metpi.on(message_end): Loops prompt if LLM yields earlypi.on(turn_start): Counter lifecyclepi.on(tool_execution_end): Counter lifecycle
๐ฆ Layout Deployment
cd ~/.omp/plugins
bun add file:../extensions/sequential-thinkingManifest:
- File:
package.json - Type:
module - Entry:
./src/index.tsviaomp.extensions
๐๏ธ Parameters / Tool Schema
| Parameter | Type | Description |
|---|---|---|
thought | string | The actual reasoning text for the current step. |
thoughtNumber | integer | The current step number in the thinking sequence. |
totalThoughts | integer | The total estimated thoughts required (dynamic). |
nextThoughtNeeded | boolean | Set to true to continue the loop, or false to output the final response. |
isRevision | boolean | Indicates if this step corrects a previous thought. |
revisesThought | integer | The specific thought number being corrected. |
branchFromThought | integer | The thought number from which to fork a new reasoning branch. |
branchId | string | Unique identifier for the active reasoning branch. |
needsMoreThoughts | boolean | Request to increase totalThoughts when limits are reached. |
Example Payload:
{
"thought": "The database migration failed because of a missing index on the 'users' table. I need to create a branch to test the index creation before altering the production DB.",
"thoughtNumber": 4,
"totalThoughts": 6,
"nextThoughtNeeded": true,
"branchFromThought": 3,
"branchId": "test-index-creation"
}๐ Execution Loop
- Plan: Initialize
sequential_thinking(thoughtNumber: 1,nextThoughtNeeded: true) to define the execution plan. - Execute: Interleave external tool calls (e.g., read, bash).
- Reflect: Call
sequential_thinkingto process tool output. - Terminate: Call
sequential_thinking(nextThoughtNeeded: false). - Synthesize: Yield final Markdown output.
๐ฏ Best Practices & Rules
- Interleave Actions: Alternate between thinking steps and tool executions (e.g., Think Read File Think Modify Code).
- Structure Phases: Follow sequence: Define Research Analyze Synthesize.
- Atomic Steps: Limit to one logical leap per thought. No monolithic dumps.
- Pivot Safely: Use
isRevisionto fix flawed premises immediately. UsebranchFromThoughtto test alternative strategies. Never hallucinate forward. - State Tracking: Define the branch goal in the first thought of a new branch.
Common Pitfalls
- Monolithic Thoughts: Packing multiple logical phases into a single step. Keep thoughts atomic.
- Infinite Loops: Setting
nextThoughtNeeded: truerepeatedly without progression. Revise logic if stuck. - Undocumented Branches: Forking paths without clarifying the branch goal in the initial thought of that branch.
๐ก๏ธ Enforcement Sandbox & Controls
-
CLI:
omp --seq-thoughts <N> "<prompt>" -
TUI:
/seqthink <N> -
Context: Injects developer role forcing tool usage.
-
Blocker: Rejects premature tool calls with block reason.
-
Loop: Sends
followUpif agent skips thinking.
๐ฆ When to Use vs. Skip
| Use Case | Recommended? | Why |
|---|---|---|
| Complex Architecture / DB Migrations | Yes | Requires multi-stage planning and verification. |
| Deep Debugging / Memory Leaks | Yes | Requires systematic hypothesis testing. |
| Ambiguous Tasks / Refactoring | Yes | Requires iterative exploration. |
| Simple Math / Facts | No | Unnecessary overhead. |
| Low-Latency Queries | No | Sequential iterations add execution time. |
| Single-Step Tasks (Summarization) | No | No reasoning depth needed. |
๐งช QA Validation
- Deps: Verify
omp-sequential-thinkingin plugin deps. - CLI: Run
omp --helpto confirm--seq-thoughts. - Loop: Run
omp --seq-thoughts 3 "Calc."and verify 3 sequential thoughts. - Block: Run
/seqthink 5then โRun lsโ and verify bash block.