
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
agent-memory-mcp
Advanced tools
A Model Context Protocol (MCP) server that provides persistent memory capabilities for AI agents. Store, query, and manage memories across sessions with support for tags, metadata, keyword-based semantic search, TTL expiration, memory linking, and batch operations.
npm install -g agent-memory-mcp
git clone <repository-url>
cd agent-memory-mcp
npm install
npm run build
Add to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"agent-memory": {
"command": "npx",
"args": ["-y", "agent-memory-mcp"]
}
}
}
Or if installed globally:
{
"mcpServers": {
"agent-memory": {
"command": "agent-memory-mcp"
}
}
}
Add to your Cursor MCP settings (.cursor/mcp.json in your project or global settings):
{
"mcpServers": {
"agent-memory": {
"command": "npx",
"args": ["-y", "agent-memory-mcp"]
}
}
}
Add to your Windsurf configuration:
{
"mcpServers": {
"agent-memory": {
"command": "npx",
"args": ["-y", "agent-memory-mcp"]
}
}
}
Add to .kiro/settings/mcp.json:
{
"mcpServers": {
"agent-memory": {
"command": "npx",
"args": ["-y", "agent-memory-mcp"]
}
}
}
Store a new memory entry with optional TTL.
Parameters:
content (string, required): The memory content to storetags (string[], optional): Tags for categorizationmetadata (object, optional): Custom metadatattl (object, optional): Time-to-live for automatic expiration
value (number): Numeric valueunit (string): One of "seconds", "minutes", "hours", "days"Example:
{
"content": "User prefers dark mode and uses TypeScript",
"tags": ["preferences", "coding"],
"metadata": { "priority": "high" },
"ttl": { "value": 7, "unit": "days" }
}
Search memories using keyword-based semantic matching.
Parameters:
query (string, required): Search queryk (number, optional): Maximum results to return (default: 10)tags (string[], optional): Filter by tagsExample:
{
"query": "user preferences",
"k": 5,
"tags": ["preferences"]
}
List all stored memories with pagination.
Parameters:
limit (number, optional): Maximum entries to returnoffset (number, optional): Number of entries to skipincludeExpired (boolean, optional): Include expired memories (default: false)Example:
{
"limit": 20,
"offset": 0,
"includeExpired": false
}
Delete a specific memory by ID.
Parameters:
id (string, required): Memory ID to deleteExample:
{
"id": "550e8400-e29b-41d4-a716-446655440000"
}
Clear all memories from the store.
Parameters:
confirm (boolean, optional): Must be true to confirm deletionExample:
{
"confirm": true
}
Update an existing memory's content, tags, or metadata.
Parameters:
id (string, required): Memory ID to updatecontent (string, optional): New content (replaces existing)tags (string[], optional): New tags (replaces existing)metadata (object, optional): New metadata (merges with existing)Example:
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"content": "Updated user preferences",
"tags": ["preferences", "updated"],
"metadata": { "lastReviewed": "2024-01-15" }
}
Store multiple memories in a single atomic operation.
Parameters:
items (array, required): Array of memory items (max 100)
content (string, required): Memory contenttags (string[], optional): Tagsmetadata (object, optional): Metadatattl (object, optional): TTL configurationExample:
{
"items": [
{ "content": "First memory", "tags": ["batch"] },
{ "content": "Second memory", "tags": ["batch"], "ttl": { "value": 1, "unit": "hours" } }
]
}
Response:
{
"success": true,
"total": 2,
"succeeded": 2,
"failed": 0,
"results": [
{ "index": 0, "success": true, "id": "uuid-1" },
{ "index": 1, "success": true, "id": "uuid-2" }
]
}
Delete multiple memories in a single atomic operation.
Parameters:
ids (string[], required): Array of memory IDs to delete (max 100)Example:
{
"ids": ["uuid-1", "uuid-2", "uuid-3"]
}
Get statistics about stored memories.
Parameters: None
Response:
{
"totalCount": 150,
"tagCounts": { "preferences": 25, "coding": 45 },
"storageSizeBytes": 102400,
"dateRange": {
"oldest": "2024-01-01T00:00:00.000Z",
"newest": "2024-01-15T12:30:00.000Z"
},
"averageContentLength": 256,
"expiredCount": 5,
"linkCount": 12
}
Remove all expired memories from storage.
Parameters: None
Response:
{
"deletedCount": 5,
"deletedIds": ["uuid-1", "uuid-2", "uuid-3", "uuid-4", "uuid-5"]
}
Create a bidirectional link between two memories.
Parameters:
sourceId (string, required): Source memory IDtargetId (string, required): Target memory IDlinkType (string, optional): Type of relationship (default: "related")
Example:
{
"sourceId": "uuid-1",
"targetId": "uuid-2",
"linkType": "extends"
}
Get all links associated with a memory.
Parameters:
id (string, required): Memory IDResponse:
{
"links": [
{
"sourceId": "uuid-1",
"targetId": "uuid-2",
"linkType": "extends",
"createdAt": "2024-01-15T10:00:00.000Z"
}
]
}
Export memories to JSON format for backup or migration.
Parameters:
tags (string[], optional): Only export memories with these tagsincludeExpired (boolean, optional): Include expired memories (default: false)Example:
{
"tags": ["important"],
"includeExpired": false
}
Response:
{
"version": "1.0",
"exportedAt": "2024-01-15T12:00:00.000Z",
"memories": [...],
"links": [...]
}
Import memories from a previously exported JSON file.
Parameters:
data (object, required): Export data object
memories (array, required): Array of memory entrieslinks (array, optional): Array of memory linksExample:
{
"data": {
"memories": [
{
"id": "old-uuid",
"content": "Imported memory",
"tags": ["imported"],
"metadata": {},
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-01T00:00:00.000Z"
}
],
"links": []
}
}
Response:
{
"success": true,
"memoriesImported": 1,
"linksImported": 0,
"idMappings": { "old-uuid": "new-uuid" },
"errors": []
}
The TTL feature allows you to set expiration times for memories. Expired memories are automatically excluded from queries and listings.
seconds: Expire after N secondsminutes: Expire after N minuteshours: Expire after N hoursdays: Expire after N days// Store a memory that expires in 1 hour
{
"content": "Temporary note",
"ttl": { "value": 1, "unit": "hours" }
}
// Store a memory that expires in 7 days
{
"content": "Weekly reminder",
"ttl": { "value": 7, "unit": "days" }
}
Use memory_cleanup to permanently delete all expired memories:
// Returns: { "deletedCount": 5, "deletedIds": [...] }
Build knowledge graphs by creating relationships between memories.
related: General relationship (default)contradicts: Memories that conflict with each otherextends: Memory that adds to anothersupersedes: Memory that replaces another// Create a link
{
"sourceId": "memory-about-topic",
"targetId": "related-memory",
"linkType": "extends"
}
// Links are bidirectional - both memories will show the link
When a memory is deleted, all its associated links are automatically removed.
Memories are stored in JSON format at:
~/.agent-memory/memories.json%USERPROFILE%\.agent-memory\memories.json{
"memories": [
{
"id": "uuid",
"content": "...",
"tags": [],
"metadata": {},
"createdAt": "...",
"updatedAt": "...",
"expiresAt": "..."
}
],
"links": [
{
"sourceId": "uuid1",
"targetId": "uuid2",
"linkType": "related",
"createdAt": "..."
}
]
}
# Install dependencies
npm install
# Build
npm run build
# Run tests
npm test
# Watch mode for development
npm run dev
MIT
FAQs
MCP server for AI agent memory persistence
We found that agent-memory-mcp demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.