What kunickiaj/codemem MCP server does
kunickiaj/codemem provides persistent memory for coding work across sessions, machines, and teammates. It is designed for OpenCode, Claude Code, Codex, and the Pi coding agent, using a project-scoped store so multiple agents can work from the same repository knowledge. Captured memories can include decisions, failed approaches, discoveries, and repository-specific pitfalls.
The system is local-first: memories are stored in SQLite on the developer’s machine. Optional peer-to-peer synchronization can move selected project memories between machines, and project knowledge can be shared with a teammate or Team. A local web viewer at http://localhost:38888 lets developers inspect memories, sessions, and observer output.
How it works
The OpenCode plugin observes coding activity and automatically adds relevant memory to later prompts. OpenCode 1 and OpenCode 2 use the plugin for capture and recall; OpenCode 2 support is marked beta. Existing context is not injected again when it has not changed. Claude Code has plugin support, while Pi provides session capture, recall, and native memory tools without requiring MCP.
Retrieval combines SQLite FTS5 BM25 lexical search with sqlite-vec semantic search, then merges and reranks the results. An observer converts captured activity into memories through a configured model provider. Although storage is local, observer processing can send captured context to the selected provider and may incur charges or consume plan usage.
Setup and configuration
The documented prerequisites are Node.js 24.15 or newer and npm or pnpm. Native database support covers macOS x64 and arm64, Linux x64 and arm64, and Windows x64; 32-bit targets are not supported. On Linux, set ONNXRUNTIME_NODE_INSTALL=skip before the first package installation to avoid downloading the unused GPU provider while retaining CPU inference.
For OpenCode, run npx -y codemem setup --opencode-only, restart OpenCode, and verify with npx -y codemem stats or npx -y codemem db raw-events-status. A durable command-line installation is optional and can be installed globally with npm. Keyword-only operation is available by omitting optional packages and setting CODEMEM_EMBEDDING_DISABLED=1 in every Codemem process.
Observer settings can use an OpenCode account, an API key, or a local Claude/Codex session. Explicit connections do not fall back to another account. The setup command writes one OpenCode plugin entry intended to work across the supported host generations.
Tools and capabilities
The kunickiaj/codemem MCP server exposes status and usage checks including mem-status, mem-recent, and mem-stats through the OpenCode integration. Its broader capabilities include:
- Capturing user and assistant messages, terminal activity, tool results, and session lifecycle events in OpenCode 2.
- Recalling relevant project memories automatically during new prompts.
- Sharing one project-scoped store across OpenCode, Claude Code, Codex, and Pi.
- Synchronizing selected project memory between machines.
- Browsing memories and processing output in the local viewer.
- Serving an OAuth-protected Streamable HTTP MCP endpoint for configured remote clients in advanced self-hosted deployments.
Limitations and notes
Remote MCP access is described as an advanced, single-user self-hosting option rather than the default setup. The localhost viewer should remain private. OpenCode 2 support is beta, and OpenCode requires version 1.18.29 or newer. The README does not identify arbitrary MCP clients as supported; it specifically names Claude Code and Codex among its coding-agent integrations.
The observer is not necessarily local: captured context is sent to the configured model provider. Embedding support can be disabled for FTS5-only retrieval, which removes semantic search. Native database support excludes 32-bit platforms, including Linux armv7.