Built using JavaScript/Node.js runtime for implementing the memory server functionality
Requires Node.js runtime environment for execution and deployment
Uses npm package manager for dependency management and build processes
Implemented in TypeScript for type safety and requires compilation to JavaScript
Memory MCP Server
A production-ready Model Context Protocol server implementing three-tiered memory architecture for vertical agents.
Overview
The Memory MCP Server provides persistent and session-based memory capabilities through three specialized memory types:
Short-term Memory: Session context with configurable TTL (default: 30 minutes)
Long-term Memory: Persistent user profiles, preferences, and demographics
Episodic Memory: Searchable event history with sentiment analysis and tagging
Architecture
Memory Types
Type | Persistence | Use Case | TTL |
Short-term | In-memory only | Session context, temporary state | Configurable (default 30m) |
Long-term | Disk storage | User profiles, preferences, demographics | Permanent |
Episodic | Disk storage | Event history, experiences, interactions | Permanent |
Data Storage
Installation
Prerequisites
Node.js 16.0 or higher
npm 7.0 or higher
Setup
Clone and build
git clone <repository-url> cd memory-server npm install npm run buildConfigure MCP
Add to your MCP configuration (e.g.,
cline_mcp_settings.json):{ "mcpServers": { "memory-server": { "command": "node", "args": ["./memory-server/build/index.js"], "settings": { "dataDirectory": "./memory-server/memory-data", "defaultTTLMinutes": 30 } } } }
API Reference
Tools
Tool | Description | Required Parameters |
| Store session data with TTL |
,
,
|
| Retrieve session data |
|
| Store user profile data |
|
| Retrieve user profile |
|
| Record event/experience |
,
,
|
| Retrieve user events |
|
| Search event history |
,
|
Resources
memory://long-term/{userId}- User profile data (JSON)memory://episodic/{userId}- User event history (JSON)
Prompts
memory_summary- Generate comprehensive user memory summarypersonalization_insights- Extract personalization opportunities
Usage Examples
User Profile Management
Session Context
Data Models
Long-term Memory Structure
Episodic Memory Structure
Development
Commands
Testing
Production Considerations
Performance
Memory operations: <10ms
Disk operations: <50ms (SSD)
Search operations: <100ms (1000 memories)
Memory usage: Linear with data volume
Security
Input validation on all parameters
Atomic file operations preventing corruption
No external API dependencies
Local-only data storage
Reliability
Graceful degradation when storage unavailable
Automatic memory cleanup for expired sessions
Data persistence with automatic recovery
Comprehensive error handling
Monitoring
Structured logging for all operations
Error tracking with diagnostic information
Data integrity verification on startup
Performance metrics available
Troubleshooting
Common Issues
Server fails to start
Verify Node.js version >= 16.0
Run
npm run buildto compile TypeScriptCheck file permissions on
build/index.js
Data not persisting
Ensure
memory-data/directory is writableVerify disk space availability
Check system logs for I/O errors
Memory not found
Validate
userId/sessionIdformatCheck TTL expiration for short-term memory
Verify operation sequencing
Debug Mode
License
MIT License - see LICENSE file for details.
Support
Issues: Create GitHub issue
Email: cbuntingde@gmail.com
Documentation: Refer to inline code comments
Enterprise-grade production implementation with comprehensive error handling, type safety, and operational reliability.
local-only server
The server can only run on the client's local machine because it depends on local resources.
Tools
Enables agents to maintain persistent memory through three-tiered architecture: short-term session context with TTL, long-term user profiles and preferences, and searchable episodic event history with sentiment analysis. Provides comprehensive memory management for personalized AI interactions.