DEV Community

ramsbaby
ramsbaby

Posted on

Self-hosted AI ops on Mac mini: Claude Max + Discord + MCP at $0/month extra

Running a personal AI operations system for 2 months now. Here's the full architecture.

Hardware & Stack

  • Hardware: Mac mini M2 (always on, silent, no cloud bill)
  • Runtime: Node.js + bash
  • Memory: LanceDB (local vector) + SQLite (queues)
  • UI: Discord
  • AI engine: claude -p headless CLI (included in Claude Max $20/month)

What runs 24/7

  1. Reactive Discord chat — multi-turn threads, session memory, RAG knowledge base
  2. 30 scheduled cron tasks — standups, market alerts, code audits, log rotation, vault sync
  3. 11 specialized agent teams — each has a role, schedule, and output channel
  4. Self-healing infrastructure — 4-layer recovery: preflight → keepalive → watchdog → Claude AI diagnosis

The Context Intelligence Gateway

Main problem with 24/7 Claude agents: context window fills up in 20-30 minutes on heavy workloads.

Built a local MCP server (Nexus CIG) that intercepts every tool output, classifies type (JSON/log/table/markdown), extracts signal, drops noise before it hits Claude's context window.

315 KB raw output → 5.4 KB compressed (~98%)

Sessions now run 3+ hours reliably.

Numbers

  • Uptime: 99.7%
  • Context savings: ~98% on heavy tool use
  • Incidents: 14 total, 9 auto-resolved (64% autonomous recovery)
  • Extra cost: $0/month

Open source (MIT)

Happy to answer questions about any part of the architecture.

Top comments (0)