This guide explains how to configure the unified-thinking MCP server using environment variables, configuration files, and feature flags.
- Quick Start
- Configuration Sources
- Server Settings
- Storage Settings
- Feature Flags
- Performance Settings
- Logging Settings
- Environment Variables
- Configuration File
- Examples
The server works out-of-the-box with sensible defaults. No configuration is required to get started.
# Run with defaults
./unified-thinking
# Override specific settings with environment variables
UT_LOGGING_LEVEL=debug ./unified-thinking
# Load from configuration file
./unified-thinking --config=config.jsonConfiguration is loaded in the following order of precedence (highest to lowest):
- Environment Variables (highest priority) - Overrides everything
- Configuration File (if provided) - Overrides defaults
- Default Values (lowest priority) - Built-in sensible defaults
This allows you to use a configuration file for most settings and override specific values with environment variables for deployment-specific configuration.
Description: Name of the server instance (for logging and identification)
Default: "unified-thinking"
Environment Variable: UT_SERVER_NAME
Example:
export UT_SERVER_NAME="my-thinking-server"Description: Version of the server
Default: "1.0.0"
Environment Variable: UT_SERVER_VERSION
Description: Deployment environment
Default: "development"
Valid Values: development, staging, production
Environment Variable: UT_SERVER_ENVIRONMENT
Example:
export UT_SERVER_ENVIRONMENT="production"Description: Type of storage backend
Default: "sqlite"
Valid Values: sqlite, memory
Environment Variable: STORAGE_TYPE (Claude Desktop) or UT_STORAGE_TYPE (standalone)
Note: SQLite is the recommended and default storage type. It provides persistence and is required for full functionality including knowledge graph and trajectory storage.
Example:
export STORAGE_TYPE=sqlite
export SQLITE_PATH=./data/thoughts.dbDescription: Maximum number of thoughts to store (0 = unlimited)
Default: 0
Environment Variable: UT_STORAGE_MAX_THOUGHTS
Example:
export UT_STORAGE_MAX_THOUGHTS=10000Description: Maximum number of branches to store (0 = unlimited)
Default: 0
Environment Variable: UT_STORAGE_MAX_BRANCHES
Description: Enable content indexing for faster search
Default: true
Environment Variable: UT_STORAGE_ENABLE_INDEXING
Example:
export UT_STORAGE_ENABLE_INDEXING=falseDescription: Path to SQLite database file (created if not exists)
Default: "./data/thoughts.db"
Environment Variable: SQLITE_PATH
Example:
export SQLITE_PATH="C:\\Users\\YourName\\AppData\\Roaming\\Claude\\unified-thinking.db"Description: Connection timeout in milliseconds
Default: 5000
Environment Variable: SQLITE_TIMEOUT
Example:
export SQLITE_TIMEOUT=10000Note: The server uses fail-fast behavior. If the configured storage backend fails to initialize, the server will terminate immediately rather than falling back to an alternative storage type.
Feature flags allow you to enable or disable specific capabilities. All features are enabled by default.
| Feature | Environment Variable | Default | Description |
|---|---|---|---|
linear_mode |
UT_FEATURES_LINEAR_MODE |
true |
Sequential logical thinking |
tree_mode |
UT_FEATURES_TREE_MODE |
true |
Branching exploration thinking |
divergent_mode |
UT_FEATURES_DIVERGENT_MODE |
true |
Creative divergent thinking |
auto_mode |
UT_FEATURES_AUTO_MODE |
true |
Automatic mode selection |
| Feature | Environment Variable | Default | Description |
|---|---|---|---|
logical_validation |
UT_FEATURES_LOGICAL_VALIDATION |
true |
Validate logical consistency |
proof_generation |
UT_FEATURES_PROOF_GENERATION |
true |
Generate logical proofs |
syntax_checking |
UT_FEATURES_SYNTAX_CHECKING |
true |
Check logical syntax |
| Feature | Environment Variable | Default | Description |
|---|---|---|---|
probabilistic_reasoning |
UT_FEATURES_PROBABILISTIC_REASONING |
true |
Bayesian inference |
decision_making |
UT_FEATURES_DECISION_MAKING |
true |
Multi-criteria decisions |
problem_decomposition |
UT_FEATURES_PROBLEM_DECOMPOSITION |
true |
Break down complex problems |
| Feature | Environment Variable | Default | Description |
|---|---|---|---|
evidence_assessment |
UT_FEATURES_EVIDENCE_ASSESSMENT |
true |
Assess evidence quality |
contradiction_detection |
UT_FEATURES_CONTRADICTION_DETECTION |
true |
Detect contradictions |
sensitivity_analysis |
UT_FEATURES_SENSITIVITY_ANALYSIS |
true |
Test assumption robustness |
| Feature | Environment Variable | Default | Description |
|---|---|---|---|
self_evaluation |
UT_FEATURES_SELF_EVALUATION |
true |
Self-assess reasoning quality |
bias_detection |
UT_FEATURES_BIAS_DETECTION |
true |
Identify cognitive biases |
| Feature | Environment Variable | Default | Description |
|---|---|---|---|
search_enabled |
UT_FEATURES_SEARCH_ENABLED |
true |
Enable search functionality |
history_enabled |
UT_FEATURES_HISTORY_ENABLED |
true |
Enable history tracking |
metrics_enabled |
UT_FEATURES_METRICS_ENABLED |
true |
Enable metrics collection |
# Disable probabilistic reasoning
export UT_FEATURES_PROBABILISTIC_REASONING=false
# Disable bias detection
export UT_FEATURES_BIAS_DETECTION=falseDescription: Maximum number of thoughts processed concurrently
Default: 100
Environment Variable: UT_PERFORMANCE_MAX_CONCURRENT_THOUGHTS
Example:
export UT_PERFORMANCE_MAX_CONCURRENT_THOUGHTS=50Description: Enable deep copying for thread safety (recommended to keep enabled)
Default: true
Environment Variable: UT_PERFORMANCE_ENABLE_DEEP_COPY
Description: Size of internal caches (0 = no caching)
Default: 1000
Environment Variable: UT_PERFORMANCE_CACHE_SIZE
Description: Logging verbosity level
Default: "info"
Valid Values: debug, info, warn, error
Environment Variable: UT_LOGGING_LEVEL
Example:
export UT_LOGGING_LEVEL=debugDescription: Log output format
Default: "text"
Valid Values: text, json
Environment Variable: UT_LOGGING_FORMAT
Example:
export UT_LOGGING_FORMAT=jsonDescription: Include timestamps in log entries
Default: true
Environment Variable: UT_LOGGING_ENABLE_TIMESTAMPS
All environment variables follow the naming convention: UT_<SECTION>_<KEY>
Boolean environment variables accept various formats:
- True:
true,TRUE,1,yes,YES,on,ON,enabled,ENABLED - False:
false,FALSE,0,no,NO,off,OFF,disabled,DISABLED, or empty
# Server
UT_SERVER_NAME=unified-thinking
UT_SERVER_VERSION=1.0.0
UT_SERVER_ENVIRONMENT=development
# Storage
UT_STORAGE_TYPE=sqlite
UT_STORAGE_MAX_THOUGHTS=0
UT_STORAGE_MAX_BRANCHES=0
UT_STORAGE_ENABLE_INDEXING=true
# Features - Core Modes
UT_FEATURES_LINEAR_MODE=true
UT_FEATURES_TREE_MODE=true
UT_FEATURES_DIVERGENT_MODE=true
UT_FEATURES_AUTO_MODE=true
# Features - Validation
UT_FEATURES_LOGICAL_VALIDATION=true
UT_FEATURES_PROOF_GENERATION=true
UT_FEATURES_SYNTAX_CHECKING=true
# Features - Advanced Reasoning
UT_FEATURES_PROBABILISTIC_REASONING=true
UT_FEATURES_DECISION_MAKING=true
UT_FEATURES_PROBLEM_DECOMPOSITION=true
# Features - Analysis
UT_FEATURES_EVIDENCE_ASSESSMENT=true
UT_FEATURES_CONTRADICTION_DETECTION=true
UT_FEATURES_SENSITIVITY_ANALYSIS=true
# Features - Metacognition
UT_FEATURES_SELF_EVALUATION=true
UT_FEATURES_BIAS_DETECTION=true
# Features - Utilities
UT_FEATURES_SEARCH_ENABLED=true
UT_FEATURES_HISTORY_ENABLED=true
UT_FEATURES_METRICS_ENABLED=true
# Performance
UT_PERFORMANCE_MAX_CONCURRENT_THOUGHTS=100
UT_PERFORMANCE_ENABLE_DEEP_COPY=true
UT_PERFORMANCE_CACHE_SIZE=1000
# Logging
UT_LOGGING_LEVEL=info
UT_LOGGING_FORMAT=text
UT_LOGGING_ENABLE_TIMESTAMPS=trueCreate a JSON configuration file to set multiple options at once:
{
"server": {
"name": "unified-thinking",
"version": "1.0.0",
"environment": "production"
},
"storage": {
"type": "sqlite",
"max_thoughts": 50000,
"max_branches": 1000,
"enable_indexing": true
},
"features": {
"linear_mode": true,
"tree_mode": true,
"divergent_mode": true,
"auto_mode": true,
"logical_validation": true,
"proof_generation": true,
"syntax_checking": true,
"probabilistic_reasoning": true,
"decision_making": true,
"problem_decomposition": true,
"evidence_assessment": true,
"contradiction_detection": true,
"sensitivity_analysis": true,
"self_evaluation": true,
"bias_detection": true,
"search_enabled": true,
"history_enabled": true,
"metrics_enabled": true
},
"performance": {
"max_concurrent_thoughts": 100,
"enable_deep_copy": true,
"cache_size": 1000
},
"logging": {
"level": "info",
"format": "text",
"enable_timestamps": true
}
}# Load from config file
./unified-thinking --config=config.json
# Override specific values with environment variables
UT_LOGGING_LEVEL=debug ./unified-thinking --config=config.json# Verbose logging for development
export UT_SERVER_ENVIRONMENT=development
export UT_LOGGING_LEVEL=debug
export UT_LOGGING_FORMAT=text
./unified-thinking{
"mcpServers": {
"unified-thinking": {
"command": "C:\\path\\to\\bin\\unified-thinking.exe",
"transport": "stdio",
"env": {
"DEBUG": "false",
"STORAGE_TYPE": "sqlite",
"SQLITE_PATH": "C:\\ProgramData\\unified-thinking\\thoughts.db",
"AUTO_VALIDATION_THRESHOLD": "0.5"
}
}
}
}{
"server": {
"name": "prod-thinking-server",
"environment": "production"
},
"storage": {
"type": "sqlite",
"max_thoughts": 100000,
"max_branches": 5000
},
"performance": {
"max_concurrent_thoughts": 200,
"cache_size": 5000
},
"logging": {
"level": "warn",
"format": "json",
"enable_timestamps": true
}
}If you only need basic thinking without advanced features:
# Enable only core features
export UT_FEATURES_LINEAR_MODE=true
export UT_FEATURES_TREE_MODE=true
export UT_FEATURES_DIVERGENT_MODE=false
export UT_FEATURES_AUTO_MODE=true
# Disable advanced reasoning
export UT_FEATURES_PROBABILISTIC_REASONING=false
export UT_FEATURES_DECISION_MAKING=false
export UT_FEATURES_PROBLEM_DECOMPOSITION=false
# Disable analysis features
export UT_FEATURES_EVIDENCE_ASSESSMENT=false
export UT_FEATURES_CONTRADICTION_DETECTION=false
export UT_FEATURES_SENSITIVITY_ANALYSIS=false
# Disable metacognition
export UT_FEATURES_SELF_EVALUATION=false
export UT_FEATURES_BIAS_DETECTION=false
./unified-thinkingFor high-throughput scenarios:
# Increase concurrency
export UT_PERFORMANCE_MAX_CONCURRENT_THOUGHTS=500
# Increase cache size
export UT_PERFORMANCE_CACHE_SIZE=10000
# Disable storage limits
export UT_STORAGE_MAX_THOUGHTS=0
export UT_STORAGE_MAX_BRANCHES=0
./unified-thinking# Enable all features for testing
export UT_SERVER_ENVIRONMENT=development
export UT_LOGGING_LEVEL=debug
# Set limits for test data
export UT_STORAGE_MAX_THOUGHTS=1000
export UT_STORAGE_MAX_BRANCHES=100
./unified-thinkingThe configuration system validates all settings on startup. If validation fails, the server will not start and will display an error message explaining the issue.
Common validation errors:
- Empty server name
- Invalid environment (must be development, staging, or production)
- Invalid storage type (must be sqlite or memory)
- Negative values for max_thoughts, max_branches, or cache_size
- max_concurrent_thoughts less than 1
- Invalid log level or format
From within the Go code, you can access configuration:
import "unified-thinking/internal/config"
// Load configuration
cfg, err := config.Load()
if err != nil {
log.Fatal(err)
}
// Check feature flags
if cfg.IsFeatureEnabled("probabilistic_reasoning") {
// Feature is enabled
}
// Access settings
maxThoughts := cfg.Storage.MaxThoughts
logLevel := cfg.Logging.Level- Use defaults for development - The defaults are designed for local development
- Use configuration files for deployment - Easier to manage multiple settings
- Use environment variables for secrets - Never commit sensitive data to config files
- Enable all features initially - Disable features only if needed for specific use cases
- Monitor performance - Adjust
max_concurrent_thoughtsandcache_sizebased on load - Use structured logging in production - Set
logging.format=jsonfor production environments - Set appropriate storage limits - Prevent unbounded memory growth in long-running servers
Check validation errors in the startup logs. Common issues:
- Invalid environment variable format
- Missing required settings
- Incompatible feature combinations
- Increase
performance.max_concurrent_thoughtsfor high concurrency - Increase
performance.cache_sizefor better performance - Enable
storage.enable_indexingfor faster searches
- Set
storage.max_thoughtsandstorage.max_brancheslimits - Reduce
performance.cache_size - Disable unused features
- Check
logging.levelis set correctly - Verify
logging.formatmatches your log aggregation system - Ensure
logging.enable_timestampsis enabled if required
Last Updated: 2025-10-07 Version: 1.1.0
- Added SQLite storage backend support
- Added
STORAGE_TYPE,SQLITE_PATH,SQLITE_TIMEOUTenvironment variables - Added
AUTO_VALIDATION_THRESHOLDfor confidence-based auto-validation - Updated examples to show SQLite configuration
- All storage backends now support FTS5 full-text search
- Removed
STORAGE_FALLBACKenvironment variable (now uses fail-fast behavior) - Server terminates immediately if configured storage backend fails to initialize
- No silent fallback to alternative storage types