MCP server for sequential thinking and problem solving
An MCP server implementation that provides a tool for reflective, assumption-aware reasoning through a structured thinking process that makes metacognition explicit.
- Break down complex problems into manageable steps
- Revise and refine thoughts as understanding deepens
- Branch into alternative paths of reasoning
- Adjust the total number of thoughts dynamically
- Generate and verify solution hypotheses
- Identify assumptions that need verification
- Pause thinking to gather evidence from other tools
- Resume reasoning with new information
The Sequential Thinking tool works in an iterative cycle with other evidence-gathering tools:
``mermaid`
graph TD
A["Sequential Thinking Tool
Begin Reflective Analysis"] --> B["Generate Thoughts
Identify Assumptions"]
B --> C{"Assumptions Need
Verification?"}
C -->|Yes| D["Pause Thinking
nextThoughtNeeded=false
Output Assumptions"]
C -->|No| E["Continue Thinking
nextThoughtNeeded=true"]
D --> F["Other Tools
Gather Evidence
(web search, file reading, etc.)"]
F --> G["Resume Thinking
With New Evidence"]
G --> B
E --> H{"All Assumptions
Verified?"}
H -->|No| B
H -->|Yes| I["Final Conclusion
nextThoughtNeeded=false"]
This workflow emphasizes rigorous reasoning by:
1. Explicitly identifying assumptions
2. Pausing to gather supporting evidence
3. Verifying assumptions before reaching conclusions
4. Allowing flexible iteration between thinking and evidence gathering
Facilitates reflective, assumption-aware reasoning by making thinking explicit, identifying underlying assumptions, and recognizing when external verification is needed.
Inputs:
- thought (string): The current thinking stepnextThoughtNeeded
- (boolean): Whether to continue thinking or pause (can be false even with unverified assumptions)thoughtNumber
- (integer): Current thought numbertotalThoughts
- (integer): Estimated total thoughts neededassumptions
- (string, optional): Unverified assumptions that need evidenceevidence
- (string, optional): Supporting evidence and verified assumptionsisRevision
- (boolean, optional): Whether this revises previous thinkingrevisesThought
- (integer, optional): Which thought is being reconsideredbranchFromThought
- (integer, optional): Branching point thought numberbranchId
- (string, optional): Branch identifierneedsMoreThoughts
- (boolean, optional): If more thoughts are needed
The Sequential Thinking tool is designed for:
- Breaking down complex problems into steps
- Planning and design with room for revision
- Analysis that might need course correction
- Problems where the full scope might not be clear initially
- Tasks that need to maintain context over multiple steps
- Situations where irrelevant information needs to be filtered out
Add this to ~/.claude.json or claude_desktop_config.json:
#### Local Development
`json`
{
"mcpServers": {
"sequential-thinking": {
"command": "node",
"args": ["/path/to/your/seq-think/dist/index.js"]
}
}
}
#### npx
`json`
{
"mcpServers": {
"sequential-thinking": {
"command": "npx",
"args": [
"-y",
"@ahxxm/server-sequential-thinking"
]
}
}
}
For manual installation, add the following JSON block to your User Settings (JSON) file in VS Code. You can do this by pressing Ctrl + Shift + P and typing Preferences: Open Settings (JSON):
`json`
{
"mcp": {
"servers": {
"sequential-thinking": {
"command": "npx",
"args": [
"-y",
"@ahxxm/server-sequential-thinking"
]
}
}
}
}
Optionally, you can add it to a file called .vscode/mcp.json in your workspace. This will allow you to share the configuration with others.
> Note that the mcp key is not needed in the .vscode/mcp.json file.
To build the project locally:
`bash`
npm run build
For production builds:
`bash`
npm run build:prod
For CI/CD environments:
`bash``
npm run install:ci
npm run build:prod
This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.