⚡ Optimized for Claude Sonnet 4 - This MCP server works best with Claude Sonnet 4 for optimal performance and AI-powered features.
An enhanced MCP (Model Context Protocol) server for intelligent memory and task management, designed for AI assistants and development workflows. Features semantic search, automatic task extraction, knowledge graphs, and comprehensive project management.
enhanced-mcp-memory/
├── mcp_server_enhanced.py # Main MCP server with FastMCP integration
├── memory_manager.py # Core memory/task logic and project detection
├── sequential_thinking.py # Thinking chains and context optimization
├── database.py # Database operations with retry mechanisms
├── requirements.txt # Python dependencies
├── setup.py # Package configuration
├── data/ # SQLite database storage
├── logs/ # Application logs
# Install and run with uvx
uvx enhanced-mcp-memory
# Clone and install
git clone https://github.com/cbunting99/enhanced-mcp-memory.git
cd enhanced-mcp-memory
pip install -e .
# Run the server
enhanced-mcp-memory
# Clone repository
git clone https://github.com/cbunting99/enhanced-mcp-memory.git
cd enhanced-mcp-memory
# Install dependencies
pip install -r requirements.txt
# Run directly
python mcp_server_enhanced.py
Add to your MCP client configuration:
{
"mcpServers": {
"memory-manager": {
"command": "uvx",
"args": ["enhanced-mcp-memory"],
"env": {
"LOG_LEVEL": "INFO",
"MAX_MEMORY_ITEMS": "1000",
"ENABLE_AUTO_CLEANUP": "true"
}
}
}
}
{
"mcpServers": {
"memory-manager": {
"command": "python",
"args": ["mcp_server_enhanced.py"],
"cwd": "/path/to/enhanced-mcp-memory",
"env": {
"LOG_LEVEL": "INFO",
"MAX_MEMORY_ITEMS": "1000",
"ENABLE_AUTO_CLEANUP": "true"
}
}
}
}
get_memory_context(query) - Get relevant memories and contextcreate_task(title, description, priority, category) - Create new tasksget_tasks(status, limit) - Retrieve tasks with filteringget_project_summary() - Get comprehensive project overviewstart_thinking_chain(objective) - Begin structured reasoning processadd_thinking_step(chain_id, stage, title, content, reasoning) - Add reasoning stepsget_thinking_chain(chain_id) - Retrieve complete thinking chainlist_thinking_chains(limit) - List recent thinking chainscreate_context_summary(content, key_points, decisions, actions) - Compress context for token optimizationstart_new_chat_session(title, objective, continue_from) - Begin new conversation with optional continuationconsolidate_current_session() - Compress current session for handoffget_optimized_context(max_tokens) - Get token-optimized contextestimate_token_usage(text) - Estimate token count for planningauto_process_conversation(content, interaction_type) - Extract memories and tasks automaticallydecompose_task(prompt) - Break complex tasks into subtasksauto_learn_project_conventions(project_path) - Automatically detect and learn project patternsget_project_conventions_summary() - Get formatted summary of learned conventionssuggest_correct_command(user_command) - Suggest project-appropriate command correctionsremember_project_pattern(pattern_type, pattern, description) - Manually store project patternsupdate_memory_context() - Refresh memory context with latest project conventionshealth_check() - Check server health and connectivityget_performance_stats() - Get detailed performance metricscleanup_old_data(days_old) - Clean up old memories and tasksoptimize_memories() - Remove duplicates and optimize storageget_database_stats() - Get comprehensive database statisticsThe Enhanced MCP Memory Server automatically learns and remembers project-specific conventions to prevent AI assistants from suggesting incorrect commands or approaches:
# Instead of generic commands, suggests project-specific ones:
User types: "node server.js"
AI suggests: "Use 'npm run dev' instead for this project"
User types: "python main.py"
AI suggests: "Use 'uvicorn main:app --reload' for this FastAPI project"
cmd.exe and Windows-appropriate path separatorsdir instead of ls)All learned conventions are stored as high-importance memories that: - Appear in AI context for every interaction - Persist across sessions and project switches - Include environment warnings and project-specific guidance - Prevent repeated incorrect command suggestions
Configure via environment variables:
| Variable | Default | Description |
|---|---|---|
LOG_LEVEL |
INFO |
Logging level (DEBUG, INFO, WARNING, ERROR) |
MAX_MEMORY_ITEMS |
1000 |
Maximum memories per project |
MAX_CONTEXT_TOKENS |
8000 |
Token threshold for auto-compression |
CLEANUP_INTERVAL_HOURS |
24 |
Auto-cleanup interval |
ENABLE_AUTO_CLEANUP |
true |
Enable automatic cleanup |
MAX_CONCURRENT_REQUESTS |
5 |
Max concurrent requests |
REQUEST_TIMEOUT |
30 |
Request timeout in seconds |
DATA_DIR |
~/ClaudeMemory | Where to store data and logs |
This package is production-ready and does not include a test suite in the distributed version. For development or CI, refer to the repository for test scripts and additional resources.
The server includes built-in performance tracking:
Access via the get_performance_stats() and health_check() tools.
Default location: ./data/mcp_memory.db
Powered by sentence-transformers for intelligent memory retrieval:
Structured reasoning system:
Advanced context optimization for high-scale deployments:
Comprehensive logging system:
./logs/ directoryMIT License - see LICENSE file for details.
$ claude mcp add enhanced-mcp-memory \
-- python -m otcore.mcp_server <graph>