# Compartment

Local memory for AI agents: one encrypted vault on your machine, no network and no API key. What an agent learns in one session carries over to the next.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed · ★ 577
- Author: MaxFreedomPollard
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/MaxFreedomPollard/Compartment
- Updated: 2026-10-20
- HTML: https://affpapa.org/en/nevibecode/mcp/compartment

## What it does

Compartment keeps what an agent learns about you and your project in a single file on your own computer. Claude, Claude Desktop, Cursor, Codex and other MCP clients read and write it. There is no account and no key.

Every memory is one claim, stored with where it came from and when it was learned. Memories can expire: set `expires` and the entry is dropped after that date. A changed preference replaces the old one. Recall mixes vector and keyword search and answers in about 12 ms. The embedding model ships inside the package, and everything on disk is encrypted, vectors included, so your passphrase is the only way in.

A fresh vault starts with roughly 6,700 reference facts covering hardware, operating systems, ports, encodings and shell utilities. They behave like ordinary memories and one switch hides them from search. The store only accepts short claims: anything past 200 characters is rejected, along with entries that contain lists or headings. `uvx` has to be on your machine, otherwise the server will not start.

## Requirements
- Needs: Python and uv (commands run via uvx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add compartment -- uvx compartment
```
uvx runs the command named after the package; if the README names another one, use uvx --from compartment <command>

### Codex

**Platform CLI**
```bash
codex mcp add compartment -- uvx compartment
```
uvx runs the command named after the package; if the README names another one, use uvx --from compartment <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "compartment": {
            "command": "uvx",
            "args": [
                "compartment"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from compartment <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "compartment": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "compartment"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from compartment <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add compartment uvx compartment
```
uvx runs the command named after the package; if the README names another one, use uvx --from compartment <command>

## When to use it
- carry a decision from an earlier session into a new project
- keep agent memory encrypted instead of sitting in plain JSON
- hide an outdated preference from search once it changes
- find a fact by meaning rather than an exact word
- give a memory an expiry date so it disappears on its own

## Example prompts
- Remember that we only reply to this client on Fridays
- What do you know about this project's setup?
- Drop the old report format, we ship Markdown now

## Similar
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872
- [AIHawk](https://affpapa.org/en/nevibecode/mcp/aihawk.md) — MCP server · ★ 32221

---
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
