Skip to main content
Glama
identity-storage-mcp

identity-storage-mcp

by MikSkrzyp

identity-storage

Portable, auditable long-term memory for AI agents. Runs as a local MCP server backed by a single SQLite file. Agents recall memories through MCP tools; a Stop hook stores session transcripts automatically — no agent discipline required.

Why

Agents like Claude Code are stateless between sessions. identity-storage gives them a memory that survives restarts and stays fully inspectable — no ORM, no migration framework, no hidden state. Point sqlite3 at the file and read everything.

Related MCP server: misMEM

Install

The package is not on PyPI yet. Install directly from GitHub:

pip install git+https://github.com/MikSkrzyp/identity-storage-mcp.git

Or run it without installing:

uvx --from git+https://github.com/MikSkrzyp/identity-storage-mcp.git identity-storage-mcp

This installs one console script:

  • identity-storage-mcp — the MCP server (agent calls tools through it)

Configure Claude Code

1. Add the MCP server

claude mcp add identity-storage -s user -- uvx --from git+https://github.com/MikSkrzyp/identity-storage-mcp identity-storage-mcp

2. Add memory instructions to CLAUDE.md

Add this to ~/.claude/CLAUDE.md (global, all projects) or your project's CLAUDE.md:

# Memory — MANDATORY

identity-storage MCP is connected. Follow these rules EVERY session:

1. SEARCH: Call memory_search when the user references past work or you need
   context from previous sessions. Pass the user's prompt as query.

2. STORE: Call memory_store after every non-trivial turn:
   - episodic: events/actions (fixed bug, refactored module, user asked for X)
   - semantic: durable facts (user preferences, project info, tech stack)
   - procedural: how-tos (commands, steps, procedures)
   One memory per distinct thing. Skip idle chat.

3. SESSION END: When the user says exit/quit, store anything not yet saved.

Forgetting to store = permanent loss of the session.
Forgetting to search = working blind.

Configure opencode

1. Add the MCP server

Add to ~/.config/opencode/opencode.jsonc:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "identity-storage": {
      "type": "local",
      "command": [
        "uvx",
        "--from",
        "git+https://github.com/MikSkrzyp/identity-storage-mcp",
        "identity-storage-mcp"
      ]
    }
  }
}

2. Add memory instructions to AGENTS.md

Add the same memory instructions (from the Claude Code section above) to ~/.config/opencode/AGENTS.md (global) or your project's AGENTS.md.

Tools

The agent sees three tools, each scoped by memory_type (episodic, semantic, procedural, personality, emotional):

Tool

Purpose

memory_search

Full-text search via FTS5 — when the user references past work

memory_store

Store a memory with type classification (episodic/semantic/procedural)

memory_recall

Browse by type, tags, and time window (newest first)

See docs/usage.md for the full input/output schemas.

Configuration

Env var

Default

Purpose

IDENTITY_STORAGE_DB

~/.identity-storage/memory.db

SQLite database file path

The parent directory is created on first run. The schema is applied idempotently on every start, so pointing at a fresh path is safe.

Audit

The database is a regular SQLite file. Read it while the server runs (WAL mode allows concurrent reads):

sqlite3 ~/.identity-storage/memory.db
SELECT id, created_at, content FROM memory
WHERE type='episodic'
ORDER BY created_at DESC;

SELECT * FROM memory
WHERE EXISTS (SELECT 1 FROM json_each(tags) WHERE value='auth');

SELECT m.*
FROM memory m
JOIN memory_fts f ON f.rowid = m.rowid
WHERE f.content MATCH 'auth bug'
ORDER BY rank;

The schema lives in schemas/schema.sql and is the single source of truth. Run .schema in the sqlite3 CLI to see exactly what is in the file.

Other clients

Claude Code and opencode are supported. Both use the same MCP server and the same memory database. For other MCP-compatible clients (Codex, Cursor, etc.), add the MCP server per their docs and add the memory instructions to their equivalent of CLAUDE.md (e.g. .cursorrules for Cursor).

Documentation

Status

Alpha. The MCP contract and the SQLite schema are stable for the episodic case. Semantic memory, procedural memory, consolidation, and embeddings are planned — see docs/architecture.md for the roadmap shape.

License

MIT

Available Tools

3 tools
memory_recallA

Browse memories of one type, newest first. Filter by tags and time window. Use for 'what did I do recently' or 'what happened in this session'. Not for per-turn recall — use memory_search for that.

Inputs: input (required). Returns: records

memory_storeA

Store a memory. You MUST call this after every non-trivial turn. Choose the type based on what you are saving:

  • episodic: an event that happened — 'fixed the login bug in auth.py', 'user asked for a tic-tac-toe game', 'refactored auth module to use JWT'. Concrete actions and outcomes.

  • semantic: a durable fact that stays true — 'user prefers Python 3.12', 'project uses pytest', 'auth uses JWT', 'user communicates in Polish'. Knowledge about the user or project.

  • procedural: a how-to with steps — 'run tests with pytest -x', 'deploy via npm run build && rsync', 'start dev server: python -m backend.main'. Steps to accomplish something.

Set confidence below 1.0 for inferences, assumptions, or guesses. Use tags for filtering (e.g. project name, topic). Episodic payload keys: session_id, agent, task, outcome, parent_id, metadata. Store one memory per distinct thing. ALWAYS skip idle chat, greetings, and trivial responses. Forgetting to store = permanent loss of the session.

Inputs: input (required). Returns: id, created_at, memory_type

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.4/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: memory_recall for browsing by tags/time, memory_search for content search, and memory_store for saving memories. No ambiguity between them.

    Naming Consistency5/5

    All tools follow a consistent 'memory_' prefix with a verb (recall, search, store), making the tool names predictable and easy to understand.

    Tool Count4/5

    With 3 tools, the set feels slightly minimal but appropriate for a targeted memory storage and retrieval system. The count is reasonable for the scope.

    Completeness3/5

    The tool surface covers storing and two retrieval methods, but lacks delete or update operations, which are notable gaps for a complete memory lifecycle.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      F
      maintenance
      Local-first, auditable memory for AI agents. Provides durable context for MCP hosts with SQLite storage, CLI, and MCP tools for memory management.
      2
      Apache 2.0
    • A
      license
      Not graded
      quality
      B
      maintenance
      Provides persistent, cooperative memory for LLMs via MCP, with SQLite storage and tools for capturing, recalling, consolidating, crystallizing, and forgetting memories across sessions.
      4
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Provides persistent, searchable memory for AI agents across any MCP-compatible client, storing project context, user preferences, and session learnings locally in SQLite with tools to save, retrieve, search, and manage them.
      12
      9 npm
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables coding agents to store, recall, and manage persistent memory across sessions through MCP tools, with reviewable handoffs and SQLite-backed local storage.
      1
      MIT