An enhanced version of Anthropic's Sequential Thinking MCP server that adds branching capabilities, self-reinforcing output, handoff/resume functionality, and project knowledge integration.
When debugging complex issues, you often need to investigate side paths without losing your main train of thought. The original sequential thinking tool forces linear progression. Our enhancement lets you branch off, investigate, and merge findings back - just like Git branches but for thoughts.
Create branches to investigate side issues without losing your main train of thought:
- Branch off at any point to explore errors, test hypotheses, or investigate tangents
- Merge branches back to main with clear markers
- Track multiple active branches simultaneously
Never lose track of the tool again! Every response includes:
---
Continue from: [main:6]
Active branches: database-debug, error-investigation
---
- Generate comprehensive handoff documents with all thoughts and state
- Resume sessions with full context preservation
- Perfect for long debugging sessions across multiple conversations
Configure project-specific knowledge that gets auto-injected when relevant:
- Database connections
- Framework details
- Common issues and solutions
- Node.js >= 18.0.0
- Claude Desktop with MCP support
- Clone the repository:
git clone https://github.com/StopUncleTonyFromComing/sequential-thinking-branches.git
cd sequential-thinking-branches- Install dependencies:
npm install- Add to your Claude Desktop configuration:
Windows (%APPDATA%\Claude\claude_desktop_config.json):
{
"mcpServers": {
"sequential-thinking-enhanced": {
"command": "node",
"args": ["C:\\path\\to\\sequential-thinking-branches\\index.js"]
}
}
}macOS (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"sequential-thinking-enhanced": {
"command": "node",
"args": ["/path/to/sequential-thinking-branches/index.js"]
}
}
}- Restart Claude Desktop
[main:1] Starting to debug the authentication issue
[main:2] Looking at the login endpoint
[main:3] Found an issue with JWT validation
[main:5] Found a database connection error
[branch: database-debug]
[database-debug:1] Checking connection string
[database-debug:2] Testing with direct query
[database-debug:3] Connection works, issue is with ORM
[merge: database-debug]
[main:6] Database issue resolved (ORM config), continuing with auth debug
Before ending a session:
[handoff]
> Generated: handoff-2025-07-25T10-30-00.md
> Contains 15 main thoughts, 3 branches, project knowledge
In a new conversation:
[resume: handoff-2025-07-25T10-30-00.md]
> Restored 15 main thoughts, 3 branches
> Current position: [main:15]
[main:16] Continuing where we left off...
Edit config.json to add your project-specific information:
{
"projectKnowledge": {
"database": "PostgreSQL on localhost:5432, DB: myapp",
"framework": "FastAPI with SQLAlchemy",
"auth": "JWT tokens with 24-hour expiry",
"key_endpoints": [
"/api/auth/login - User authentication",
"/api/users - User management"
],
"common_issues": {
"connection_timeout": "Check VPN connection and database firewall rules",
"auth_failures": "Verify JWT secret in environment variables"
}
}
}The tool automatically detects keywords and injects relevant knowledge:
- Mention "database" → get connection details
- Mention "auth" → get authentication setup info
- Mention "endpoint" → get API route documentation
| Feature | Original | Enhanced |
|---|---|---|
| Sequential thinking | ✅ | ✅ |
| Revisions | ✅ | ✅ |
| Branching | ❌ | ✅ |
| Self-reinforcing output | ❌ | ✅ |
| Handoff/Resume | ❌ | ✅ |
| Project knowledge | ❌ | ✅ |
| Prevents dropping | ❌ | ✅ |
Branch when:
- You need to investigate an error that might take multiple steps
- You want to test something that might not work
- You're checking a tangential concern
- You don't want to clutter the main thought sequence
Continue on main when:
- The investigation is directly related to your main goal
- It's a quick check (1-2 thoughts)
- You've confirmed the issue and are implementing the fix
error-investigation- For debugging specific errorstest-hypothesis- For testing theoriescheck-config- For configuration verificationperf-analysis- For performance investigation
- Check MCP server is properly configured
- Restart Claude Desktop
- Check server logs in Claude's developer console
- Ensure branch name is spelled correctly (case-sensitive)
- Check if branch was already merged
- Use the exact branch name from creation
- Ensure you're using the exact filename provided
- Check file exists in the server directory
- Verify file permissions
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
# Clone the repo
git clone https://github.com/StopUncleTonyFromComing/sequential-thinking-branches.git
cd sequential-thinking-branches
# Install dependencies
npm install
# Run tests
npm test
# Run with debug logging
DISABLE_THOUGHT_LOGGING=false node index.jsThis project is licensed under the MIT License - see the LICENSE file for details.
- Built on top of @modelcontextprotocol/server-sequential-thinking by Anthropic
- Enhanced with branching and persistence features for complex debugging workflows
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Note: This is an unofficial enhancement of the original Sequential Thinking MCP server. It maintains full backward compatibility while adding powerful new features for complex debugging workflows.