Purpose
memory-mcp is a server that follows the MCP (Model Context Protocol) protocol, providing persistent memory and context window caching capabilities for AI programming environments (such as Cursor and Claude Desktop), used to save, retrieve, and manage LLM conversation memories, with storage support provided at the underlying layer by MongoDB.
Main Capabilities
- Persistent storage: MongoDB-based memory storage that can be retained across sessions.
- Context caching: intelligently archives and retrieves conversation context.
- Tag search: organizes and finds memories by tags.
- Relevance scoring: automatically scores archived content for relevance.
- Convenient installation: supports one-click installation in Cursor, or manual configuration.
Basic memory tools include:
- save-memories: save memories to the database (overwriting existing content)
- get-memories: retrieve all stored memories
- add-memories: append new memories without overwriting
- clear-memories: remove all stored memories
Context window caching tools include:
- archive-context: archive conversation context with tags
- retrieve-context: retrieve relevant archived context
- score-relevance: score archived content for relevance
- create-summary: create summaries for archived content
- get-conversation-summaries: get all summaries for a conversation
- search-context-by-tags: search archived content by tags
Usage
Installation: one-click installation in Cursor is recommended, or manual installation.
Manual installation requirements: Node.js 18+, npm, MongoDB.
Claude Desktop configuration: add the corresponding configuration to claude_desktop_config.json. macOS path: ~/Library/Application Support/Claude/claude_desktop_config.json Windows path: %APPDATA%\Claude\claude_desktop_config.json After configuration, Claude Desktop must be restarted.
Set the MongoDB connection string: default mongodb://localhost:27017
Typical operation examples:
- Store memories from a conversation
- Retrieve memories: get all stored memories
- Archive context: archive when the conversation is too long
- Retrieve relevant context: get archived content related to the current conversation
System automation behavior:
- Automatically archive content when context usage reaches 80%
- Automatically retrieve relevant content when usage drops below 30%
- Use keyword overlap for relevance scoring
- Create summaries to compress long conversations
Applicable Scenarios
- Long conversations: manage the context window of extended sessions
- Memory persistence: save important information across sessions
- Context retrieval: recover relevant past conversations
- Research projects: organize and tag research conversations
Limitations
- MongoDB must be prepared and run separately.
- Requires a Node.js 18+ and npm environment.
- Specific pricing and charging models are not yet provided.
Technical Details
- Tech stack: Node.js, TypeScript, MCP SDK, MongoDB
- Dependencies: @modelcontextprotocol/sdk, mongodb, zod
- Platforms: macOS, Windows, Linux
- Storage: MongoDB (default mongodb://localhost:27017)