# monomem

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.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 10 repo stars
- Author: calasdan-sketch
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/calasdan-sketch/monomem
- Updated: 2026-11-16
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/mcp/monomem

## What it 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`.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `MONOMEM_CLIENT`, `MONOMEM_HOME`, `MONOMEM_DB_PATH` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
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 monomem
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add monomem --env MONOMEM_CLIENT=<MONOMEM_CLIENT> --env MONOMEM_HOME=<MONOMEM_HOME> --env MONOMEM_DB_PATH=<MONOMEM_DB_PATH> -- npx -y monomem
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "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

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "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

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e MONOMEM_CLIENT=<MONOMEM_CLIENT> -e MONOMEM_HOME=<MONOMEM_HOME> -e MONOMEM_DB_PATH=<MONOMEM_DB_PATH> monomem npx -y monomem
```
Replace <…> with your own values

## When to use it
- 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
- Remember that the staging server runs on port 8443.
- Find the note about the staging server's port.
- Show notes written by another agent.

## Similar
- [SAME - Stateless Agent Memory Engine](https://affpapa.org/en/nevibecode/mcp/same-stateless-agent-memory-engine.md) — MCP server · ★ 24 repo stars
- [SentinelOne MCP](https://affpapa.org/en/nevibecode/mcp/sentinelone-mcp.md) — MCP server · ★ 87 repo stars
- [PMB AI](https://affpapa.org/en/nevibecode/mcp/pmb-ai.md) — MCP server · ★ 291 repo stars
- [Mneme Memory](https://affpapa.org/en/nevibecode/mcp/mneme-memory.md) — MCP server · ★ 250 repo stars
- [claudex](https://affpapa.org/en/nevibecode/mcp/claudex.md) — MCP server · ★ 97 repo stars
- [hypermnesia-mcp](https://affpapa.org/en/nevibecode/mcp/hypermnesia-mcp.md) — MCP server · ★ 78 repo stars

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
