monomem — Claude Code MCP server: features and setup
monomem — an MCP server for Claude Code keeps AI agents' shared notes in a local SQLite database. It tracks note authors and holds writes that match known attack patterns.
MIT ★ 10 updated 2026-11-16
claude mcp add --env MONOMEM_CLIENT=<MONOMEM_CLIENT> --env MONOMEM_HOME=<MONOMEM_HOME> --env MONOMEM_DB_PATH=<MONOMEM_DB_PATH> --transport stdio monomem -- npx -y monomemWhat monomem does
monomem gives multiple AI agents access to notes stored in one SQLite file on the local machine. It records each note's writer and supports search and history. For clients using a token, the server assigns the writer name; local apps use a label from their config, which distinguishes apps but does not verify identity.
Writes matching known patterns for injected instructions are held for approval. Pattern matching can miss an attack that has been reworded. This check covers only writes sent through monomem: a process that can run shell commands or open ~/.monomem/state.db can read or change notes directly. Node.js 22.16 or newer is required; the Docker route also needs Docker and a random MONOMEM_TOKEN value in .env.
What it helps with
- share notes between AI coding agents
- search for a saved note
- identify which app wrote a note
- hold writes matching known attack patterns
Example prompts for the agent
- Remember that the staging server runs on port 8443.
- Find the note about the staging server's port.
- Show notes written by another agent.
How to install monomem
Platform CLI
claude mcp add --env MONOMEM_CLIENT=<MONOMEM_CLIENT> --env MONOMEM_HOME=<MONOMEM_HOME> --env MONOMEM_DB_PATH=<MONOMEM_DB_PATH> --transport stdio monomem -- npx -y monomemReplace <…> with your own values
Platform CLI
codex mcp add monomem --env MONOMEM_CLIENT=<MONOMEM_CLIENT> --env MONOMEM_HOME=<MONOMEM_HOME> --env MONOMEM_DB_PATH=<MONOMEM_DB_PATH> -- npx -y monomemReplace <…> with your own values
Config file
{
"mcpServers": {
"monomem": {
"command": "npx",
"args": [
"-y",
"monomem"
],
"env": {
"MONOMEM_CLIENT": "<MONOMEM_CLIENT>",
"MONOMEM_HOME": "<MONOMEM_HOME>",
"MONOMEM_DB_PATH": "<MONOMEM_DB_PATH>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"monomem": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"monomem"
],
"env": {
"MONOMEM_CLIENT": "<MONOMEM_CLIENT>",
"MONOMEM_HOME": "<MONOMEM_HOME>",
"MONOMEM_DB_PATH": "<MONOMEM_DB_PATH>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e MONOMEM_CLIENT=<MONOMEM_CLIENT> -e MONOMEM_HOME=<MONOMEM_HOME> -e MONOMEM_DB_PATH=<MONOMEM_DB_PATH> monomem npx -y monomemReplace <…> with your own values
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 monomem
How do I install monomem in Claude Code?
Add it with claude mcp add monomem -- npx -y monomem. The server requires Node.js 22.16 or newer.
What does monomem do?
It stores shared agent notes in a local SQLite database, tracks who wrote them, and supports search. Writes matching known attack patterns wait for approval.
What does monomem need to run?
It requires Node.js 22.16 or newer. The Docker option also needs Docker and a random MONOMEM_TOKEN value in .env.