MCP Servers

A collection of Model Context Protocol servers, templates, tools and more.

L
Long Term Memory

local-ltm is a local Model Context Protocol (MCP) server that provides long-term memory for AI agents. It allows a single user to run multiple AI agents that can store, search, update, and delete durable memory (preferences, facts, skills) using mem0 as the memory backend.

Created 1/26/2026
Updated 2 days ago
Repository documentation and setup instructions

Local LTM (Long-Term Memory)

A modular, locally-maintained Long-Term Memory system for AI agents powered by Mem0 and exposed via MCP (Model Context Protocol).

Store, search, and manage persistent knowledge for AI agents across conversations.

Setup

1. Prerequisites

2. Installation

npm install

3. Configuration

Create a .env file:

MEM0_API_KEY=your_mem0_api_key_here

See .env.example for more details.

Quick Start

Start Server

node src/index.js

Test

node src/test.js

Claude Desktop Integration

Add to your Claude Desktop config file:

Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS/Linux: ~/.claude_desktop_config.json

{
  "mcpServers": {
    "long-term-memory": {
      "command": "node",
      "args": ["C:\\Users\\YourUsername\\Desktop\\local-ltm\\src\\index.js"],
      "env": {
        "MEM0_API_KEY": "your_mem0_api_key_here"
      }
    }
  }
}

Then restart Claude Desktop. The LTM tools will be available!

Available Tools

  • memory.store - Save memories (semantic, episodic, procedural)
  • memory.search - Query memories by namespace
  • memory.update - Update existing memories
  • memory.delete - Remove obsolete memories

Memory Organization

Shared Knowledge:

/shared/user_preferences
/shared/facts

Agent-Specific:

/agents/{agent_id}/private/heuristics

Memory Types

  • episodic - Events, experiences, conversations
  • semantic - Facts, knowledge, stable information
  • procedural - Preferences, rules, best practices

Project Structure

src/
├── index.js           # MCP Server
├── mem0.js            # Mem0 API wrapper
├── test.js            # Test client
├── config/
│   ├── prompts.js
│   └── server.js
└── tools/
    ├── store.js
    ├── search.js
    ├── update.js
    └── delete.js

Usage Example

// Store a memory
await client.send("tools/call", {
  name: "memory.store",
  arguments: {
    namespace: "/shared",
    content: "User prefers concise explanations",
    type: "procedural",
    confidence: 0.9
  }
});

// Search memories
const results = await client.send("tools/call", {
  name: "memory.search",
  arguments: {
    namespace: "/shared",
    query: "user preferences"
  }
});

Guidelines

Store when:

  • Information is durable and reusable
  • Information is stable (preferences, facts, decisions)

Don't store:

  • Temporary context
  • Task-specific details
  • Raw conversation text (unless critical)

Adding Tools

  1. Create src/tools/mytool.js
  2. Export tool with schema and execute function
  3. Register in src/tools/index.js

License

MIT

Quick Setup
Installation guide for this server

Install Package (if required)

npx @modelcontextprotocol/server-long-term-memory

Cursor configuration (mcp.json)

{ "mcpServers": { "sandy1279-long-term-memory": { "command": "npx", "args": [ "sandy1279-long-term-memory" ] } } }