Self-hosted lemma persistent-memory MCP, exposed over HTTP for remote MCP clients (e.g. Claude Code on multiple machines sharing one memory DB).
lemma speaks MCP only over stdio, so
supergateway bridges it to Streamable HTTP at /mcp.
The image bakes in lemma + build tools, so better-sqlite3 compiles at build time and lemma starts
instantly per session (no npx cold start).
- Build this repo's
Dockerfile(ordocker-compose.yml). Container port 8000. - Mount a persistent volume at
/data(lemma's DB lives at/data/.lemma/lemma.dbviaHOME=/data). - Add a domain with TLS and a basicAuth middleware (supergateway has no inbound auth).
B64=$(printf 'user:password' | base64)
claude mcp add --transport http --scope user lemma https://your-host/mcp -H "Authorization: Basic $B64"