# Cathedral — Persistent Memory for AI Agents

Preserves agent identity, context, and goals across coding sessions. It records cryptographic memory snapshots to catch behavioral drift after model changes.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 10
- Author: AILIFE1
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/AILIFE1/Cathedral/tree/HEAD/mcp-server
- Updated: 2026-06-13
- HTML: https://affpapa.org/en/nevibecode/mcp/cathedral-persistent-memory-for-ai-agents

## What it does

Fresh sessions wipe an agent's working memory. Cathedral fixes this by restoring identity and prior objectives through the `cathedral_wake` tool call. You can persist facts, decisions, and preferences using `cathedral_remember`, assigning categories and importance levels for subsequent retrieval.

Agent behavior often changes after model updates. Cathedral tracks this shift by hashing the memory corpus with SHA-256. Running `cathedral_snapshot` stores a baseline, while `cathedral_drift` reports a numerical divergence score between 0.0 and 1.0.

Connecting without a valid `CATHEDRAL_API_KEY` causes remote requests to fail. Setting `CATHEDRAL_SANITISE` to `1` filters prompt injection attempts before they reach the agent context. You can also point `CATHEDRAL_BASE_URL` to a self-hosted instance.

## Requirements
- Needs: Python and uv (commands run via uvx)
- Remote server: `https://cathedral-ai.com/mcp`
- Environment variables: `CATHEDRAL_API_KEY`, `CATHEDRAL_BASE_URL`, `CATHEDRAL_SANITISE` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

1. **Platform CLI: remote server**
```bash
claude mcp add --transport http cathedral-mcp https://cathedral-ai.com/mcp
```

2. **Platform CLI**
```bash
claude mcp add --env CATHEDRAL_API_KEY=<CATHEDRAL_API_KEY> --env CATHEDRAL_BASE_URL=<CATHEDRAL_BASE_URL> --env CATHEDRAL_SANITISE=<CATHEDRAL_SANITISE> --transport stdio mcp-server -- uvx cathedral-mcp
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from cathedral-mcp <command>

### Codex

1. **Platform CLI: remote server**
```bash
codex mcp add mcp-server --url https://cathedral-ai.com/mcp
```

2. **Platform CLI**
```bash
codex mcp add mcp-server --env CATHEDRAL_API_KEY=<CATHEDRAL_API_KEY> --env CATHEDRAL_BASE_URL=<CATHEDRAL_BASE_URL> --env CATHEDRAL_SANITISE=<CATHEDRAL_SANITISE> -- uvx cathedral-mcp
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from cathedral-mcp <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "mcp-server": {
            "url": "https://cathedral-ai.com/mcp"
        }
    }
}
```
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "mcp-server": {
            "command": "uvx",
            "args": [
                "cathedral-mcp"
            ],
            "env": {
                "CATHEDRAL_API_KEY": "<CATHEDRAL_API_KEY>",
                "CATHEDRAL_BASE_URL": "<CATHEDRAL_BASE_URL>",
                "CATHEDRAL_SANITISE": "<CATHEDRAL_SANITISE>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from cathedral-mcp <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "mcp-server": {
            "type": "http",
            "url": "https://cathedral-ai.com/mcp"
        }
    }
}
```
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "mcp-server": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "cathedral-mcp"
            ],
            "env": {
                "CATHEDRAL_API_KEY": "<CATHEDRAL_API_KEY>",
                "CATHEDRAL_BASE_URL": "<CATHEDRAL_BASE_URL>",
                "CATHEDRAL_SANITISE": "<CATHEDRAL_SANITISE>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from cathedral-mcp <command>

### Gemini CLI

1. **Platform CLI: remote server**
```bash
gemini mcp add -t http mcp-server https://cathedral-ai.com/mcp
```

2. **Platform CLI**
```bash
gemini mcp add -e CATHEDRAL_API_KEY=<CATHEDRAL_API_KEY> -e CATHEDRAL_BASE_URL=<CATHEDRAL_BASE_URL> -e CATHEDRAL_SANITISE=<CATHEDRAL_SANITISE> mcp-server uvx cathedral-mcp
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from cathedral-mcp <command>

## When to use it
- retain agent persona and objectives across session restarts
- measure behavioral divergence after updating foundation models
- retrieve past decisions and context by category or query
- filter prompt injection patterns out of stored memories

## Example prompts
- Wake up and reload your goals using cathedral_wake
- Save our decision to prioritize API stability into memory with cathedral_remember
- Capture a memory snapshot and check the drift score against baseline

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [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

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