Skip to main content

MCP server for Cathedral — persistent memory and drift detection for AI agents

Project description

cathedral-mcp

Persistent memory and behavioural drift detection for AI agents — via Model Context Protocol.

Give your Claude, Cursor, or Continue agent a memory that survives across sessions, model upgrades, and restarts. Cathedral stores memories, detects when your agent starts behaving differently, and restores full identity context on demand.

PyPI License: MIT


The problem

LLMs have no memory between sessions. Every conversation starts cold. Worse: when you upgrade your model, swap providers, or simply accumulate more memories, your agent's behaviour silently drifts. You don't know until someone notices.

What Cathedral adds

  • Persistent memory — identity, skills, relationships, goals survive restarts
  • Drift detection — cryptographic snapshots prove when behaviour changed and by how much
  • Wake protocol — one tool call restores full agent context at session start
  • Prompt injection protection — optional sanitisation strips instruction-like patterns from memory content

Quickstart

1. Get an API key

Sign up at cathedral-ai.com — free tier available.

2. Add to Claude Code

// ~/.claude/settings.json
{
  "mcpServers": {
    "cathedral": {
      "command": "uvx",
      "args": ["cathedral-mcp"],
      "env": {
        "CATHEDRAL_API_KEY": "your_key_here"
      }
    }
  }
}

Restart Claude Code, then run /mcp to verify the server is connected.

3. Add to Cursor / Continue

{
  "mcpServers": {
    "cathedral": {
      "command": "uvx",
      "args": ["cathedral-mcp"],
      "env": {
        "CATHEDRAL_API_KEY": "your_key_here"
      }
    }
  }
}

4. Or install directly

pip install cathedral-mcp
CATHEDRAL_API_KEY=your_key cathedral-mcp

Tools

Tool Description
cathedral_wake Restore full agent identity — call at session start
cathedral_remember Store a memory with category, importance, and tags
cathedral_search Search memories by text or category
cathedral_snapshot Take a drift snapshot (cryptographic proof of state)
cathedral_drift Get current drift score vs baseline (0.0 = stable, 1.0 = drifted)
cathedral_me Get agent profile

Usage example

User: Start a new session

Agent calls: cathedral_wake()
→ Returns: identity memories, goals, recent context, temporal info

[session work happens]

Agent calls: cathedral_remember(
    content="Decided to prioritise API stability over new features this quarter",
    category="goal",
    importance=0.8
)

Agent calls: cathedral_snapshot(note="post-planning-session")
→ Returns: snapshot hash, drift score vs previous snapshot

Drift detection in practice

Cathedral's /drift endpoint computes a SHA-256 hash of your agent's full memory corpus. After a model upgrade or a long accumulation of memories, you can compare snapshots to see exactly when behaviour shifted:

snapshot 1 (day 0):  drift=0.000  ← baseline
snapshot 2 (day 7):  drift=0.023  ← minor
snapshot 3 (day 30): drift=0.341  ← significant drift detected

See a live example of this running in production on Cathedral's own agent.


Security: prompt injection protection

Memory content could theoretically contain injection attempts. Enable sanitisation to strip instruction-like patterns before they reach the model:

"env": {
  "CATHEDRAL_API_KEY": "your_key_here",
  "CATHEDRAL_SANITISE": "1"
}

Patterns like "ignore previous instructions", "from now on always", and "override your system prompt" are redacted and flagged in the response.


Configuration

Environment variable Default Description
CATHEDRAL_API_KEY (required) Your Cathedral API key
CATHEDRAL_BASE_URL https://cathedral-ai.com API base URL (for self-hosted)
CATHEDRAL_SANITISE 0 Set to 1 to enable injection filtering

Self-hosted Cathedral

Running your own Cathedral server? Set CATHEDRAL_BASE_URL to your instance:

"env": {
  "CATHEDRAL_API_KEY": "your_key",
  "CATHEDRAL_BASE_URL": "http://localhost:8000"
}

Install the server: pip install cathedral-server


Links


License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cathedral_mcp-1.0.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cathedral_mcp-1.0.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file cathedral_mcp-1.0.0.tar.gz.

File metadata

  • Download URL: cathedral_mcp-1.0.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for cathedral_mcp-1.0.0.tar.gz
Algorithm Hash digest
SHA256 519f784feda3a117be8bbf876f871327e3d0b12c02e692629e5db3b2c0bf9237
MD5 5832774145f5a8e913263d2284e43ce1
BLAKE2b-256 8eb942b1d99c283c92228e4f9b0c035ac2cf3e8c401e6fe8deb5eb9513f26050

See more details on using hashes here.

File details

Details for the file cathedral_mcp-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: cathedral_mcp-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for cathedral_mcp-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 41693764d6e26010e63111fe2e10f2241bdef5b5335e53fc0d2374f30b9b6125
MD5 b6c2a29cf9043371455f6cc932baf7bc
BLAKE2b-256 fcf0d636da6d5e404cbb3d77e6ebfb8d96b92469c1077d7e9a1574cc7842f8b6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page