MCP Brain Context Manager
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Brain Context Manager search my memories for past fixes to API rate limit errors"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
π§ MCP Context Manager with Brain-Enhanced Memory
A sophisticated Model Context Protocol (MCP) server that provides human brain-like memory management for AI agents. Features multilayered memory architecture, neural-style interconnections, and intelligent knowledge growth.
π― What This Solves
Context Loss: AI agents forgetting previous conversations and learned patterns
Knowledge Fragmentation: Scattered information across different sessions
Pattern Recognition: Missing connections between similar problems and solutions
Learning Efficiency: Inability to build upon past experiences and insights
Knowledge Management: No systematic way to organize and retrieve relevant context
Related MCP server: Memory Nexus MCP
β Key Features
π§ Brain-Like Memory System
Multilayered Architecture: Short-term, long-term, episodic, procedural, and semantic memory
Neural Connections: Automatic relationship discovery between memories
Memory Promotion: Frequently used knowledge becomes more accessible
Analogical Reasoning: Find similar solutions from different contexts
π Intelligent Connections
6 Connection Types: Semantic, temporal, causal, contextual, functional, analogical
Auto-Discovery: Finds relationships between memories automatically
Knowledge Graphs: Visualize how concepts interconnect
Learning Paths: Trace knowledge flow between concepts
π Advanced Features
MCP Protocol Compliant: Full compatibility with Cursor and other MCP clients
Performance Monitoring: Built-in analytics and optimization
Project Isolation: Separate memory contexts by project
Semantic Search: Vector-based similarity matching
Context Injection: Automatic relevant memory retrieval
π Quick Start
1. Installation
git clone https://github.com/yourusername/mcp-context-manager-python.git
cd mcp-context-manager-python
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt2. Automated Setup (Recommended)
# Run the automated setup script
python scripts/setup_cursor_brain_mcp.pyThis will:
β Test all components
β Create MCP configuration
β Install Cursor integration
β Set up startup scripts
3. Manual Setup
Start the Brain-Enhanced Server
# With brain features (recommended)
python src/brain_enhanced_mcp_server.py
# Or simple server (basic features only)
python src/simple_mcp_server.pyTest the Server
python test_brain_mcp.pyConfigure Your MCP Client
Add this to your MCP client configuration:
{
"mcpServers": {
"mcp-brain-context-manager": {
"command": "python",
"args": ["src/brain_enhanced_mcp_server.py"],
"cwd": "/path/to/mcp-context-manager-python",
"env": {
"MCP_PROJECT_ID": "your-project",
"MCP_LOG_LEVEL": "INFO"
}
}
}
}π οΈ Usage Examples
Basic Memory Operations
# Store memories (automatically enhanced with brain features)
await mcp_server.push_memory({
"content": "React useEffect handles side effects in functional components",
"memory_type": "fact",
"tags": ["react", "hooks", "javascript"],
"project_id": "my-web-app"
})
# Retrieve memories with semantic search
result = await mcp_server.fetch_memory({
"query": "React performance optimization",
"project_id": "my-web-app"
})Brain-Enhanced Operations
π Similar Experience Search
# Find analogous past experiences
result = await mcp_server.search_similar_experiences({
"query": "API rate limiting errors",
"focus_areas": ["Error Handling", "APIs", "Performance"],
"include_analogies": True
})πΈοΈ Knowledge Graph
# Build knowledge maps
graph = await mcp_server.get_knowledge_graph({
"center_topic": "Database Optimization",
"max_depth": 3
})π€οΈ Knowledge Path Tracing
# Discover learning paths
path = await mcp_server.trace_knowledge_path({
"from_concept": "Basic SQL",
"to_concept": "Advanced Query Optimization"
})π Memory Insights
# Analyze knowledge patterns
insights = await mcp_server.get_memory_insights({
"project_id": "my-project",
"include_recommendations": True
})ποΈ Architecture
mcp-context-manager-python/
βββ π― Core Components
β βββ src/
β β βββ brain_enhanced_mcp_server.py # Main brain-enhanced server
β β βββ brain_memory_system.py # Multilayered memory system
β β βββ brain_integration.py # Integration layer
β β βββ simple_mcp_server.py # Basic MCP server
β β βββ performance_monitor.py # Performance tracking
β βββ mcp_memory_server/ # Full-featured server components
β βββ core/ # Core services
β βββ models/ # Data models
β βββ api/ # API endpoints
β
βββ π§ͺ Testing & Examples
β βββ tests/ # Comprehensive test suite
β βββ examples/ # Usage examples
β βββ test_brain_mcp.py # Quick server test
β
βββ π§ Configuration & Scripts
β βββ scripts/ # Setup and utility scripts
β βββ config.py # Main configuration
β βββ cursor_mcp_config.json # MCP client configuration
β
βββ π Documentation
β βββ guides/ # Detailed guides and documentation
β βββ BRAIN_MEMORY_SYSTEM_GUIDE.md # Comprehensive user guide
β βββ BRAIN_ARCHITECTURE_SUMMARY.md # Technical architecture
β βββ QUICK_CURSOR_SETUP.md # Quick setup guide
β
βββ πΎ Data & Logs
βββ data/ # Database files
βββ logs/ # Application logsπ§ Brain Memory System
Memory Layers
Short-term: Working memory for temporary information (β€50 items)
Long-term: Persistent knowledge and facts
Episodic: Specific events and experiences ("I learned X while doing Y")
Procedural: Skills and learned patterns ("How to debug React performance")
Semantic: Conceptual knowledge and relationships
Connection Types
Semantic: Related concepts (
useStateβuseReducer)Temporal: Time-based sequences (
Step 1βStep 2)Causal: Cause-effect relationships (
Performance issueβSolution)Contextual: Same project/context
Functional: Similar tools/techniques
Analogical: Similar patterns across domains
Example Memory Insights
π Memory System Analysis
Memory Layer Distribution:
β’ Long-term: 45 memories
β’ Procedural: 23 memories
β’ Episodic: 15 memories
β’ Short-term: 8 memories
Connection Patterns:
β’ Semantic: 45 connections (related concepts)
β’ Contextual: 32 connections (same projects)
β’ Functional: 15 connections (similar techniques)
π‘ Recommendations:
β’ Strong React knowledge - consider creating procedural guides
β’ Review dormant Python memories for valuable insights
β’ Consider consolidating short-term memoriesπ¨ Available Tools
Core MCP Tools
Tool | Description | Key Parameters |
| Store memory with brain enhancement |
|
| Retrieve with brain-enhanced search |
|
| Generate context with brain insights |
|
Brain-Enhanced Tools
Tool | Description | Key Parameters |
| Find analogous past experiences |
|
| Build interconnected knowledge maps |
|
| Analyze knowledge patterns |
|
| Discover learning paths |
|
| Boost important memories |
|
β‘ Performance & Scalability
Semantic Search: Vector embeddings with similarity thresholds
Connection Pruning: Automatic cleanup of weak relationships
Memory Limits: Configurable limits per memory layer
Batch Operations: Efficient bulk processing
Performance Monitoring: Built-in analytics and recommendations
π§ Configuration
Environment Variables
# Core settings
MCP_PROJECT_ID=your-project-name
MCP_LOG_LEVEL=INFO
MCP_PERFORMANCE_MONITORING=true
# Brain system settings
BRAIN_SHORT_TERM_LIMIT=50
BRAIN_SIMILARITY_THRESHOLD=0.7
BRAIN_CONNECTION_STRENGTH_THRESHOLD=0.3Advanced Configuration
# Customize brain system parameters
brain_system.config.update({
"short_term_limit": 30,
"similarity_threshold": 0.8,
"memory_promotion_threshold": 5,
"consolidation_threshold": 10
})
# Add custom hierarchies
brain_system.topic_hierarchy["YourDomain"] = [
"Subdomain1", "Subdomain2", "Subdomain3"
]π§ͺ Testing
Run All Tests
python -m pytest tests/Quick Server Test
python test_brain_mcp.pyComprehensive Test
python tests/comprehensive_test.pyPerformance Test
python tests/test_performance_monitoring.pyπ€ Contributing
We welcome contributions from developers of all skill levels! This project thrives on community collaboration.
π Quick Start for Contributors
# Fork and clone the repository
git clone https://github.com/yourusername/mcp-context-manager-python.git
cd mcp-context-manager-python
# Set up development environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -r requirements.txt
# Run development setup
python scripts/setup_dev.py
# Test your setup
python test_brain_mcp.pyπ Contribution Process
π΄ Fork the repository
πΏ Create a feature branch:
git checkout -b feature/amazing-featureβοΈ Make your changes with tests and documentation
β Run the test suite:
python -m pytest tests/π Update documentation as needed
π Submit a Pull Request with a clear description
π― Areas for Contribution
π§ Brain System Enhancements
New Memory Connection Types: Emotional, spatial, hierarchical connections
Advanced Memory Algorithms: Consolidation, decay, forgetting mechanisms
Knowledge Transfer: Cross-project memory sharing
Memory Classification: Improved categorization and tagging
π¨ Visualization & UI
Web-based Knowledge Graph: Interactive memory exploration
Real-time Analytics Dashboard: Live memory system insights
Memory Timeline: Historical view of knowledge growth
Learning Path Visualizations: Visual knowledge flow diagrams
π Integrations & Extensions
VS Code Extension: Native IDE integration
JetBrains Plugins: IntelliJ, PyCharm support
Obsidian/Roam Connectors: Knowledge base integration
Slack/Discord Bots: Team collaboration features
π Analytics & Insights
Advanced Pattern Analysis: Memory usage analytics
Learning Recommendations: Personalized knowledge suggestions
Knowledge Gap Detection: Identify missing knowledge areas
Performance Optimization: Memory system tuning
π Accessibility & Internationalization
Multi-language Support: Localized memory content
Accessibility Improvements: Screen reader support, keyboard navigation
Documentation Translations: Help translate guides and docs
Cultural Context: Domain-specific memory hierarchies
β‘ Performance & Scalability
Database Optimization: Query performance improvements
Distributed Systems: Multi-node memory sharing
Caching Strategies: Memory access optimization
Cloud Deployment: AWS, GCP, Azure support
π·οΈ Issue Labels
We use these labels to help contributors find suitable tasks:
good first issue- Perfect for new contributorshelp wanted- Looking for contributorsbrain-system- Brain memory system featuresvisualization- UI and visualization workintegration- External system integrationsperformance- Performance optimizationdocumentation- Documentation improvementstesting- Test coverage and quality
π Resources for Contributors
Contributing Guide - Complete contribution guidelines
Brain Memory System Guide - Understanding the core system
Quick Setup Guide - Development environment setup
Architecture Summary - Technical architecture overview
π Recognition & Rewards
First Contribution Badge: Special recognition for first-time contributors
README Credits: All contributors listed in acknowledgments
Release Notes: Major contributions highlighted in releases
Maintainer Invitation: Active contributors invited to be maintainers
π€ Community Support
GitHub Discussions: Ask questions and share ideas
Code Reviews: Get feedback on your contributions
Pair Programming: Arrange coding sessions with maintainers
Mentorship: Get guidance from experienced contributors
Ready to contribute? Pick an issue, fork the repo, and let's build the future of AI memory together! π§ β¨
π Roadmap
Near Term
Web-based knowledge graph visualization
Export/import knowledge structures
Multi-user collaboration features
Enhanced embedding models
Medium Term
LLM integration for memory summarization
Domain-specific memory hierarchies
Real-time collaboration
Advanced analytics dashboard
Long Term
Distributed memory systems
Cross-project knowledge sharing
AI-powered memory curation
Enterprise deployment options
π¨ Troubleshooting
Common Issues
Server Won't Start
# Check Python version
python --version # Should be 3.10+
# Test imports
python -c "from src.brain_enhanced_mcp_server import BrainEnhancedMCPServer"
# Check logs
tail -f logs/mcp_server.logMCP Connection Issues
Restart your MCP client completely
Verify configuration paths are correct
Check that Python virtual environment is activated
Review client-specific MCP setup guides
Performance Issues
# Check performance metrics
python -c "
from src.performance_monitor import PerformanceMonitor
monitor = PerformanceMonitor('data/mcp_performance.db')
print(monitor.get_performance_report())
"Memory Search Not Working
Ensure embeddings are generated (check logs)
Verify similarity thresholds in configuration
Test with different query terms
Getting Help
π Read the comprehensive guide
π§ Check the setup guide
ποΈ Review the architecture summary
π Check existing issues
π¬ Start a discussion
π Report new issues
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments
Model Context Protocol - For the excellent protocol specification
Anthropic - For Claude and MCP development
Cursor - For MCP integration and development tools
Community Contributors - For feedback, testing, and improvements
π Project Status
β Core Functionality: Complete and stable
β Brain Features: Fully implemented and tested
β MCP Compliance: Full protocol support
β Documentation: Comprehensive guides available
β Testing: Extensive test coverage
π Production Ready: Stable and performant
Transform your AI agent from a simple chatbot into an intelligent partner with human-like memory and reasoning capabilities. π§ β¨
Built with β€οΈ for the AI development community
Available Tools
16 toolsauto_inject_contextC
Automatically inject context for new conversation sessions
Inputs: project_id, max_memories, include_recent, use_ai_crafting, +1 more.
craft_ai_promptC
Craft an intelligent AI prompt using context summary and user input
Inputs: project_id (required), focus_areas, prompt_type, user_message.
fetch_memoryC
Fetch memories based on search criteria
Inputs: tags, limit, query, project_id, +1 more.
get_agent_statsC
Get statistics for an agent
Inputs: agent_id (required), project_id.
get_context_summaryC
Generate a context summary for chat session injection
Inputs: project_id, focus_areas, max_memories, include_recent.
get_knowledge_graphC
Get interconnected knowledge graph for a topic or project
Inputs: center_topic (required), max_depth, project_id, connection_types.
get_memory_insightsC
Get insights about knowledge patterns, growth, and recommendations
Inputs: project_id, include_recommendations.
get_performance_reportC
Get performance metrics and recommendations
Inputs: days, include_recommendations.
promote_memory_knowledgeC
Manually promote important memories and update knowledge structures
Inputs: memory_ids (required), target_layer, emotional_weight.
push_memoryC
Push a memory entry to the server
Inputs: content (required), tags, priority, project_id, +1 more.
record_feedbackC
Record user feedback about context injection
Inputs: rating (required), comment, project_id, context_summary.
register_agentD
Register a new agent
Inputs: name (required), agent_type, project_id.
search_similar_experiencesC
Find similar past experiences and related knowledge using brain-like memory search
Inputs: query (required), project_id, focus_areas, include_analogies.
start_conversation_recordingC
Start automatic conversation recording for a project
Inputs: project_id, auto_record_ai_responses, auto_record_user_messages.
stop_conversation_recordingB
Stop automatic conversation recording and create summary
Inputs: project_id.
trace_knowledge_pathC
Trace how knowledge flows from one concept to another through memory connections
Inputs: to_concept (required), from_concept (required), max_hops, project_id.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
Related MCP Connectors
Persistent memory and knowledge management for AI agents with semantic search and 50+ tools.
Persistent memory and knowledge graphs for AI agents. Hybrid search, context checkpoints, and more.
Memory system for AI agents with semantic search. Store and recall memories with ease.
Persistent long-term memory for AI agents: semantic search, knowledge graph, and task canvas.
Related MCP Servers
AlicenseAqualityDmaintenanceProvides persistent long-term memory for AI agents through semantic search and automated knowledge graph extraction. It enables agents to store, recall, and reason over facts, preferences, and relationships across multiple conversations and sessions.146 npmMIT- AlicenseAqualityDmaintenanceEnables AI agents with persistent semantic memory, including semantic recall, knowledge graphs, and instant domain expertise via pre-built Intelligence Packs.1052 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to store, search, and recall semantic memories with three memory types (semantic, episodic, procedural) and auto-consolidation, compounding intelligence over time.MIT

mcp-hyperspace-memoryofficial
AlicenseBqualityCmaintenanceEnables AI agents to store, semantically recall, update, forget, consolidate, and verify persistent memories with session isolation and hyperbolic concept navigation. It also supports knowledge-graph linking and claim verification for anti-hallucination workflows.16MIT