mnemex — Claude Code MCP server: what it does, how to install
An MCP server that keeps memories between sessions: they fade when unused and hold longer each time you bring them up again.
claude mcp add --env MNEMEX_STORAGE_PATH=<MNEMEX_STORAGE_PATH> --env LTM_VAULT_PATH=<LTM_VAULT_PATH> --env MNEMEX_DECAY_MODEL=<MNEMEX_DECAY_MODEL> --env MNEMEX_PL_HALFLIFE_DAYS=<MNEMEX_PL_HALFLIFE_DAYS> --transport stdio mnemex -- uvx mnemexWhat mnemex does
mnemex gives an assistant memory that outlives a single conversation. Say you prefer dark mode, and the fact is stored without any special command. Leave it alone and the record weakens; return to it often and it sticks around. Scoring weighs how recently and how often a memory was touched, plus how important it is.
Storage runs in two layers. Short-term entries live in JSONL or SQLite, long-term ones become Markdown files with YAML metadata and wikilinks aimed at Obsidian. Everything stays on your machine. The package runs through uvx mnemex and needs Python 3.10+.
Treat it as a research proof of concept rather than something to run in production: breaking changes are possible and there is no stability or support guarantee. The codebase started life as mnemex, which remains frozen on PyPI at 0.6.0, so the server name in every install command is still mnemex.
What it helps with
- stop repeating your preferences at the start of every session
- keep an architecture decision and recall it a week later
- flag a critical fact so it never fades
- keep memory in plain files you can read and version in git
- export stored memories to Markdown
Example prompts for the agent
- Remember that I use TypeScript and dark mode in this project.
- What do you remember about my stack preferences?
- Mark this as important: deploys only go through staging.
How to install mnemex
Platform CLI
claude mcp add --env MNEMEX_STORAGE_PATH=<MNEMEX_STORAGE_PATH> --env LTM_VAULT_PATH=<LTM_VAULT_PATH> --env MNEMEX_DECAY_MODEL=<MNEMEX_DECAY_MODEL> --env MNEMEX_PL_HALFLIFE_DAYS=<MNEMEX_PL_HALFLIFE_DAYS> --transport stdio mnemex -- uvx mnemexReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from mnemex <command>
Platform CLI
codex mcp add mnemex --env MNEMEX_STORAGE_PATH=<MNEMEX_STORAGE_PATH> --env LTM_VAULT_PATH=<LTM_VAULT_PATH> --env MNEMEX_DECAY_MODEL=<MNEMEX_DECAY_MODEL> --env MNEMEX_PL_HALFLIFE_DAYS=<MNEMEX_PL_HALFLIFE_DAYS> -- uvx mnemexReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from mnemex <command>
Config file
{
"mcpServers": {
"mnemex": {
"command": "uvx",
"args": [
"mnemex"
],
"env": {
"MNEMEX_STORAGE_PATH": "<MNEMEX_STORAGE_PATH>",
"LTM_VAULT_PATH": "<LTM_VAULT_PATH>",
"MNEMEX_DECAY_MODEL": "<MNEMEX_DECAY_MODEL>",
"MNEMEX_PL_HALFLIFE_DAYS": "<MNEMEX_PL_HALFLIFE_DAYS>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from mnemex <command>
Config file
{
"servers": {
"mnemex": {
"type": "stdio",
"command": "uvx",
"args": [
"mnemex"
],
"env": {
"MNEMEX_STORAGE_PATH": "<MNEMEX_STORAGE_PATH>",
"LTM_VAULT_PATH": "<LTM_VAULT_PATH>",
"MNEMEX_DECAY_MODEL": "<MNEMEX_DECAY_MODEL>",
"MNEMEX_PL_HALFLIFE_DAYS": "<MNEMEX_PL_HALFLIFE_DAYS>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from mnemex <command>
Platform CLI
gemini mcp add -e MNEMEX_STORAGE_PATH=<MNEMEX_STORAGE_PATH> -e LTM_VAULT_PATH=<LTM_VAULT_PATH> -e MNEMEX_DECAY_MODEL=<MNEMEX_DECAY_MODEL> -e MNEMEX_PL_HALFLIFE_DAYS=<MNEMEX_PL_HALFLIFE_DAYS> mnemex uvx mnemexReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from mnemex <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about mnemex
How do I install mnemex in Claude Code?
The plain form is claude mcp add mnemex -- uvx mnemex. With paths and decay settings: `claude mcp add --env MNEMEX_STORAGE_PATH=<MNEMEX_STORAGE_PATH> --env LTM_VAULT_PATH=<LTM_VAULT_PATH> --env MNEMEX_DECAY_MODEL=<MNEMEX_DECAY_MODEL> --env MNEMEX_PL_HALFLIFE_DAYS=<MNEMEX_PL_HALFLIFE_DAYS> --transport stdio mnemex -- uvx mnemex`.
What does mnemex do?
It carries facts and preferences across conversations with an assistant. Entries weaken over time unless you use them, and repeated use keeps them alive longer.
Where does mnemex keep its data?
Short-term memory sits in JSONL or SQLite on your machine; long-term memory is written as Markdown files with YAML metadata and wikilinks, built for Obsidian.