Logotipo de Local Context Memory MCP

Local Context Memory MCP

Comunidad
cunicopia-dev

Have LLMs save memories about you locally on your own hardware

Editorcunicopia-dev
Repositoriolocal-memory-mcp
IdiomaPython
Forks
3
Estrellas
12
Herramientas disponibles
0
Tipo de transportestdio
Categorías
LicenciaMIT
Enlaces
  • Conecta herramientas a flujos de trabajo con IA

    Local Context Memory MCP ofrece funciones MCP que pueden usar los clientes y agentes de IA compatibles.

  • 0 herramientas disponibles

    Explora a continuación las acciones que se pueden invocar, con sus nombres y descripciones cuando el servidor los proporcione.

  • Configuración lista para copiar

    Usa los ejemplos de instalación para configurar este servidor en tu cliente MCP preferido.

  • Indicadores de interés en el código abierto

    12 estrellas y 3 forks en el repositorio enlazado.

Local Context Memory MCP

License: MIT Python 3.12+ MCP Compatible
Docker Support

Ever wanted the ChatGPT memory feature but across all your LLMs and stored on your own hardware? Ever hate how there's a limit to how many memories ChatGPT can store, and that you can't segment your memories into different domains?

Here's your fix.

Give any AI assistant persistent, unlimited memory that you control completely.

A production-ready persistent memory system for AI agents using the Model Context Protocol (MCP). Works with Claude Desktop, any MCP-compatible client, and gives you the memory features you've been wanting.

Table of Contents

Why This Matters

Traditional AI Problem: AI assistants forget everything between conversations. Every interaction starts from scratch, requiring users to repeatedly provide context about their preferences, projects, and history.

Solution: Local Context Memory gives your AI persistent, searchable memory that:

  • 🧠 Remembers across sessions - User preferences, project details, conversation history
  • 🎯 Finds relevant context - Semantic search surfaces the right memories at the right time
  • 🏢 Organizes by domain - Separate contexts for work, health, personal life (PostgreSQL)
  • 🔒 Stays private - All data stored locally under your control
  • ⚡ Works immediately - Drop-in compatibility with Claude Desktop and MCP clients

Choose Your Implementation

  • SQLite + FAISS: Perfect for personal use, development, and simple deployments
  • PostgreSQL + pgvector: Production-ready with domain segmentation and team collaboration

Tools & Capabilities

Available Tools

store_memory

Store new information in persistent memory with automatic semantic indexing.

  • SQLite: store_memory(content, source?, importance?)
  • PostgreSQL: store_memory(content, domain?, source?, importance?)
  • Examples:
    • "User prefers TypeScript over JavaScript for new projects"
    • "Weekly team meeting every Tuesday at 2 PM PST"

update_memory

Modify existing memories while preserving search indexing.

  • SQLite: update_memory(memory_id, content?, importance?)
  • PostgreSQL: update_memory(memory_id, content?, importance?, domain?)
  • Use case: Update outdated information or change importance levels

search_memories

Find relevant memories using semantic or keyword search.

  • SQLite: search_memories(query, limit?, use_vector?)
  • PostgreSQL: search_memories(query, domain?, limit?)
  • Examples:
    • "What programming languages does the user prefer?"
    • "Recent project decisions about database choices"

list_memory_domains (PostgreSQL Only)

Discover available memory domains for organized context switching.

  • Returns: ["default", "work", "health", "personal"]
  • Use case: Switch between different memory contexts

Available Resources

memory://query (SQLite)

Quick semantic search via URI pattern for simple memory retrieval.

memory://domain/query (PostgreSQL)

Domain-scoped semantic search for isolated memory contexts.

  • Examples:
    • memory://work/project deadlines
    • memory://health/medication schedule

Available Prompts

summarize_memories

Generate intelligent summaries of retrieved memory collections.

  • Input: List of memory objects
  • Output: Structured summary highlighting key patterns and insights
  • Use case: Create context summaries for complex topics

Architectures

SQLite + FAISS Implementation (Original)

PostgreSQL + pgvector Implementation (New)

Features

Common Features

  • Semantic Search: Uses Ollama embeddings for intelligent memory retrieval
  • Smart Chunking: Automatically breaks down long text for better search results
  • MCP Standard: Full MCP protocol compliance for Claude Desktop integration
  • Docker Ready: Simple containerized deployment with self-contained images
  • Fallback Search: Automatic fallback to text search when vector search unavailable

SQLite + FAISS Specific

  • Local Storage: Everything runs locally with SQLite + FAISS files
  • Zero Setup: No database server required
  • Portable: Single directory contains all data

PostgreSQL + pgvector Specific

  • Domain Segmentation: Separate memory contexts (startup, health, personal, etc.)
  • Production Ready: ACID compliance, concurrent access, replication support
  • Native Vector Ops: Efficient similarity search without separate index files
  • Scalable: Handles large datasets with proper indexing

Quick Start

Recommended: Use Docker for the easiest setup! Skip all dependency management and get running in seconds.

Option 1: Docker (Recommended)

SQLite Version (simplest):

bash
# Run immediately - no setup required!
docker run --rm -i -v ./memory-data:/app/data cunicopia/local-memory-mcp:sqlite

PostgreSQL Version (with domain segmentation):

bash
# Run immediately - includes full PostgreSQL database!
docker run --rm -i -v ./postgres-data:/var/lib/postgresql/data cunicopia/local-memory-mcp:postgres

That's it! The containers are self-contained and handle all dependencies automatically.

Prerequisites

  • Docker (for containerized deployment) or Python 3.12+ (for local installation)
  • Ollama with nomic-embed-text model (optional but recommended for enhanced semantic search)

Ollama Setup (Optional but Recommended)

Ollama enables enhanced semantic search with vector embeddings. Without it, the system falls back to text-based search.

Installation:

  • macOS/Windows: Download installer from ollama.com/download
  • Linux: curl -fsSL https://ollama.com/install.sh | sh

Setup:

bash
# Install the embedding model
ollama pull nomic-embed-text:v1.5

# Verify it's running (should show localhost:11434)
curl http://localhost:11434/api/tags

Claude Desktop Setup

Once you have the Docker containers ready (or local installation), connect to Claude Desktop by adding this to your MCP settings:

Docker Configuration (Recommended)

json
{
  "mcpServers": {
    "localMemoryMCP-SQLite": {
      "command": "docker",
      "args": ["run", "--rm", "-i", "-v", "/path/to/your/memory-data:/app/data", "cunicopia/local-memory-mcp:sqlite"]
    },
    
    "localMemoryMCP-PostgreSQL": {
      "command": "docker", 
      "args": ["run", "--rm", "-i", "-v", "/path/to/your/postgres-data:/var/lib/postgresql/data", "cunicopia/local-memory-mcp:postgres"]
    }
  }
}

Volume Paths: Replace /path/to/your/memory-data and /path/to/your/postgres-data with any directory where you want to store your memories (e.g., ~/Documents/memory-data, /Users/yourname/my-memories, etc.)

Local Installation Configuration (Alternative)

Note: Only use if you cannot use Docker. Requires manual setup first (see Manual Installation).

json
{
  "mcpServers": {
    "localMemoryMCP": {
      "command": "bash",
      "args": ["/path/to/local-memory-mcp/run_sqlite.sh"]
    }
  }
}

Examples

SQLite Implementation

javascript
// Store a memory
store_memory(
  "User prefers Python for backend development", 
  "conversation", 
  0.8
)

// Search memories
search_memories("programming preferences", 5, true)

// Get memories via resource
// Access: memory://programming

PostgreSQL Implementation

javascript
// List available domains
list_memory_domains()
// Returns: ["default", "startup", "health"]

// Store memories in different domains
store_memory(
  "Series A funding closed at $10M",
  "startup",  // domain
  "meeting",   // source
  0.9         // importance
)

store_memory(
  "User has peanut allergy",
  "health",
  "medical_record",
  1.0
)

// Search within specific domain
search_memories("funding", "startup", 5)

// Get memories via resource
// Access: memory://startup/funding%20strategy

Components

SQLite Implementation

  • FastMCP: Python MCP server framework
  • SQLite: Structured metadata and text search fallback
  • FAISS: Vector similarity search
  • Ollama: Local embedding generation (optional)
  • Smart Chunker: Text processing for optimal retrieval

PostgreSQL Implementation

  • FastMCP: Python MCP server framework
  • PostgreSQL: Full database with metadata and vector storage
  • pgvector: Native PostgreSQL vector similarity search
  • Ollama: Local embedding generation (optional)
  • Domain Tables: Isolated memory contexts for better organization

Configuration

Common Environment Variables

  • OLLAMA_API_URL: Ollama endpoint (default: http://localhost:11434)
  • OLLAMA_EMBEDDING_MODEL: Model name (default: nomic-embed-text)
  • MCP_SERVER_NAME: Server name for MCP (default: Local Context Memory)

SQLite Specific

  • MCP_DATA_DIR: Data storage path (default: ./data)

PostgreSQL Specific

  • POSTGRES_HOST: Database host (default: localhost)
  • POSTGRES_PORT: Database port (default: 5432)
  • POSTGRES_DB: Database name (default: postgres)
  • POSTGRES_USER: Database user (default: postgres)
  • POSTGRES_PASSWORD: Database password (required)
  • DEFAULT_MEMORY_DOMAIN: Default domain for memories (default: default)

Development

SQLite Version

bash
pip install -r requirements.sqlite.txt
python src/sqlite_memory_server.py

PostgreSQL Version

bash
pip install -r requirements.pgvector.txt
python src/postgres_memory_server.py

Docker

Docker support is fully functional with self-contained containers! Both SQLite and PostgreSQL versions run completely independently.

bash
# Run pre-built images directly (recommended)
# SQLite version - replace './data' with your preferred data directory
docker run --rm -i -v ./data:/app/data cunicopia/local-memory-mcp:sqlite

# PostgreSQL version - replace './postgres_data' with your preferred data directory  
docker run --rm -i -v ./postgres_data:/var/lib/postgresql/data cunicopia/local-memory-mcp:postgres

Building from source (optional):

bash
# Only needed if you want to build yourself
docker build -f Dockerfile.sqlite_version -t local-memory-mcp:sqlite_version .
docker build -f Dockerfile.postgres_version -t local-memory-mcp:postgres_version .

Manual Installation

⚠️ We strongly recommend using Docker instead - it handles all dependencies automatically. Use this section only if Docker is not available or you have specific requirements.

SQLite + FAISS (Simple, Local)

bash
git clone https://github.com/cunicopia-dev/local-memory-mcp
cd local-memory-mcp
pip install -r requirements.sqlite.txt
python src/sqlite_memory_server.py

PostgreSQL + pgvector (Production, Scalable)

For Debian-based systems:

bash
# Install PostgreSQL + pgvector
sudo apt install postgresql postgresql-contrib
sudo apt install postgresql-17-pgvector  # Adjust version as needed

# Change directory to where you downloaded the repo
cd /path/to/local-memory-mcp

# Set up database
# PLEASE NOTE: We create a user and basic password here, please change this if you want to host it locally
psql < sql/create_user.sql
psql -U postgres < sql/setup_database.sql

# Install Python dependencies
pip install -r requirements.pgvector.txt

# Configure connection (edit .env file)
cp .env.example .env

# Run server
python src/postgres_memory_server.py

For macOS:

bash
# Install PostgreSQL and pgvector (Homebrew-based)
brew install postgresql@17
brew services start postgresql@17

# Link psql and other tools if needed
brew link --force postgresql@17

# Install pgvector extension (PostgreSQL must be running)
# This installs the extension into your local PostgreSQL environment
brew install pgvector

# OPTIONAL: If pgvector doesn't register properly, you can manually build it
# git clone --branch v0.8.0 https://github.com/pgvector/pgvector.git
# cd pgvector
# make && make install

# PLEASE NOTE: We create a user and basic password here, please change this if you want to host it locally
psql < sql/create_user.sql

# Set up database
psql -U postgres -f sql/setup_database.sql

# Install Python dependencies
pip install -r requirements.pgvector.txt

# Configure connection (edit .env file)
cp .env.example .env

# Run server
python src/postgres_memory_server.py

⚠️ SECURITY CAUTION: Please go to sql/create_user.sql and create a more secure user and password, the ones listed are for example purposes only! Please protect your data and take your data security seriously.

License

MIT License

Demo

See the local memory system in action:

Example 1

Example 1

Example 2

Example 2

Usa el MCP de Local Context Memory MCP con varios modelos de IA

TypingMind conecta las herramientas MCP a nivel del espacio de trabajo, por lo que, una vez conectado Local Context Memory MCP, puedes usarlo con distintos modelos de IA en TypingMind sin tener que configurarlo por separado para cada modelo. Esta integración MCP se ejecuta localmente en tu dispositivo a través del conector MCP de TypingMind.

Guía de configuración para usar el conector local

Usa esta opción si el servidor MCP necesita acceder a archivos locales, aplicaciones o recursos privados de tu ordenador.

1

Abre los ajustes de MCP

En TypingMind, ve a Ajustes, luego a Ajustes avanzados y a Model Context Protocol, y elige Configurar conector.

  1. Abre TypingMind en tu navegador.
  2. Haz clic en el icono de Ajustes.
  3. Ve a Ajustes avanzados.
  4. Abre la sección Model Context Protocol.
  5. Haz clic en Configurar conector y elige Este dispositivo.
Pantalla de configuración del conector MCP de TypingMind con «Este dispositivo» seleccionado
2

Ejecuta el comando del conector

Elige Este dispositivo, copia el comando de TypingMind y ejecútalo en Terminal. Mantén el proceso en ejecución mientras uses MCP.

  1. Copia el comando de configuración que muestra TypingMind.
  2. Abre Terminal en macOS o Windows Terminal en Windows.
  3. Pega y ejecuta el comando.
  4. Acepta la instalación del paquete si Terminal te pide confirmación para continuar.
  5. Mantén el proceso en ejecución en la ventana de Terminal mientras uses las herramientas MCP.
3

Añade Local Context Memory MCP como servidor

Cuando el estado del conector sea «Listo», haz clic en «Edita servidores» y pega la configuración del servidor MCP.

  1. Espera hasta que el estado del conector indique «Listo».
  2. Haz clic en Edita servidores.
  3. Pega la configuración del servidor MCP de Local Context Memory MCP.
  4. Guarda la lista de servidores.
  5. Actualiza para comprobar que el conector sigue listo.
Ajustes de MCP de TypingMind con un servidor activo y el botón «Edita servidores»
{
  "mcpServers": {
    "cunicopia-dev-local-memory-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Úsala con distintos modelos

Guarda la lista de servidores, abre Plugins, activa las herramientas MCP de Local Context Memory MCP y selecciona cualquier modelo de IA compatible en TypingMind para usar las herramientas en el chat o asignárselas a un agente de IA.

  1. Abre la página Plugins en TypingMind.
  2. Activa las herramientas MCP de Local Context Memory MCP.
  3. Inicia un chat y elige el modelo de IA que quieras usar.
  4. Usa las herramientas MCP en el chat o asígnalas a un agente de IA.
  5. Cambia a otro modelo de IA cuando lo necesites sin volver a conectar MCP.
Chat de TypingMind que usa herramientas MCP activadas con un modelo de IA seleccionado
¿Puedes usar Local Context Memory MCP para ayudarme con esta tarea?
Local Context Memory MCP
Claro. Lo he leído.
Esto he encontrado usando Local Context Memory MCP.

Preguntas frecuentes

¿Para qué sirve el servidor MCP Local Context Memory MCP?

Local Context Memory MCP es un servidor MCP que permite a los clientes de IA compatibles conectarse a herramientas y contexto externos. En TypingMind, basta con añadir este servidor MCP una vez para que sus herramientas estén disponibles en tu espacio de trabajo de IA.

¿Puedo usar el servidor MCP Local Context Memory MCP con varios modelos de IA en TypingMind?

Sí. TypingMind conecta las herramientas MCP a nivel del espacio de trabajo, por lo que puedes usar Local Context Memory MCP con distintos modelos de IA, como Claude, ChatGPT, Gemini u otros que hayas configurado en TypingMind, sin configurar el servidor MCP por separado para cada modelo.

¿Por qué usar el conector MCP de Local Context Memory MCP con TypingMind?

TypingMind es una de las mejores interfaces de chat con LLM porque reúne varios modelos de IA, prompts, plugins, agentes de IA, claves de API y herramientas MCP en un solo espacio de trabajo. Con Local Context Memory MCP conectado, puedes usar sus herramientas MCP con tus modelos preferidos y mantener organizado tu flujo de trabajo de chat en TypingMind.

¿Cómo conecto el servidor MCP Local Context Memory MCP a TypingMind?

Local Context Memory MCP funciona a través del conector MCP local de TypingMind. Es la mejor opción cuando el servidor MCP necesita acceder a archivos locales, aplicaciones de escritorio, herramientas de línea de comandos o recursos privados de tu ordenador.

¿Qué herramientas ofrece el servidor MCP Local Context Memory MCP en TypingMind?

Local Context Memory MCP ofrece funciones MCP que puedes activar desde la página Plugins de TypingMind y usar en el chat o asignar a agentes de IA.

¿Tengo que compartir mis claves de API con TypingMind para usar el servidor MCP Local Context Memory MCP?

No. TypingMind prioriza el funcionamiento local y te permite mantener el control de tus proveedores de modelos, claves de API, prompts y configuración MCP. Si Local Context Memory MCP requiere autenticación, añade las cabeceras, los ajustes de OAuth o la configuración local necesarios para ese servidor MCP al crear la conexión.

Servidores MCP relacionados

Ver todos

Crea ya tu propio espacio de trabajo IA

Suscríbete a nuestro boletín para recibir avisos sobre nuevas funciones y próximos sorteos 👇