A simple MCP server that stores and retrieves memories from multiple LLMs
- • Core MCP protocol features implemented (20/40)
- • Room for improvement in GitHub community
- • Optimal dependency management (20/20)
- • Room for improvement in deployment maturity
- • Documentation (8/8)
- • Archestra MCP Trust score badge is missing
{
"mcpServers": {
"memory-mcp": {
"command": "node",
"args": [
"build/index.js"
],
"env": {
"MONGODB_URI": "mongodb://localhost:27017"
}
}
}
}
Memory MCP
A Model Context Protocol (MCP) server for logging and retrieving memories from LLM conversations.
Features
- Save Memories: Store memories from LLM conversations with timestamps and LLM identification
- Retrieve Memories: Get all stored memories with detailed metadata
- Add Memories: Append new memories without overwriting existing ones
- Clear Memories: Remove all stored memories
- MongoDB Storage: Persistent storage using MongoDB database
Installation
- Install dependencies:
npm install
- Build the project:
npm run build
Configuration
Set the MongoDB connection string via environment variable:
export MONGODB_URI="mongodb://localhost:27017"
Default: mongodb://localhost:27017
Usage
Available Tools
-
save-memories: Save all memories to the database, overwriting existing ones
memories
: Array of memory strings to savellm
: Name of the LLM (e.g., 'chatgpt', 'claude')userId
: Optional user identifier
-
get-memories: Retrieve all memories from the database
- No parameters required
-
add-memories: Add new memories to the database without overwriting existing ones
memories
: Array of memory strings to addllm
: Name of the LLM (e.g., 'chatgpt', 'claude')userId
: Optional user identifier
-
clear-memories: Clear all memories from the database
- No parameters required
Example Usage in LLM
-
Save all memories (overwrites existing):
User: "Save all my memories from this conversation to the MCP server" LLM: [Uses save-memories tool with current conversation memories]
-
Retrieve all memories:
User: "Get all my memories from the MCP server" LLM: [Uses get-memories tool to retrieve stored memories]
-
Add new memories (preserves existing):
User: "Add these new memories to my existing ones" LLM: [Uses add-memories tool to append new memories]
Database Schema
Memories are stored in MongoDB with the following structure:
{
_id: ObjectId,
memories: string[], // Array of memory strings
timestamp: Date, // When memories were saved
llm: string, // LLM identifier (e.g., 'chatgpt', 'claude')
userId?: string // Optional user identifier
}
Development
To run in development mode:
npm run build
node build/index.js
[](https://archestra.ai/mcp-catalog/jamesanz__memory-mcp)
Memory MCP
A Model Context Protocol (MCP) server for logging and retrieving memories from LLM conversations.
Features
- Save Memories: Store memories from LLM conversations with timestamps and LLM identification
- Retrieve Memories: Get all stored memories with detailed metadata
- Add Memories: Append new memories without overwriting existing ones
- Clear Memories: Remove all stored memories
- MongoDB Storage: Persistent storage using MongoDB database
Installation
- Install dependencies:
npm install
- Build the project:
npm run build
Configuration
Set the MongoDB connection string via environment variable:
export MONGODB_URI="mongodb://localhost:27017"
Default: mongodb://localhost:27017
Usage
Available Tools
-
save-memories: Save all memories to the database, overwriting existing ones
memories
: Array of memory strings to savellm
: Name of the LLM (e.g., 'chatgpt', 'claude')userId
: Optional user identifier
-
get-memories: Retrieve all memories from the database
- No parameters required
-
add-memories: Add new memories to the database without overwriting existing ones
memories
: Array of memory strings to addllm
: Name of the LLM (e.g., 'chatgpt', 'claude')userId
: Optional user identifier
-
clear-memories: Clear all memories from the database
- No parameters required
Example Usage in LLM
-
Save all memories (overwrites existing):
User: "Save all my memories from this conversation to the MCP server" LLM: [Uses save-memories tool with current conversation memories]
-
Retrieve all memories:
User: "Get all my memories from the MCP server" LLM: [Uses get-memories tool to retrieve stored memories]
-
Add new memories (preserves existing):
User: "Add these new memories to my existing ones" LLM: [Uses add-memories tool to append new memories]
Database Schema
Memories are stored in MongoDB with the following structure:
{
_id: ObjectId,
memories: string[], // Array of memory strings
timestamp: Date, // When memories were saved
llm: string, // LLM identifier (e.g., 'chatgpt', 'claude')
userId?: string // Optional user identifier
}
Development
To run in development mode:
npm run build
node build/index.js