Provides persistent storage of conversation memories using MongoDB database with support for saving, retrieving, adding, and clearing memory records.
Click on "Install 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., "@Memory MCPsave that I'm working on a React project with TypeScript"
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.
π§ Memory MCP Server
Persistent memory and context window caching for LLM conversations. Save, retrieve, and manage memories with intelligent context archiving. MongoDB-backed storage.
An MCP (Model Context Protocol) server that provides memory management and context window caching for AI coding environments like Cursor and Claude Desktop.
Why Use Memory MCP?
πΎ Persistent Storage β MongoDB-backed memory that survives sessions
π§ Context Caching β Intelligent archiving and retrieval of conversation context
π·οΈ Tag-based Search β Organize and find memories by tags
π Relevance Scoring β Automatically score archived content relevance
β‘ Easy Setup β One-click install in Cursor or simple manual setup
Related MCP server: MongoDB MCP Server for LLMs
Quick Start
Ready to add memory to your AI workflow? Install in seconds:
Install in Cursor (Recommended):
Or install manually:
Features
Basic Memory Tools
save-memoriesβ Save memories to database (overwrites existing)get-memoriesβ Retrieve all stored memoriesadd-memoriesβ Append new memories without overwritingclear-memoriesβ Remove all stored memories
Context Window Caching
archive-contextβ Archive conversation context with tagsretrieve-contextβ Retrieve relevant archived contextscore-relevanceβ Score archived content relevancecreate-summaryβ Create summaries of archived contentget-conversation-summariesβ Get all summaries for a conversationsearch-context-by-tagsβ Search archived content by tags
Installation
Cursor (One-Click)
Click the install link above or use:
Manual Installation
Requirements: Node.js 18+, npm, MongoDB
Claude Desktop
Add to claude_desktop_config.json:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Restart Claude Desktop after configuration.
Configuration
Set the MongoDB connection string:
Default: mongodb://localhost:27017
Usage Examples
Save Memories
Store memories from a conversation:
Retrieve Memories
Get all stored memories:
Archive Context
Archive conversation context when it gets too long:
Retrieve Relevant Context
Get archived content relevant to current conversation:
Context Window Caching
The system automatically:
Archives content when context usage reaches 80%
Retrieves relevant content when usage drops below 30%
Scores relevance using keyword overlap
Creates summaries to condense long conversations
Use Cases
Long Conversations β Manage context windows for extended sessions
Memory Persistence β Save important information across sessions
Context Retrieval β Bring back relevant past conversations
Research Projects β Organize and tag research conversations
Technical Details
Built with: Node.js, TypeScript, MCP SDK, MongoDB
Dependencies: @modelcontextprotocol/sdk, mongodb, zod
Platforms: macOS, Windows, Linux
Storage: MongoDB (default: mongodb://localhost:27017)
Contributing
β If this project helps you, please star it on GitHub! β
Contributions welcome! Please open an issue or submit a pull request.
License
ISC
Support
If you find this project useful, consider supporting it:
β‘ Lightning Network
βΏ Bitcoin: bc1ptzvr93pn959xq4et6sqzpfnkk2args22ewv5u2th4ps7hshfaqrshe0xtp
Ξ Ethereum/EVM: 0x42ea529282DDE0AA87B42d9E83316eb23FE62c3f