Skip to content

Jocasta MCP (The Archivist)

Jocasta the Archivist — a vast library of floating data crystals and holographic scrolls weaving a unified data stream.

Every app on the Mac Mini hoards its memory in a SQLite file. Messages, Apple Notes, Photos, Contacts, Mail — each keeps a private ledger under ~/Library and assumes nobody will ever read it. Jocasta reads all of them.

She is the local-first data gateway for the haus, and her method is almost rude in its simplicity. No cloud APIs to scrape, no headless browser to babysit — both notoriously brittle. sanctum-jocasta-mcp just opens the SQLite databases already sitting on disk on the Mac Mini host, and exposes 23 tools shared across the Jedi Council.

Because every database it queries lives offline under ~/Library, egress cost and network latency are zero. Nothing leaves the box to answer a question about what’s already on the box.

Source: Ogilthorp3/jocasta-mcp (private) — ~/Projects/jocasta-mcp/

The MCP operates through two unified streams:

  1. The MCP Server (index.ts): For autonomous LLM agents speaking standard .stdio RPC.
  2. The Terminal CLI (cli.ts): For SSH automation and bare Bash scripting (pnpm sanctum-jocasta <command>).

In Sanctum 1.0 (“One Door”, deployed 2026-11-20 / 2026-11-21), every Apple store read — iMessage, WhatsApp, Contacts, Notes, Photos, Mail, and live Calendar (calendar_live) — routes exclusively through SanctumBridge on 127.0.0.1:4444 with Bearer auth and consumer=jocasta. There is no direct SQLite fallback: jocasta-mcp itself stays completely FDA-clean, and every read lands in SanctumBridge’s audit log.

The bridge listens on 127.0.0.1:4444 (overridable via SANCTUM_BRIDGE_URL; both ends resolve services.sanctum_bridge.port from ~/.sanctum/instance.yaml). See SanctumBridge for the full architecture, API, and notarized .app bundle design.

The jocasta_health tool reports server status and bridge connectivity in one call. It tells you whether queries are routing through the bridge or falling back to direct DB access, which is the first thing you want to know when something returns empty results.

Apple Mail

Reads the Envelope Index under ~/Library/Mail/V*/MailData to map sender aliases and subjects. Timestamps are Unix epoch seconds here, not Apple’s 2001 epoch — a one-line off-by-31-years bug if you forget.

Messages & Protocols

Parses chat.db for iMessage and SMS and reaches WhatsApp through SanctumBridge (127.0.0.1:4444) with consumer=jocasta (no direct SQLite fallback in Sanctum 1.0), and reads Telegram from its store. Signal decodes its config.json master key to open SQLCipher sql/db.sqlite.

Electron Bundles

Slack and Discord data is heavily blocked due to Electron’s use of LevelDB packet chunks (Local Storage/leveldb). Those tools respond with graceful failures for now.

Apple Core Data

Jocasta pulls Apple Notes previews (ZSNIPPET), live Calendar events (calendar_live), Photos metadata, Apple Mail headers, and Contacts (AddressBook-v22.abcddb for CRM correlation) all through SanctumBridge (127.0.0.1:4444) under One Door.

Offline Knowledge

jocasta_search_kiwix pings a local kiwix-serve on :8080 and confirms the offline .zim archive is reachable. Article extraction isn’t wired yet — the tool returns “reached, here’s how to parse me,” not the article. An honest stub beats a pretty lie.

GPS & Media

Queries Photos.sqlite for the timestamp and GPS metadata on each item, then hits OpenStreetMap’s Nominatim to turn those raw lat/long pairs into a place name you can actually read.

Reads go through sqlite3.OPEN_READONLY (or the bridge, for the four bridged databases). Writes never touch those files — they run through osascript, letting the host apps own the mutation so we never risk corrupting a Core Data store we don’t fully understand:

  • jocasta_write_note: creates a note in the default iCloud Apple Notes account.
  • jocasta_write_calendar: takes ISO datetimes and tells Calendar.app to schedule the event.
  • jocasta_send_imessage: hands the message to the Messages daemon to send as iMessage/SMS.
    • Primary use case: the pager. When a service drops, the alert gets texted to your own phone — the one channel that lights up the lock screen whether or not you’re at the terminal. Handing this tool to Mon Mothma’s council seat is the plan; today her tool belt stops at status, doctor, and logs.

Disabled High-Privilege Tools (Off in Sanctum 1.0)

Section titled “Disabled High-Privilege Tools (Off in Sanctum 1.0)”

Four earlier experimental tools — jocasta_agent_browser (Chrome CDP browsing), jocasta_read_keychain (macOS Keychain lookups), jocasta_read_syslog (Unified Logs), and jocasta_read_file (arbitrary local document reads) — are turned off in Sanctum 1.0 (842bf94) and immediately return "off in Sanctum 1.0" so an untrusted prompt cannot pivot Jocasta into browsing, Keychain reads, or host filesystem access. jocasta_read_process_list remains available for bounded top-50 CPU telemetry.

Jocasta runs on pnpm (10.33.0). The packageManager field is set in package.json, and the native module builds (@journeyapps/sqlcipher, sqlite3, esbuild) are explicitly allowlisted via pnpm.onlyBuiltDependencies. Run npm install instead of pnpm install and you’ll have a bad time: npm ignores pnpm.onlyBuiltDependencies, so those native modules never compile their bindings and the server falls over at first DB open. Use the package manager the lockfile was written for.

Terminal window
pnpm install
pnpm build

Like the .mlx components, Jocasta proves itself with test_e2e_jocasta.sh. It builds the TypeScript via pnpm, runs each CLI command and asserts on the stdout/stderr it gets back, exercises the telemetry tools, and feeds in bad paths to check the error handling. The point worth keeping: connectors that hit a missing or stale database (the on-disk Calendar Cache on manoir.local, for instance) return a readable error the suite validates as an expected failure — a tool that fails loudly is doing its job; one that fails silently is the bug.

That is the whole temperament of the Archivist: read quietly, write through the front door, fail out loud.