Skip to content
Conduit

mcp server

mnemo

MCP memory server for AI assistants written in Go

kyungw00k/mnemocommunitylistedunreviewed

Set up

Runs on your computer. Pick your agent and operating system.

This project does not publish an install method we can turn into a config. Follow the README instead.

README

synced Oct 23, 2026

Persistent MCP memory server for Claude Code, opencode, and Codex CLI — single Go binary, vector search in SQLite and PostgreSQL.


Quick Start

# Install
go install github.com/kyungw00k/mnemo/cmd/mnemo@latest

Memory is stored at ~/.mnemo/memory.db.

When mnemo starts as an MCP server, it automatically detects Claude Code, opencode, and Codex CLI and registers itself — no manual configuration needed.


Setup

Claude Code

Auto-install (recommended) — just add mnemo as an MCP server and hooks are installed automatically on first run:

{
  "mcpServers": {
    "mnemo": {
      "command": "mnemo",
      "env": { "TRANSPORT": "stdio" }
    }
  }
}

Manual hook install:

mnemo hook install          # installs hooks into ~/.claude/settings.json
mnemo hook install --dry-run    # preview changes without writing
mnemo hook install --uninstall  # remove hooks

Hooks installed:

EventTriggerAction
SessionStartstartup / resume / compactInject recent decisions and notes as context
PreCompactbefore context compactionSave session snapshot to survive compaction
PostToolUseafter Bash commandsRecord build/test results as observations
Stopsession endSave session note and extract key facts

opencode

Add mnemo as an MCP server in ~/.config/opencode/opencode.json:

{
  "mcp": {
    "mnemo": {
      "type": "local",
      "command": ["mnemo"],
      "enabled": true
    }
  },
  "instructions": ["~/.config/opencode/mnemo.md"]
}

Or simply start mnemo as an MCP server — it auto-detects opencode and configures itself.

Codex CLI

Add mnemo as an MCP server in ~/.codex/config.toml:

[mcp_servers.mnemo]
command = "mnemo"
args = []
enabled = true

Or simply start mnemo as an MCP server — it auto-detects Codex and configures itself (also injects memory instructions into ~/.codex/AGENTS.md).

Dashboard

mnemo dashboard          # opens http://localhost:8765
mnemo dashboard --port 9000

Installation

Pre-built binary (recommended):

curl -L https://github.com/kyungw00k/mnemo/releases/latest/download/mnemo_darwin_arm64.tar.gz | tar xz
sudo mv mnemo /usr/local/bin/

Go install:

go install github.com/kyungw00k/mnemo/cmd/mnemo@latest

Docker:

docker run -d --name mnemo \
  -p 8765:8765 \
  -v ~/.mnemo:/root/.mnemo \
  -e TRANSPORT=sse \
  ghcr.io/kyungw00k/mnemo:latest
docker run -d --name mnemo \
  -p 8765:8765 \
  -e DB_URL=postgres://postgres:postgres@host.docker.internal:5432/mnemo \
  -e EMBEDDING_BASE_URL=http://host.docker.internal:11434/v1 \
  -e TRANSPORT=sse \
  ghcr.io/kyungw00k/mnemo:latest

Build from source (requires CGO):

git clone https://github.com/kyungw00k/mnemo.git
cd mnemo
make build

Configuration

VariableDefaultDescription
DB_URLsqlite://~/.mnemo/memory.dbDatabase (SQLite or PostgreSQL)
TRANSPORTbothstdio, sse, or both
SSE_PORT8765HTTP port for SSE server
EMBEDDING_BASE_URLhttp://localhost:11434/v1OpenAI-compatible embeddings endpoint
EMBEDDING_API_KEY(empty)API key (empty for local Ollama/LM Studio)
EMBEDDING_MODELnomic-embed-textEmbedding model name
EMBEDDING_DIMENSIONS768Vector dimensions
AUTO_INSTALL_HOOKStrueSet to false to disable auto-configuration
VariableDefaultDescription
HOST_ID<os.Hostname()>Memory isolation key (for Docker)
ENABLE_GIT_CONTEXTtrueAuto-detect git remote for project tagging
ENABLE_AUTO_EXTRACTfalseLLM-based fact extraction on session-end
MEMORY_TTL_DAYS0 (off)Auto-expire memories after N days
EXTRACT_LLM_BASE_URL(same as EMBEDDING)LLM endpoint for extraction
EXTRACT_LLM_MODELgpt-4.1-nanoModel name for extraction

Dashboard

mnemo dashboard          # opens http://localhost:8765
mnemo dashboard --port 9000

Features: Browse memories/notes, full-text search, markdown rendering, detail view modals, knowledge graph visualization.


CLI Subcommands

# Hook management (Claude Code)
mnemo hook install           # auto-configure ~/.claude/settings.json
mnemo hook install --dry-run
mnemo hook install --uninstall

# Hooks (called automatically by Claude Code)
mnemo hook session-start     # returns additionalContext with recent decisions + notes
mnemo hook session-end       # saves session note; extracts facts if ENABLE_AUTO_EXTRACT=true
mnemo hook observe           # records Bash tool results as observations
mnemo hook pre-compact       # saves context snapshot before compaction

# Interactive
mnemo search "authentication strategy"
mnemo search "database" --category decision --limit 5
mnemo save decision auth_strategy "JWT with refresh tokens"

# Dashboard
mnemo dashboard
mnemo dashboard --port 9000

Features

  • Dual database: SQLite (sqlite-vec) or PostgreSQL (pgvector) for vector search
  • OpenAI-compatible embeddings: Works with Ollama, LM Studio, OpenAI, or any /v1/embeddings endpoint
  • Dual transport: stdio (per-session) and SSE (persistent HTTP) — run both simultaneously
  • Auto-configuration: Detects Claude Code, opencode, and Codex CLI on first run and self-configures
  • Hook automation: Session-start context injection, pre-compact snapshots, session-end note saving, build observation
  • Git context: Auto-detects git remote origin for project tagging (on by default)
  • Host isolation: Memories scoped per machine via HOST_ID
  • Single static binary: No runtime dependencies (CGO at build time only)

MCP Tools

ToolDescription
memory_saveSave key-value memory
memory_searchSearch by vector similarity or text
memory_listList memories by category
memory_deleteDelete memory
note_saveSave structured note with tags
note_searchSearch notes
note_listList notes by project
note_deleteDelete note
db_queryRead-only SELECT (max 100 rows)
db_executeWrite statements (INSERT/UPDATE/DELETE only)
ToolEnv Var
memory_extractENABLE_AUTO_EXTRACT=true
memory_cleanupMEMORY_TTL_DAYS>0
memory_exportAlways available
memory_importAlways available

License

MIT

↑↓ navigate openesc close