Multi-Memory MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add multi-memory -- npx github:DanNsk/multi-memory-mcp
README.md

A multi-category knowledge graph memory server using SQLite for persistent storage

Multi-Memory MCP Server

A multi-category knowledge graph memory server using SQLite for persistent storage. Organize memories into isolated contexts for different purposes (work, personal, projects, etc.).

Based on @modelcontextprotocol/server-memory with enhancements:

  • SQLite database storage with proper indexing and transactions
  • Multi-category support with isolated memory contexts
  • LRU connection cache (prevents memory leaks)
  • ID-based operations - all objects have unique IDs for precise operations
  • Dual identification - use ID or name/type composite key
  • Custom properties - JSON properties on entities, observations, and relations (searchable)
  • Override mode - update existing records instead of skipping duplicates
  • SQL injection protection
  • Full test coverage (141 tests)

Quick Start

Run Directly with npx (No Installation Required)

The fastest way to use multi-memory-mcp is to run it directly from GitHub using npx:

npx github:DanNsk/multi-memory-mcp

This will download, build, and run the server automatically. Perfect for trying it out or using in Claude Desktop config:

{
  "mcpServers": {
    "multi-memory": {
      "command": "npx",
      "args": ["github:DanNsk/multi-memory-mcp"],
      "env": {
        "MEMORY_BASE_DIR": "/path/to/.memory",
        "DEFAULT_CATEGORY": "default"
      }
    }
  }
}

Installation (Local Development)

git clone https://github.com/DanNsk/multi-memory-mcp
cd multi-memory-mcp
npm install
npm run build

Configuration

Add to Claude Desktop config:

Config file locations:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

Using npx (recommended):

{
  "mcpServers": {
    "multi-memory": {
      "command": "npx",
      "args": ["github:DanNsk/multi-memory-mcp"],
      "env": {
        "MEMORY_BASE_DIR": "/Users/yourname/.memory",
        "DEFAULT_CATEGORY": "default"
      }
    }
  }
}

Using local installation (macOS/Linux):

{
  "mcpServers": {
    "multi-memory": {
      "command": "node",
      "args": ["/absolute/path/to/multi-memory-mcp/dist/index.js"],
      "env": {
        "MEMORY_BASE_DIR": "/Users/yourname/.memory",
        "DEFAULT_CATEGORY": "default"
      }
    }
  }
}

Using local installation (Windows):

{
  "mcpServers": {
    "multi-memory": {
      "command": "node",
      "args": ["C:\\path\\to\\multi-memory-mcp\\dist\\index.js"],
      "env": {
        "MEMORY_BASE_DIR": "C:\\Users\\yourname\\.memory",
        "DEFAULT_CATEGORY": "default"
      }
    }
  }
}

Environment Variables

  • MEMORY_BASE_DIR: Base directory for all memory categories (default: .aim in current working directory)
  • DEFAULT_CATEGORY: Default category when none specified (default: "default")
  • SERIALIZATION_FORMAT: Output format for tool responses (default: "json")
    • json - Standard JSON with 2-space indentation
    • toon - TOON (Token-Oriented Object Notation) - compact format optimized for LLMs with 30-60% fewer tokens

TOON Format

When SERIALIZATION_FORMAT=toon, responses use TOON format which is more token-efficient for LLM contexts.

Structure:

  • Objects: key: value with 2-space indentation for nesting
  • Arrays: name[count]{field1,field2}: followed by comma-separated rows
  • Primitives: unquoted unless containing special characters

Escaping rules (only these escape sequences are valid):

  • \\ - backslash
  • \" - double quote
  • \n - newline
  • \r - carriage return
  • \t - tab

Quoting required when: empty string, leading/trailing spaces, matches true/false/null, numeric, or contains : " \ [ ] { } ,

Example JSON vs TOON:

JSON (standard):

{
  "entities": [
    {"id": "1", "name": "AuthService", "entityType": "module", "observations": []}
  ]
}

TOON (compact):

entities[1]{id,name,entityType,observations}:
  1,AuthService,module,[]

See TOON specification for full format details.

Database Schema

Each category stores data in a separate SQLite database with the following schema:

Tables

`entities`

Primary storage for graph nodes.

Column Type Description
id INTEGER PRIMARY KEY AUTOINCREMENT Unique entity identifier
name TEXT NOT NULL Entity name
entity_type TEXT NOT NULL Entity classification type
properties TEXT JSON properties (searchable)
created_at INTEGER Unix timestamp of creation
updated_at INTEGER Unix timestamp of last update

Unique Constraint: (name, entity_type) - entities are identified by name+type combination

`observations`

Facts and notes associated with entities.

Column Type Description
id INTEGE

Environment Variables

MEMORY_BASE_DIRBase directory for all memory categories
DEFAULT_CATEGORYDefault category when none specified
SERIALIZATION_FORMATOutput format for tool responses (json or toon)

Configuration

claude_desktop_config.json
{"mcpServers": {"multi-memory": {"command": "npx", "args": ["github:DanNsk/multi-memory-mcp"], "env": {"MEMORY_BASE_DIR": "/path/to/.memory", "DEFAULT_CATEGORY": "default"}}}}

Try it

Create a new entity for 'Project Alpha' in the 'work' category.
Add an observation to 'Project Alpha' noting that the deadline is next Friday.
List all entities currently stored in the 'personal' category.
Update the properties of the 'AuthService' entity to include the current version number.

Frequently Asked Questions

What are the key features of Multi-Memory MCP Server?

SQLite-based persistent storage with proper indexing and transactions. Multi-category support for isolated memory contexts. ID-based operations for precise entity and relation management. Token-efficient TOON serialization format for LLM optimization. Custom JSON properties on entities, observations, and relations.

What can I use Multi-Memory MCP Server for?

Organizing project-specific notes and facts separately from personal tasks. Maintaining a persistent knowledge graph of software modules and their relationships. Reducing token usage in long-running LLM sessions using the TOON format. Building a searchable database of facts that persists across different Claude sessions.

How do I install Multi-Memory MCP Server?

Install Multi-Memory MCP Server by running: npx github:DanNsk/multi-memory-mcp

What MCP clients work with Multi-Memory MCP Server?

Multi-Memory MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Multi-Memory MCP Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare