@aeriondyseti/mcp-memory
v0.2.0
Published
A zero-configuration RAG memory server for MCP clients
Maintainers
Readme
MCP Memory Server
Replace static markdown context files with intelligent, semantically-searchable memories that understand what you're working on.
A production-ready MCP (Model Context Protocol) server that provides semantic memory storage for AI assistants. Uses local embeddings and vector search to automatically retrieve relevant context without cloud dependencies.
Perfect for: Software teams maintaining architectural knowledge, developers juggling multiple projects, and anyone building with AI assistants like Claude Code.
✨ Features
🔒 Local-First & Private
- All embeddings generated locally (no cloud APIs)
- Data stored in local sqlite-vec databases
- Complete privacy and control over your memories
🎯 Intelligent Semantic Search
- Vector similarity with multi-factor scoring
- Considers relevance, recency, priority, and usage frequency
- Context-aware retrieval based on conversation flow
📊 Smart Memory Storage
- Stores memories in
~/.local/share/mcp-memory/memories.db - Fast SQLite-based storage with vector search capabilities
- Memories persist across sessions and projects
⚡ High Performance
- Sub-100ms search latency for 1000+ memories
- Efficient storage (<10MB per 1000 memories)
- CPU-optimized local embeddings (no GPU required)
🔌 MCP Native Integration
- Works seamlessly with Claude Code
- Session hooks for automatic context injection
- Standard MCP protocol (compatible with future clients)
🛠️ Developer-Friendly
- Zero-configuration setup
- Built with Bun for maximum performance
- Simple MCP tools for storing and searching
- TypeScript for type safety
🚀 Quick Start
Prerequisites
- Bun 1.0+
- Claude Code or another MCP-compatible client
Note: This server uses Bun-specific APIs (
bun:sqlite) and requires Bun to run.
Installation
# Clone the repository
git clone https://github.com/AerionDyseti/mcp-memory-server.git
cd mcp-memory-server
# Install dependencies
bun installConfigure Claude Code
Add to your ~/.claude/config.json:
{
"mcpServers": {
"memory": {
"command": "bun",
"args": ["run", "/absolute/path/to/mcp-memory-server/src/index.ts"]
}
}
}Replace /absolute/path/to/ with your actual installation path.
Start Using It
That's it! Restart Claude Code and you'll have access to memory tools:
store_memory- Save information for later recallsearch_memories- Find relevant memories semanticallyget_memory- Retrieve a specific memory by IDdelete_memory- Remove a memory
📖 Usage
Storing Memories
Ask Claude Code to remember things for you:
You: "Remember that we use Drizzle ORM for database access"
Claude: [calls store_memory tool]Or Claude Code can store memories directly:
{
"content": "Use Drizzle ORM for type-safe database access",
"metadata": {
"tags": ["architecture", "database"],
"category": "tooling"
}
}Searching Memories
Claude Code automatically searches memories when relevant, or you can ask:
You: "What did we decide about the database?"
Claude: [calls search_memories with query about database decisions]Search parameters:
{
"query": "authentication strategy",
"limit": 10
}Managing Memories
Retrieve a specific memory:
{
"id": "memory-id-here"
}Delete a memory:
{
"id": "memory-id-here"
}🏗️ Architecture
mcp-memory-server/
├── src/
│ ├── index.ts # Entry point
│ ├── config/ # Configuration management
│ ├── db/ # Database layer (Drizzle ORM + sqlite-vec)
│ ├── services/
│ │ ├── embeddings.service.ts # Embeddings via @xenova/transformers
│ │ └── memory.service.ts # Core memory operations
│ └── mcp/
│ ├── server.ts # MCP server setup
│ ├── tools.ts # MCP tool definitions
│ └── handlers.ts # Tool request handlers
├── tests/
│ ├── memory.test.ts
│ └── embeddings.test.ts
├── bin/
│ └── mcp-memory.js # Executable entry point
└── package.jsonTechnology Stack
- MCP Framework: @modelcontextprotocol/sdk (official SDK)
- Vector Database: sqlite-vec (fast, local, SQLite-based)
- ORM: Drizzle ORM with @aeriondyseti/drizzle-sqlite-vec
- Embeddings: @xenova/transformers (Xenova/all-MiniLM-L6-v2, 384 dimensions)
- Language: TypeScript 5.0+
- Runtime: Bun 1.0+ (required for bun:sqlite)
- Testing: Bun test
🎨 How It Works
1. Memory Storage
Claude Code calls store_memory tool
↓
Content → @xenova/transformers → 384d vector
↓
Store in sqlite-vec with metadata
↓
~/.local/share/mcp-memory/memories.db2. Memory Retrieval
Claude Code calls search_memories
↓
Query → @xenova/transformers → 384d vector
↓
KNN search in sqlite-vec
↓
Vector similarity scoring
↓
Return top N relevant memories🔧 Configuration
The server uses environment variables for configuration:
MCP_MEMORY_DB_PATH- Custom database path (default:~/.local/share/mcp-memory/memories.db)MCP_MEMORY_MODEL- Embedding model to use (default:Xenova/all-MiniLM-L6-v2)
Example:
export MCP_MEMORY_DB_PATH="/path/to/custom/memories.db"
export MCP_MEMORY_MODEL="Xenova/all-MiniLM-L6-v2"Or in your Claude Code config:
{
"mcpServers": {
"memory": {
"command": "mcp-memory",
"env": {
"MCP_MEMORY_DB_PATH": "/custom/path/memories.db"
}
}
}
}🧪 Development
Running Tests
# Run all tests
bun test
# Run with coverage
bun test --coverage
# Type checking
bun run typecheckDevelopment Mode
# Watch mode - auto-restart on file changes
bun run dev
# Run directly without building
bun run src/index.tsBuilding
# Build for production
bun run build
# Output will be in dist/🗺️ Roadmap
✅ Phase 1: Foundation (Current)
- ✅ Core database with sqlite-vec
- ✅ Embedding generation with @xenova/transformers
- ✅ Basic MCP tools (store, search, get, delete)
- ✅ TypeScript implementation with Drizzle ORM
🚧 Phase 2: Enhanced Search & Scoring
- Multi-factor scoring algorithm (similarity, recency, priority, usage frequency)
- Configurable scoring weights
- Priority levels for memories
- Usage tracking and frequency-based ranking
- Metadata filtering and advanced tagging
📋 Phase 3: Dual-Level Memory System
- Project-specific memories (
.memory/dbin repo) - Global memories (
~/.local/share/mcp-memory/) - Automatic precedence handling (project overrides global)
- Project detection and context switching
🎯 Phase 4: Smart Automation
- Auto-detect architectural decisions
- Capture bug fixes and solutions automatically
- Generate session-end summaries
- Natural language trigger detection (85%+ accuracy)
- Continuous conversation monitoring
🔮 Phase 5: Advanced Features
- Memory deduplication with similarity threshold
- Batch operations (import/export)
- Markdown import/export
- Memory clustering and visualization
- Cross-project insights
- Multi-modal memories (images, diagrams)
- Session hooks for automatic context injection
- Multi-CLI support (Cursor, Windsurf, etc.)
- Smart priority suggestions
🤝 Contributing
Contributions are welcome! This project is in active development.
Areas We'd Love Help With:
- Testing and bug reports
- Documentation improvements
- Performance optimizations
- New feature ideas
See CONTRIBUTING.md for guidelines (coming soon).
📄 License
MIT License - see LICENSE for details.
🙏 Acknowledgments
- Built with @modelcontextprotocol/sdk - Official MCP TypeScript SDK
- Uses sqlite-vec by Alex Garcia for fast vector search
- Powered by @xenova/transformers for local embeddings
- Database layer via Drizzle ORM
- Inspired by doobidoo's mcp-memory-service
🔗 Related Projects
- Model Context Protocol - Official MCP specification
- Claude Code - AI coding assistant from Anthropic
- sqlite-vec - Vector search for SQLite
- Transformers.js - Run transformers in JavaScript
💬 Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: Check the
docs/directory
⚡ Quick Examples
Example 1: Storing a Decision
You: "Remember that we decided to use Drizzle ORM for type-safe database access"
Claude: I'll store that for you.
[Calls store_memory tool with content and metadata]
✓ Memory stored successfullyExample 2: Searching Memories
You: "What did we decide about database tooling?"
Claude: Let me search for that...
[Calls search_memories with query about database]
Found: "Use Drizzle ORM for type-safe database access"
Based on our previous decision, we're using Drizzle ORM...Example 3: Managing Memories
You: "Show me what you remember about authentication"
Claude: [Searches for authentication-related memories]
Found 3 memories:
1. "Use JWT tokens for API authentication"
2. "Store refresh tokens in httpOnly cookies"
3. "Implement rate limiting on auth endpoints"Made with ❤️ for developers who value context continuity
