quanticsoul4772/unified-thinking
If you are the rightful owner of unified-thinking and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
Unified Thinking Server is a comprehensive MCP server that consolidates multiple cognitive thinking patterns into a single, efficient Go-based server.
Unified Thinking Server
A MCP server that consolidates multiple cognitive thinking patterns into a single, efficient Go-based implementation.
Features
Thinking Modes
- Linear Mode: Sequential step-by-step reasoning for systematic problem solving
- Tree Mode: Multi-branch parallel exploration with insights and cross-references
- Divergent Mode: Creative/unconventional ideation with "rebellion" capability
- Auto Mode: Automatic mode selection based on input content
Core Capabilities
- Multi-mode thinking (linear, tree, divergent, auto)
- Branch management and exploration
- Insight generation and tracking
- Cross-reference support between branches
- Logical validation and consistency checking
- Formal proof attempts
- Syntax validation for logical statements
- Search across all thoughts
- Full history tracking
- Optional persistence with SQLite (in-memory by default)
Cognitive Reasoning Capabilities
The server includes advanced cognitive reasoning features that transform it from a thought recorder into a comprehensive reasoning assistant:
Probabilistic Reasoning
- Bayesian inference with prior and posterior belief updates
- Evidence-based probability updates
- Belief combination operations (AND/OR)
- Confidence estimation from evidence aggregation
Evidence Assessment
- Automatic quality classification (Strong/Moderate/Weak/Anecdotal)
- Reliability scoring based on source credibility and content
- Relevance calculation and weighted scoring
- Multi-source evidence aggregation
Analysis Tools
- Contradiction detection across thoughts (negations, absolutes, modals)
- Sensitivity analysis for testing assumption robustness
- Multi-perspective stakeholder analysis
- Temporal reasoning (short-term vs long-term implications)
Decision Support
- Multi-criteria decision analysis (MCDA) with weighted scoring
- Problem decomposition into manageable subproblems
- Dependency mapping and solution path determination
- Cross-mode insight synthesis and branch merging
Metacognition
- Self-evaluation of thought quality, completeness, and coherence
- Cognitive bias detection (confirmation, anchoring, availability, sunk cost, overconfidence, recency, groupthink)
- Bias severity classification and mitigation strategies
- Strength/weakness identification with improvement suggestions
Advanced Reasoning
- Analogical reasoning with cross-domain mapping
- Enhanced creative ideation techniques
- Pattern-based reasoning and inference
Installation
Prerequisites
- Go 1.23 or higher
- Git
Build
go mod download
go build -o bin/unified-thinking.exe ./cmd/server
Or using make:
make build
Configuration
Basic Configuration (In-Memory)
Add to your Claude Desktop config (%APPDATA%\Claude\claude_desktop_config.json
on Windows):
{
"mcpServers": {
"unified-thinking": {
"command": "/path/to/unified-thinking/bin/unified-thinking.exe",
"transport": "stdio",
"env": {
"DEBUG": "true"
}
}
}
}
Configuration with SQLite Persistence
For persistent storage across sessions:
{
"mcpServers": {
"unified-thinking": {
"command": "/path/to/unified-thinking/bin/unified-thinking.exe",
"transport": "stdio",
"env": {
"DEBUG": "true",
"STORAGE_TYPE": "sqlite",
"SQLITE_PATH": "C:\\Users\\YourName\\AppData\\Roaming\\Claude\\unified-thinking.db",
"STORAGE_FALLBACK": "memory"
}
}
}
}
Environment Variables:
STORAGE_TYPE
:memory
(default) orsqlite
SQLITE_PATH
: Path to SQLite database file (created automatically)SQLITE_TIMEOUT
: Connection timeout in milliseconds (default: 5000)STORAGE_FALLBACK
: Storage to use if primary fails (e.g.,memory
)DEBUG
: Enable debug logging (true
orfalse
)
After saving the config, restart Claude Desktop.
Available Tools
-
think - Main thinking tool
{ "content": "Your thinking prompt", "mode": "auto|linear|tree|divergent", "confidence": 0.8, "key_points": ["point1", "point2"], "require_validation": true }
-
history - View thinking history
{ "mode": "linear|tree|divergent", "branch_id": "optional" }
-
list-branches - List all branches (tree mode)
-
focus-branch - Switch active branch
{ "branch_id": "branch-xxx" }
-
branch-history - Get detailed branch history
{ "branch_id": "branch-xxx" }
-
validate - Validate a thought for logical consistency
{ "thought_id": "thought-xxx" }
-
prove - Attempt to prove a logical conclusion
{ "premises": ["All humans are mortal", "Socrates is human"], "conclusion": "Socrates is mortal" }
-
check-syntax - Validate logical statement syntax
{ "statements": ["Statement 1", "Statement 2"] }
-
search - Search thoughts
{ "query": "search term", "mode": "optional mode filter" }
-
get-metrics - Get system performance and usage metrics
-
recent-branches - Get recently accessed branches for quick context switching
- Returns the last 10 accessed branches with timestamps
- Shows active branch for context
- Enables fast branch switching without remembering IDs
-
probabilistic-reasoning - Bayesian inference and belief updates
{ "operation": "create|update|get|combine", "statement": "It will rain tomorrow", "prior_prob": 0.3, "belief_id": "belief-xxx", "likelihood": 0.8, "evidence_prob": 0.4 }
-
assess-evidence - Evidence quality assessment
{ "content": "Evidence content", "source": "Source reference", "claim_id": "claim-xxx", "supports_claim": true }
-
detect-contradictions - Find contradictions among thoughts
{ "thought_ids": ["thought-1", "thought-2"], "branch_id": "branch-xxx", "mode": "linear|tree|divergent" }
-
make-decision - Multi-criteria decision analysis
{ "question": "Which option should we choose?", "options": [{"name": "Option A", "scores": {"cost": 0.8}}], "criteria": [{"name": "Cost", "weight": 0.6, "maximize": false}] }
-
decompose-problem - Break down complex problems
{ "problem": "Complex problem description" }
-
sensitivity-analysis - Test robustness of conclusions
{ "target_claim": "Main conclusion", "assumptions": ["assumption1", "assumption2"], "base_confidence": 0.8 }
-
self-evaluate - Metacognitive self-assessment
{ "thought_id": "thought-xxx", "branch_id": "branch-xxx" }
-
detect-biases - Identify cognitive biases
{ "thought_id": "thought-xxx", "branch_id": "branch-xxx" }
Example Prompts
Auto Mode (Recommended):
"Analyze this problem using the best thinking approach"
Explicit Linear Mode:
"Think step by step about solving this"
Explicit Tree Mode:
"Explore multiple branches of this idea with cross-references"
Explicit Divergent Mode:
"What's a creative, unconventional solution to this?"
"Challenge all assumptions about this problem" (with force_rebellion)
Architecture
unified-thinking/
āāā cmd/server/ # Main entry point
āāā internal/
ā āāā types/ # Core data structures (extended with cognitive types)
ā āāā storage/ # Pluggable storage (in-memory default, SQLite optional)
ā ā āāā memory.go # In-memory implementation
ā ā āāā sqlite.go # SQLite with write-through cache
ā ā āāā factory.go # Storage factory pattern
ā ā āāā config.go # Configuration management
ā āāā modes/ # Thinking mode implementations
ā ā āāā linear.go
ā ā āāā tree.go
ā ā āāā divergent.go
ā ā āāā auto.go
ā āāā reasoning/ # Probabilistic reasoning and decision making
ā āāā analysis/ # Evidence assessment, contradiction detection, sensitivity analysis
ā āāā metacognition/ # Self-evaluation and bias detection
ā āāā validation/ # Logic validation
ā āāā server/ # MCP server implementation
āāā TECHNICAL_PLAN.md # Detailed technical documentation
Cognitive Architecture
The server implements a modular cognitive architecture with three specialized packages:
- reasoning: Implements Bayesian probabilistic inference, multi-criteria decision analysis, and problem decomposition
- analysis: Provides evidence quality assessment, contradiction detection, and sensitivity analysis for robustness testing
- metacognition: Enables self-evaluation and cognitive bias detection with mitigation strategies
All components are thread-safe, composable, and maintain backward compatibility with existing functionality.
Development
Build
# Build the server binary
make build
# Clean build artifacts
make clean
# For protocol debugging only (waits for MCP messages on stdin)
go run ./cmd/server/main.go
# With debug logging
DEBUG=true go run ./cmd/server/main.go
Testing
# Run tests
make test
# Run with verbose output
go test -v ./...
Troubleshooting
Server won't start
- Check that Go is installed:
go version
- Verify the binary was built: Check
bin/
directory - Enable debug mode: Set
DEBUG=true
in env
Tools not appearing
- Restart Claude Desktop completely
- Check config file syntax
- Verify the executable path is correct
Performance issues
In-Memory Mode (default):
- Data is lost on server restart
- For long sessions with many thoughts, consider periodic restarts
- Monitor memory usage if processing thousands of thoughts
SQLite Mode (persistent):
- Data persists across restarts
- Uses write-through caching for fast access
- Automatic memory management via cache eviction
- Enable with
STORAGE_TYPE=sqlite
environment variable
Contributing
See for detailed architecture and implementation notes.
License
MIT License
Technical Details
Data Structures
The system includes 15 specialized cognitive data structures:
- Evidence: Quality assessment with reliability and relevance scoring
- ProbabilisticBelief: Bayesian beliefs with prior/posterior tracking
- Contradiction: Cross-thought contradiction detection results
- Perspective: Stakeholder viewpoint analysis
- TemporalAnalysis: Short-term vs long-term reasoning
- Decision: Structured decision framework with criteria and options
- ProblemDecomposition: Complex problem breakdown into subproblems
- Synthesis: Cross-mode insight integration
- SensitivityAnalysis: Robustness testing of conclusions
- Analogy: Cross-domain analogical reasoning
- SelfEvaluation: Metacognitive self-assessment
- CognitiveBias: Detected biases with mitigation strategies
Implementation Features
- Modular package design for composability
- Thread-safe operations with proper locking patterns
- Comprehensive test coverage for all cognitive capabilities
- Backward compatible with existing functionality
- Pluggable storage architecture:
- In-memory storage optimized for speed (default)
- SQLite storage with write-through caching for persistence
- Graceful fallback handling
- Factory pattern for extensibility
Implementation Status
ā Production Ready - All features fully implemented and tested
- Core Thinking Modes: Linear, Tree, Divergent, Auto - 100% Complete
- Cognitive Reasoning: Probabilistic, Evidence, Decision Analysis - 100% Complete
- Persistence Layer: SQLite with write-through caching - 100% Complete
- Metacognition: Self-evaluation, Bias detection - 100% Complete
- Data Safety: Full persistence across server restarts
Latest Update (October 2025):
- ā Complete SQLite persistence implementation
- ā All thoughts, branches, insights, validations, and relationships persist
- ā Write-through caching for optimal performance
- ā FTS5 full-text search
- ā Production-ready with comprehensive error handling
Version
Version 1.1.0 - Complete persistence layer with SQLite support