Supports knowledge export in Markdown format for human-readable documentation of learned patterns, insights, and performance analytics
MCP Self-Learning Server
A sophisticated Model Context Protocol (MCP) server that autonomously learns from interactions, optimizes performance, and continuously improves its knowledge base through pattern recognition and machine learning techniques.
🌟 Features
🧠 Autonomous Learning Engine
- Pattern Recognition: Automatically identifies and learns from interaction patterns
- Feature Extraction: Analyzes tool sequences, context, performance metrics, and semantic embeddings
- Confidence Scoring: Evaluates pattern reliability based on frequency, recency, and consistency
- Memory Consolidation: Manages short-term and long-term pattern storage
🔄 Knowledge Synchronization
- Auto-sync: Every 60 seconds between MCP servers
- Knowledge Export/Import: JSON and Markdown formats
- Pattern Merging: With deduplication
- Cross-server Learning: Through shared knowledge directory
📊 Self-Improvement Capabilities
- Performance Optimization: Identifies redundancies and bottlenecks
- Predictive Suggestions: Anticipates next actions based on learned patterns
- Error Pattern Analysis: Learns from failures to improve success rates
- Adaptive Recommendations: Generates context-aware optimizations
💾 Data Persistence
- Automatic Data Saving: Every 5 minutes with backup rotation
- Learning Data Recovery: Loads previous sessions on startup
- Export Knowledge: Multiple formats (JSON, Markdown)
- Backup System: Automatic backup creation before saves
📝 Advanced Logging
- Multi-level Logging: Debug, Info, Warn, Error with colors and emojis
- File & Console Output: Simultaneous logging to both
- Log Rotation: Prevents disk space issues
- Performance Monitoring: Tool execution times and memory usage
🚀 Quick Start
Prerequisites
- Node.js 18+
- npm or yarn
Installation
- Clone/Download the Project
- Install Dependencies
- Configure Claude DesktopAdd to
~/.config/Claude/claude_desktop_config.json
: - Start the Server
📋 Available Commands
Development & Testing
Monitoring & Health
Manual Operations
🛠️ Available MCP Tools
Core Learning Tools
analyze_pattern
Analyze and learn from interaction patterns
get_insights
Get current learning analytics and insights
trigger_learning
Manually trigger a learning cycle
Knowledge Management
export_knowledge
Export learned knowledge to file
import_knowledge
Import knowledge from external source
Performance & Optimization
optimize_tool
Get optimization suggestions for specific tools
predict_next_action
Get predictive suggestions based on current context
get_performance_metrics
Get detailed performance analytics
📊 Monitoring & Analytics
Health Check Results
The health check tool verifies:
- ✅ Server startup functionality
- ✅ Data persistence system
- ✅ Logging system
- ✅ Performance metrics (startup time)
Real-time Monitoring
The monitor displays:
- Learning engine status (patterns, knowledge, cycles)
- Log file metrics and activity
- System resource usage
- Change indicators showing growth over time
Performance Expectations
Metric | Target | Excellent |
---|---|---|
Startup Time | <5s | <1s |
Memory Usage | <100MB | <50MB |
Response Time | <500ms | <100ms |
Learning Accuracy | >70% | >90% |
🗂️ Directory Structure
🔧 Configuration
Environment Variables
Variable | Default | Description |
---|---|---|
NODE_ENV | production | Environment mode |
LOG_LEVEL | info | Logging level (debug/info/warn/error) |
LOG_CONSOLE | true | Enable console logging |
LOG_FILE | true | Enable file logging |
LEARNING_MODE | autonomous | Learning behavior mode |
Learning Engine Settings
- Max Memory Size: 1000 patterns in memory
- Auto-save Interval: 5 minutes
- Pattern Confidence Threshold: 0.5
- Learning Trigger: Every 100 interactions or 50 tool uses
🚨 Troubleshooting
Common Issues
- Server Won't Start
- Check Node.js version (18+ required)
- Verify all dependencies installed:
npm install
- Check file permissions
- Data Not Persisting
- Verify
data/
directory permissions - Check disk space
- Review logs for errors:
tail -f logs/mcp-server.log
- Verify
- High Memory Usage
- Run health check:
npm run health
- Check pattern count:
npm run monitor
- Consider reducing max memory size
- Run health check:
- Slow Performance
- Enable performance logging:
npm run debug
- Check system resources
- Review learning cycle frequency
- Enable performance logging:
Log Analysis
📈 Expected Learning Outcomes
Immediate (0-100 interactions)
- Basic pattern recognition active
- Initial knowledge base building
- Tool usage tracking enabled
Short-term (100-1000 interactions)
- Pattern confidence scores stabilizing
- First optimization recommendations
- Predictive accuracy ~50%
Long-term (1000+ interactions)
- Predictive accuracy >70%
- Response time improvements ~30%
- Comprehensive knowledge graph
- Cross-server knowledge sharing
- Self-documenting insights
🤝 Integration with Claude
Once configured, the server provides these tools in Claude:
- Pattern analysis for learning from conversations
- Performance insights for optimization
- Predictive suggestions for improved responses
- Knowledge export for documentation
- Real-time learning from every interaction
📝 License
ISC License
🆘 Support
For issues or questions:
- Run health check:
npm run health
- Check logs:
tail -f logs/mcp-server.log
- Review this documentation
- Check server status:
npm run monitor
Built with ❤️ for autonomous learning and continuous improvement
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Tools
Enables autonomous learning from interactions through pattern recognition and machine learning techniques. Continuously improves performance by analyzing tool usage, providing predictive suggestions, and sharing knowledge across MCP servers.
Related MCP Servers
- -securityAlicense-qualityAn MCP server implementation that standardizes how AI applications access tools and context, providing a central hub that manages tool discovery, execution, and context management with a simplified configuration system.Last updated -13MIT License
- -securityFlicense-qualityA MCP server that allows AI assistants to interact with the browser, including getting page content as markdown, modifying page styles, and searching browser history.Last updated -82
- -securityAlicense-qualityA collection of custom MCP servers providing various AI-powered capabilities including web search, YouTube video analysis, GitHub repository analysis, reasoning, code generation/execution, and web crawling.Last updated -2MIT License
- -securityFlicense-qualityAdvanced machine learning platform with MCP integration that enables automated ML workflows from data analysis to model deployment, featuring smart preprocessing, 15+ ML algorithms, and interactive visualizations.Last updated -