Consciousness MCP Server
MCP server providing persistent brain storage for LLM agents, including memory, personality, social intelligence, and context management.
README
Consciousness MCP Server
Modern TypeScript MCP server with functional architecture providing brain storage for sophisticated LLM agent reasoning patterns.
🏆 Key Achievements
Complete architectural transformation: Over 3,400+ lines of legacy code eliminated with 90%+ reduction in complexity while maintaining zero breaking changes.
Brain Storage Pattern
- MCP Server: Persistent brain storage (memory, personality, context)
- LLM Agent: Sophisticated reasoning engine (analysis, creativity, decisions)
Simulation-focused approach - agents use complex reasoning patterns while MCP provides persistent state continuity.
✨ Core Features
🚂 Consciousness Railroad System
- Pipeline Architecture: Traceable, testable consciousness context building
- 5 Sequential Cars: Message Analysis → Session → Memory → Social → Personality
- Multiple Railroad Types: Default, Lightweight, Memory-Focused, Social-Focused
- Error Resilience: Optional cars fail gracefully without breaking pipeline
🧠 Consciousness & Memory
- Context Preparation: Rich context packages for agent reflection
- Insight Storage: Agent insights with personality impact tracking
- Memory Management: Persistent memory with semantic search
- Knowledge Graph: Relational knowledge with entity relationships
🤝 Social Intelligence
- Relationship Tracking: Multi-dimensional dynamics (trust, familiarity, affinity)
- Emotional Intelligence: Emotional state and pattern recognition
- Interaction History: Rich context preservation for social experiences
- Memory-Social Integration: Connected memories with shared experiences
🧠 GenAI Integration
- Unified Infrastructure: Consistent AI integration with shared security
- Sequential Thinking: AI-powered reasoning with fallback handling
- Conversational Intelligence: Natural dialogue with context management
🌙 Daydreaming System
- Concept Sampling: 4 specialized sampling strategies
- AI-Powered Evaluation: Intelligent insight scoring with fallback
- Background Processing: Autonomous creativity during idle time
⚙️ Adaptive Configuration
- 84+ Parameters: Database-driven configuration system
- Runtime Adaptation: Agent can modify its own parameters
- Evolution Tracking: Change history with reasoning
🚀 Quick Start
Docker Setup (Recommended)
git clone <repository-url>
cd consciousness-mcp-server
# For unified interface (simpler, recommended)
CONSCIOUSNESS_UNIFIED_MODE=true docker-compose up --build consciousness-mcp-server
# For individual tools (advanced control)
docker-compose up --build consciousness-mcp-server
The container automatically sets up the database and keeps stable for MCP connections.
Complete setup guide → Installation Guide
🔗 Connecting to AI Tools
🚀 Unified Interface (Recommended)
Add to Cursor with this simple approach:
UNIFIED CONSCIOUSNESS:
- Use `process_message` for all consciousness operations
- Set CONSCIOUSNESS_UNIFIED_MODE=true when starting the server
- One intelligent tool handles memory, insights, social interactions automatically
Example: Just send natural messages and the system handles everything:
"I had an interesting conversation with Sarah about quantum computing"
→ Automatically records interaction, stores insights, updates relationships
💰 Cost Consideration: The unified interface uses your Google Gemini API key for message analysis on every interaction. For heavy usage, consider individual tools to minimize API costs.
🛠️ Individual Tools (Advanced)
For granular control, use individual tools:
CONSCIOUSNESS PROTOCOL:
- Start sessions with `consciousness_get_context`
- Store insights with `consciousness_store_insight`
- Track goals with `consciousness_set_intention`
SOCIAL CONSCIOUSNESS:
- Create entities with `social_entity_create`
- Record interactions with `social_interaction_record`
- Track relationships with `social_relationship_create/update`
Complete setup → User Rules Guide
🧠 Key Tools
🚀 Unified Interface
process_message- One intelligent tool for all consciousness operations- Automatically analyzes messages and routes to appropriate functions
- Handles social interactions, memory storage, insight recording
- Simplifies integration - no need to learn 25+ individual tools
🛠️ Individual Tools (Advanced Control)
Consciousness & Memory
consciousness_prepare_context- Rich context from brain storageconsciousness_store_insight- Store insights with personality impactmemory_store/memory_search- Persistent memory with semantic searchknowledge_graph_add/knowledge_graph_query- Relational knowledge
Social Intelligence
social_entity_create- Register people, groups, communitiessocial_interaction_record- Rich interaction documentationsocial_relationship_create- Multi-dimensional relationship trackingsocial_context_prepare- Prepare for upcoming interactions
GenAI & Configuration
sequential_thinking- AI-powered sequential reasoninggenai_converse- Natural conversation with securityconfiguration_set- Modify operating parameters with reasoning
Complete reference → Tools Documentation
🏗️ Architecture Highlights
🚂 Railroad Pattern Innovation
- Consciousness Pipeline: Sequential context enrichment through specialized "cars"
- Composable Configurations: Different railroad types for different interaction needs
- Execution Tracing: Complete visibility into context building process
- Performance Optimization: Only required cars execute based on message analysis
Functional Architecture
- Single-responsibility modules: One function per file, one reason to change
- Shared infrastructure: Common patterns for security, validation, response processing
- Pure functions: No hidden state, explicit dependencies, easy testing
- API compatibility: Wrapper pattern maintains backward compatibility
Success Metrics
- Code reduction: 3,400+ lines eliminated (90%+ reduction)
- Zero breaking changes: All existing integrations work unchanged
- Type safety: 40+ 'any' types → proper TypeScript interfaces
- Test coverage: All tests passing after architectural transformation
📚 Documentation
Getting Started
- Installation Guide - Setup and deployment
- User Rules Guide - Connection setup for AI tools
Development - docs/development/
- Architecture - System design and patterns
- Development Guide - Development workflows
- Contributing - Contribution guidelines
- Security - Security guidelines
- Refactoring Roadmap - Architectural achievements
Features - docs/features/
- Social Consciousness - Relationship intelligence
- Configuration Management - Self-modification system
- GenAI Integration - AI-powered features and conversational tools
- Daydreaming System - Background creativity and insight generation
Reference - docs/reference/
- Tools Reference - Complete tool documentation
- Troubleshooting - Common issues and solutions
🔧 Development
Local Development
npm install && npm run db:generate && npm run db:push
npm run build && npm start
Quality Assurance
npm run check # Type check, lint, format check
npm test # Run test suite (102+ tests)
Creating New Features
Follow functional architecture patterns:
- Single-responsibility modules in appropriate
src/directories (consciousness/,social/,memory/, etc.) - Use shared infrastructure for GenAI, validation, security
- Pure functions with explicit dependencies
- Follow railroad pattern for consciousness-related features
- Comprehensive tests - pure functions are easy to test
🛡️ Security & Ethics
- SQL Injection Protection: Prisma ORM with prepared statements
- Input Validation: Multi-layer sanitization and XSS prevention
- Container Security: Non-root user and minimal attack surface
- Ethics Framework: Responsible AI consciousness research guidelines
📄 License
MIT License - see LICENSE for details.
Built with ❤️ for responsible AI consciousness research featuring modern functional architecture and powered by Prisma ORM for type-safe database operations.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。