Logo di Memory Graph MCP Server

Memory Graph MCP Server

Community
aaronsb

An MCP server that provides persistent memory capabilities through a local knowledge graph, enabling AI assistants to maintain context across sessions with multiple storage backends.

Autoreaaronsb
Repositorymemory-graph
LinguaTypeScript
Fork
4
Stelle
22
Strumenti disponibili
0
Tipo di trasportostdio
Categorie
Link
  • Collega gli strumenti ai flussi di lavoro IA

    Memory Graph MCP Server mette a disposizione funzionalità MCP utilizzabili da client e agenti IA compatibili.

  • 0 strumenti disponibili

    Esplora le azioni richiamabili qui sotto, con nomi e descrizioni quando forniti dal server.

  • Configurazione pronta da copiare

    Usa gli esempi di installazione per configurare questo server nel tuo client MCP preferito.

  • Indicatori di interesse open source

    22 stelle e 4 fork nel repository collegato.

Memory Graph MCP Server

Note, this is somewhat superceded by Knowledge Graph - I hope you take a chance to check it out!

An MCP server that provides persistent memory capabilities through a local knowledge graph implementation. This server enables AI assistants to maintain context and information across chat sessions using a graph-based storage system.

Features

  • Domain-based memory organization for context isolation
  • Store and retrieve memories with content, tags, and metadata
  • Cross-domain memory references with relationship tracking
  • Memory domain transfer capability
  • Multiple storage backends (JSON, SQLite, and MariaDB)
  • Multiple transport protocols (STDIO and HTTP)
  • Full-text search capabilities with SQL-based storage backends
  • Advanced content search with fuzzy matching and regex support
  • Combine multiple search strategies (content, path, tags)
  • Flexible result sorting and relevance scoring
  • Graph traversal across domains and relationships
  • Mermaid graph visualization for memory connections
  • Docker and Docker Compose support

Documentation

Getting Started

Features

Core Concepts

Reference

Developer Documentation

Installation

Local Installation

bash
# Install dependencies
npm install

# Build the TypeScript code
npm run build

# Clean build directory
npm run clean

Docker Installation

The server is available as a Docker container from GitHub Container Registry:

bash
# Pull the image
docker pull ghcr.io/aaronsb/memory-graph:latest

# Or build locally
./scripts/build-local.sh

Usage

Docker Usage

Run the container with your desired configuration:

bash
# Using STDIO transport (default)
docker run -v /path/to/data:/app/data \
  -e MEMORY_DIR=/app/data \
  -e TRANSPORT_TYPE=STDIO \
  -e STORAGE_TYPE=sqlite \
  ghcr.io/aaronsb/memory-graph:latest

# Using HTTP transport
docker run -v /path/to/data:/app/data \
  -e MEMORY_DIR=/app/data \
  -e TRANSPORT_TYPE=HTTP \
  -e PORT=3000 \
  -e HOST=127.0.0.1 \
  -p 3000:3000 \
  ghcr.io/aaronsb/memory-graph:latest

# Using MariaDB storage
docker run -v /path/to/data:/app/data \
  --network=host \
  -e MEMORY_DIR=/app/data \
  -e STORAGE_TYPE=mariadb \
  -e MARIADB_HOST=localhost \
  -e MARIADB_PORT=3306 \
  -e MARIADB_USER=memory_user \
  -e MARIADB_PASSWORD=secure_password \
  -e MARIADB_DATABASE=memory_graph \
  ghcr.io/aaronsb/memory-graph:latest

Docker Compose

For convenience, a Docker Compose configuration is provided:

bash
# Start with Docker Compose
docker-compose up -d

# Stop services
docker-compose down

Local Usage

bash
# Start the server
npm start

# Run using custom configuration
MEMORY_DIR=/path/to/data STORAGE_TYPE=sqlite npm start

Configuration

The server can be configured using environment variables:

General Configuration

  • MEMORY_DIR: Directory to store memory files (default: ./data)
  • MEMORY_FILES: Comma-separated list of specific memory files to use
  • LOAD_ALL_FILES: Set to 'true' to load all JSON files in the storage directory
  • DEFAULT_PATH: Default path for storing memories
  • STRICT_MODE: Set to 'true' to ensure all logging goes to stderr, preventing interference with JSON-RPC communication on stdout

Storage Configuration

  • STORAGE_TYPE: Storage backend to use (json, sqlite, or mariadb, default: json)

MariaDB Configuration (when using STORAGE_TYPE=mariadb)

  • MARIADB_HOST: Database server hostname (default: localhost)
  • MARIADB_PORT: Database server port (default: 3306)
  • MARIADB_USER: Database username (default: root)
  • MARIADB_PASSWORD: Database password (default: empty)
  • MARIADB_DATABASE: Database name (default: memory_graph)
  • MARIADB_CONNECTION_LIMIT: Maximum number of connections in the pool (default: 10)

Transport Configuration

  • TRANSPORT_TYPE: Communication transport to use (STDIO or HTTP, default: STDIO)
  • PORT: Port number for HTTP transport (required when TRANSPORT_TYPE=HTTP)
  • HOST: Host address for HTTP transport (default: 127.0.0.1, only used when TRANSPORT_TYPE=HTTP)

MCP Configuration

To use this server with an AI assistant via MCP, add it to your MCP configuration file:

STDIO Transport (Default)

json
{
  "mcpServers": {
    "memory-graph": {
      "command": "node",
      "args": ["/path/to/memory-graph/build/index.js"],
      "env": {
        "MEMORY_DIR": "/path/to/memory/storage",
        "STORAGE_TYPE": "sqlite",
        "STRICT_MODE": "true"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

HTTP Transport

json
{
  "mcpServers": {
    "memory-graph": {
      "command": "node",
      "args": ["/path/to/memory-graph/build/index.js"],
      "env": {
        "MEMORY_DIR": "/path/to/memory/storage",
        "STORAGE_TYPE": "sqlite",
        "TRANSPORT_TYPE": "HTTP",
        "PORT": "3000",
        "STRICT_MODE": "true"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

Docker with MariaDB

json
{
  "mcpServers": {
    "memory-graph": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "--network=host",
        "-v", "/path/to/data:/app/data",
        "-e", "MEMORY_DIR=/app/data",
        "-e", "STORAGE_TYPE=mariadb",
        "-e", "MARIADB_HOST=localhost",
        "-e", "MARIADB_PORT=3306",
        "-e", "MARIADB_USER=memory_user",
        "-e", "MARIADB_PASSWORD=secure_password",
        "-e", "MARIADB_DATABASE=memory_graph",
        "-e", "STRICT_MODE=true",
        "ghcr.io/aaronsb/memory-graph:latest"
      ],
      "disabled": false,
      "autoApprove": []
    }
  }
}

Storage Options

The Memory Graph MCP supports three storage backends:

  • JSON: Simple file-based storage (default)

    • One JSON file per domain in the memories/ directory
    • Good for smaller datasets and simple deployments
    • Easy to inspect and manually edit if needed
  • SQLite: Database storage with improved performance

    • Single SQLite database file for all domains
    • Better performance for large datasets
    • Full-text search capabilities
    • More efficient memory usage
    • Good for local deployments
  • MariaDB: Production-ready database storage

    • Uses a MariaDB/MySQL database server
    • Ideal for large-scale deployments
    • Full-text search capabilities
    • Better scalability and concurrency support
    • Suitable for deployments with high load or multiple concurrent users

To switch between storage types, set the STORAGE_TYPE environment variable to json, sqlite, or mariadb.

For detailed information about storage options, including how to convert between formats, see Storage Overview and Converting Between Storage Types.

Available Memory Tools

The Memory Graph MCP provides the following tools:

Domain Management

  • select_domain: Switch to a different memory domain
  • list_domains: List all available memory domains
  • create_domain: Create a new memory domain

Memory Operations

  • store_memory: Store new information in the memory graph
  • recall_memories: Retrieve memories using various strategies
  • edit_memory: Edit an existing memory or move it to another domain
  • forget_memory: Remove a memory from the graph

Visualization

  • generate_mermaid_graph: Generate a visual representation of memory relationships

Search

  • search_memory_content: Full-text search capabilities (with SQLite and MariaDB backends)
  • traverse_memories: Explore connections between memories across domains

For detailed information about all tools and their parameters, see the Memory Tools Reference.

Project Structure

memory-graph/
├── src/
│   ├── graph/           # Knowledge graph implementation
│   ├── storage/         # Storage backends (JSON, SQLite, MariaDB)
│   ├── tools/           # MCP tool implementations
│   ├── types/           # TypeScript type definitions
│   └── index.ts         # Main server entry
├── data/                # Memory storage (created at runtime)
└── docs/                # Project documentation

Development

Building

bash
# Build the TypeScript code
npm run build

# Build local Docker image
./scripts/build-local.sh

Testing

bash
# Run all tests
npm test

# Run tests in watch mode
npm test:watch

Converting Between Storage Types

bash
# Convert from JSON to SQLite
npx ts-node scripts/convert-storage.ts json2sqlite /path/to/json/data /path/to/sqlite/file.db

# Convert from SQLite to JSON
npx ts-node scripts/convert-storage.ts sqlite2json /path/to/sqlite/file.db /path/to/json/data

# Convert from JSON to MariaDB
npx ts-node scripts/convert-storage.ts json2mariadb /path/to/json/data "mariadb://user:password@localhost:3306/memory_graph"

License

MIT

Installazione

TypingMind
{
  "mcpServers": {
    "aaronsb-memory-graph": {
      "command": "docker",
      "args": [
        "run",
        "-v",
        "/path/to/data:/app/data",
        "-e",
        "MEMORY_DIR=/app/data",
        "-e",
        "STORAGE_TYPE=sqlite",
        "-e",
        "STRICT_MODE=true",
        "ghcr.io/aaronsb/memory-graph:latest"
      ],
      "env": {
        "MEMORY_DIR": "<MEMORY_DIR>",
        "STORAGE_TYPE": "<STORAGE_TYPE>"
      }
    }
  }
}

Usa MCP Memory Graph MCP Server con più modelli IA

TypingMind collega gli strumenti MCP a livello di area di lavoro: una volta connesso Memory Graph MCP Server, puoi usarlo con diversi modelli IA in TypingMind, senza configurarlo separatamente per ogni modello. Questa integrazione MCP viene eseguita localmente sul tuo dispositivo tramite il connettore MCP di TypingMind.

Guida alla configurazione del connettore locale

Usa questo metodo quando il server MCP deve accedere a file locali, app o risorse private sul tuo computer.

1

Apri le impostazioni MCP

In TypingMind, vai su Impostazioni, Impostazioni avanzate, poi su Model Context Protocol e scegli Configura MCP.

  1. Apri TypingMind nel tuo browser.
  2. Fai clic sull'icona Impostazioni.
  3. Vai a Impostazioni avanzate.
  4. Apri la sezione Model Context Protocol.
  5. Fai clic su Configura MCP e scegli Questo dispositivo.
Schermata di configurazione del connettore MCP di TypingMind con Questo dispositivo selezionato
2

Esegui il comando del connettore

Scegli Questo dispositivo, copia il comando da TypingMind ed eseguilo nel terminale. Lascia il processo in esecuzione mentre usi MCP.

  1. Copia il comando di configurazione mostrato da TypingMind.
  2. Apri Terminale su macOS o Windows Terminal su Windows.
  3. Incolla ed esegui il comando.
  4. Conferma l'installazione del pacchetto se il terminale ti chiede di procedere.
  5. Tieni aperta la finestra del terminale con il processo in esecuzione mentre usi gli strumenti MCP.
3

Aggiungi Memory Graph MCP Server come server

Quando lo stato del connettore è Pronto, fai clic su Modifica server e incolla la configurazione del server MCP.

  1. Attendi che lo stato del connettore sia Pronto.
  2. Fai clic su Modifica server.
  3. Incolla la configurazione del server MCP di Memory Graph MCP Server.
  4. Salva l'elenco dei server.
  5. Aggiorna per verificare che il connettore sia ancora pronto.
Impostazioni MCP di TypingMind con un server attivo e il pulsante Modifica server
{
  "mcpServers": {
    "aaronsb-memory-graph": {
      "command": "npx",
      "args": [
        "-y",
        "memory-graph"
      ]
    }
  }
}
4

Usa la connessione con diversi modelli

Salva l'elenco dei server, apri Plugin, abilita gli strumenti MCP di Memory Graph MCP Server, poi seleziona un modello IA supportato in TypingMind e usa gli strumenti in chat o assegnali a un agente IA.

  1. Apri la pagina Plugin in TypingMind.
  2. Abilita gli strumenti MCP di Memory Graph MCP Server.
  3. Avvia una chat e scegli il modello IA che vuoi usare.
  4. Usa gli strumenti MCP in chat o assegnali a un agente IA.
  5. Passa a un altro modello IA quando serve, senza riconnettere MCP.
Chat di TypingMind che usa gli strumenti MCP abilitati con un modello IA selezionato
Puoi usare Memory Graph MCP Server per aiutarmi con questa attività?
Memory Graph MCP Server
Certo. Ho letto.
Ecco cosa ho trovato con Memory Graph MCP Server.

Domande frequenti

A cosa serve il server MCP Memory Graph MCP Server?

Memory Graph MCP Server è un server MCP che consente ai client IA compatibili di accedere a strumenti e informazioni di contesto esterni. In TypingMind puoi aggiungere questo server MCP una sola volta e rendere disponibili i suoi strumenti nella tua area di lavoro IA.

Posso usare Memory Graph MCP Server MCP con più modelli IA in TypingMind?

Sì. TypingMind collega gli strumenti MCP a livello di area di lavoro, quindi puoi usare Memory Graph MCP Server con diversi modelli IA come Claude, ChatGPT, Gemini o altri modelli che hai configurato in TypingMind, senza dover configurare il server MCP separatamente per ogni modello.

Perché usare il connettore MCP Memory Graph MCP Server con TypingMind?

TypingMind è una delle migliori interfacce per chattare con gli LLM perché riunisce più modelli IA, prompt, plugin, agenti IA, chiavi API e strumenti MCP in un'unica area di lavoro. Collegando Memory Graph MCP Server, puoi usare i suoi strumenti MCP con i tuoi modelli preferiti e mantenere organizzato il tuo flusso di lavoro in chat su TypingMind.

Come collego Memory Graph MCP Server MCP a TypingMind?

Memory Graph MCP Server funziona tramite il connettore MCP locale di TypingMind. È la soluzione ideale quando il server MCP deve accedere a file locali, app desktop, strumenti da riga di comando o risorse private sul tuo computer.

Quali strumenti offre Memory Graph MCP Server MCP in TypingMind?

Memory Graph MCP Server mette a disposizione funzionalità MCP che puoi attivare dalla pagina Plugin di TypingMind e usare in chat o assegnare agli agenti IA.

Devo condividere le mie chiavi API con TypingMind per usare Memory Graph MCP Server MCP?

No. TypingMind privilegia il funzionamento in locale e ti permette di mantenere il controllo su fornitori di modelli, chiavi API, prompt e configurazione MCP. Se Memory Graph MCP Server richiede l'autenticazione, aggiungi le intestazioni, le impostazioni OAuth o la configurazione locale necessarie per quel server MCP quando crei la connessione.

Server MCP correlati

Vedi tutti

Crea subito la tua area di lavoro IA

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇