gemdex-mcp
v1.0.54
Published
MCP memory layer for AI coding agents — save/recall/update memories via on-device MLX embeddings + embedded LanceDB
Downloads
1,484
Readme
gemdex-mcp
Local memory for AI coding agents: on-device EmbeddingGemma 2 embeddings via MLX, embedded LanceDB, seven stdio MCP tools, and a localhost desktop sidecar. Part of Gemdex.
Install
Requires Node.js ≥24, native arm64 macOS 14+ (Apple Silicon, not Rosetta).
npx gemdex-mcp install
claude mcp add gemdex -- npx -y gemdex-mcp@latestInstallation explicitly downloads managed Python/MLX and pinned
mlx-community/embeddinggemma-2-8bit weights, about 1.45 GB to download and 1.9 GB
on disk. No preinstalled Python,
uv, Homebrew, compiler, or model tooling is needed. Embeddings run offline
after installation. There is no API key, provider switch, or remote backend
setting. Before installation all seven tools return setup guidance.
Other MCP clients can use:
{
"mcpServers": {
"gemdex": {
"command": "npx",
"args": ["-y", "gemdex-mcp@latest"]
}
}
}The local pool lives at ~/.gemdex/lance, with attachment bytes at
~/.gemdex/blobs. For a shared self-hosted pool, connect your agent directly
to the Streamable HTTP MCP endpoint. The npx package
and desktop sidecar manage only the local pool.
Upgrade from earlier releases
From v1.0.53: update clients sharing this library, then run npx gemdex-mcp@latest status. The full runtime from v1.0.52 is reused if present; run npx gemdex-mcp@latest install only if missing. If the status reports pending memories, npx gemdex-mcp@latest migrate restores missing media search entries from their saved bytes. The text-only release did not delete the files. Existing text vectors, new memories and edits are retained. Do not delete the library or replace it with an old export. See the backup and recovery guide.
Earlier releases stored BGE-M3 vectors in memories_mlx_bge_m3_8bit or Gemini
vectors in memories. After upgrading, run npx gemdex-mcp install (the
EmbeddingGemma 2 model is a new download), then npx gemdex-mcp migrate to
re-embed both older tables into memories_mlx_embeddinggemma2_8bit
(768 dimensions). Installation alone does not migrate. Progress is reported and
migration is safe to rerun.
Recall and hygiene refuse to run while legacy rows remain, avoiding incomplete results. List/get/update/delete/export remain available after installation. Migration preserves text, titles, timestamps and attachment blobs, and embeds legacy images, audio and video from their blobs. Legacy PDFs stay readable but unsearchable.
CLI
| Command | Purpose |
|---------|---------|
| npx gemdex-mcp install | Download and verify runtime/model |
| npx gemdex-mcp migrate | Restore missing media vectors and migrate legacy indexes |
| npx gemdex-mcp status | Show model, count of memories needing repair, store and inference readiness |
| npx gemdex-mcp backfill-transcripts [--force] [--dry-run] | Attach transcript files referenced by existing digest footers |
| npx gemdex-mcp ingest-history [--source claude\|factory\|codex\|antigravity\|PATH]... [--model haiku] [--dry-run] | Digest new local sessions |
Backfill skips missing files with a message. Ingestion defaults to detected
preset folders and processes only sessions absent from its successful-ingest
ledger. Changed sessions already in the ledger are skipped. --dry-run
scans and estimates; it does not call the model.
Chat-history ingestion and hygiene
Install Claude Code and sign in with claude auth login. Gemdex uses that
existing login for isolated claude -p --model haiku structured-JSON calls:
no tools, user settings, skills, MCP servers, hooks, CLAUDE.md, or session
persistence, and a temporary working directory.
Local ingestion and hygiene use concurrency four, at most three total attempts,
and a five-minute timeout per inference call. Estimates use Haiku list prices
($1 input / $5 output per million tokens). With a Claude subscription, usage
counts against the plan's limits rather than being billed per token.
Readiness is ready | missing | unauthenticated | error; the sidecar also
reports checking during a probe.
The digest text is embedded locally; its cleaned transcript is stored as a non-embedded attachment. See ingestion paths for the distinction between local ingestion and server-side uploads.
Tools
| Tool | Behavior |
|------|----------|
| save_memory | Save text and/or image, audio, video and text-file attachments; return id and title |
| recall | Text query and/or example media files, fixed top-10 title index, never full bodies |
| get_memory | Open a full parent by id; increment recall stats |
| update_memory | Replace content or apply literal edits; preserve omitted fields |
| report_outcome | Record worked, failed, or stale in the client stats ledger |
| read_attachment | Read an attachment as UTF-8 text, a viewable image, or base64 |
| delete_memory | Permanently delete a memory and clear its client stats |
Prefer updates for corrections and delete only when the memory should be gone. HTTP MCP is a separate six-tool surface without delete.
Attachments are a local path (preferred) or inline base64 data and
mimeType. Images (.png .jpg .webp .gif), audio (.wav .mp3 .m4a
.flac .aac .aiff, up to 5 minutes) and video (.mp4 .mov .m4v .webm)
are embedded on-device, one row per file, in the same space as text. Text files
(.txt .json .jsonl .ndjson) are stored as non-embedded blobs. Per
memory: 8 images, 4 audio files, 2 videos, 4 text files, 100 MiB each. A
caption is optional and adds keyword matching. PDFs are not supported.
recall accepts the same image/audio/video items as attachments to search by
example, with or without query. read_attachment returns PNG/JPEG/WebP/GIF
images up to 5 MB as MCP image content. Omitting attachments on update
preserves them (and re-embeds their media); attachments:[] clears them.
Desktop sidecar
npx gemdex-mcp serve --port 0 starts the local HTTP API, bound to
127.0.0.1. The desktop app spawns it and reads the
PORT=<n> TOKEN=<hex> handshake. Model install/migration are explicit
asynchronous settings actions; Claude Code readiness gates ingestion/hygiene,
not ordinary memory reads. See the
sidecar contract for routes and status fields.
For large backups, use authenticated GET /export.jsonl rather than the
JSON {records} endpoint at /export. Each line is a portable memory with its
original attachments. X-Gemdex-Memory-Count gives the expected line count.
Save to a temporary file: replace your backup only if the transfer finishes and
all expected lines end in a newline. While exporting, sidecar writes wait and
other Gemdex processes must retry writes to the same library. Cancelling or
quitting the app releases the backup lock.
Environment
| Variable | Purpose |
|----------|---------|
| LANCEDB_PATH | Override ~/.gemdex/lance |
| GEMDEX_CLAUDE_PATH | Override Claude binary discovery for ingestion/hygiene |
| HYBRID_MODE | false disables BM25; default true |
| GEMDEX_SERVE_PORT | Sidecar port; default auto/0 |
| GEMDEX_WEBVIEW_ORIGIN | Allowed sidecar Origin; default zero://app |
| GEMDEX_STATS_PATH | Override ~/.gemdex/stats.json |
| GEMDEX_TRUST_RANKING | true enables outcome-weighted title ranking |
| GEMDEX_SIMILAR_ON_SAVE | false disables similarity advisories |
| GEMDEX_SIMILAR_THRESHOLD | Similarity threshold in (0,1], default 0.93 |
MCP Registry
mcp-name: io.github.nikships/gemdex
License
MIT
