Nucleus MCP

Local-first, cross-platform memory sync for AI coding tools (Cursor, Claude, Windsurf) with persistent engrams and hypervisor security.

🧠 Nucleus β€” Sovereign Agent OS

⚠️ official repository β†’ nucleus-mcp

PyPI version License: MIT MCP Compatible Tests Release NPM

The sovereign, local-first Agent Operating System β€” persistent memory, governance, compliance, and audit trails for any AI agent.

🌐 Website β€’ 🏦 Live KYC Demo β€’ πŸ›  170+ Tool Catalog β€’ πŸ’¬ Discord

[!CAUTION] Agent security is no longer optional. Recent incidents across the ecosystem β€” leaked API keys, supply-chain attacks, unaudited tool execution β€” prove that ungoverned agents are a liability. Nucleus is built security-first: hypervisor controls, resource locking, compliance governance, and full audit trails β€” all 100% local.


🎯 The Problem

AI agents are powerful, but ungoverned:

  • No memory β€” every session starts from zero
  • No audit trail β€” no one knows why the agent did what it did
  • No compliance β€” regulators can't approve what they can't trace
  • No sovereignty β€” your data flows through someone else's cloud

For regulated industries (banking, healthcare, legal), this is a dealbreaker.


✨ The Solution: Sovereign Agent OS

Nucleus gives every AI agent a persistent brain with built-in governance:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  🧠 Nucleus β€” Sovereign Agent OS                β”‚
β”‚                                                 β”‚
β”‚  β”Œβ”€ Memory ──┐  β”Œβ”€ Governance ┐  β”Œβ”€ DSoR ────┐ β”‚
β”‚  β”‚ Engrams   β”‚  β”‚ HITL        β”‚  β”‚ Decision  β”‚ β”‚
β”‚  β”‚ Sessions  β”‚  β”‚ Kill Switch β”‚  β”‚ Trail     β”‚ β”‚
β”‚  β”‚ Context   β”‚  β”‚ Compliance  β”‚  β”‚ Audit     β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚                                                 β”‚
β”‚  100% Local  β€’  Zero Cloud  β€’  Full Audit Trail β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Quick Start (2 Minutes)

Install

pip install nucleus-mcp
nucleus self-setup

Adaptive Path Discovery

Nucleus automatically locates your .brain by following this hierarchy:

  1. NUCLEUS_BRAIN_PATH environment variable.
  2. Climbing parent directories from CWD to find an existing .brain.
  3. Defaulting to $HOME/.nucleus/brain.

Try It

# One-command security hardening + posture report
nucleus secure

# Interactive AI chat (Gemini, Anthropic, Groq β€” hot-switchable)
nucleus chat

# See your sovereignty posture
nucleus sovereign

# Run a KYC compliance demo
nucleus kyc demo

# Apply EU DORA compliance
nucleus comply --jurisdiction eu-dora

# Generate audit-ready report
nucleus audit-report --format html -o report.html

# Browse decision trails
nucleus trace list

# System Health & Lock Recovery
nucleus status --health
nucleus status --cleanup-lock

πŸ†˜ Session Recovery (Universal)

If your IDE session freezes due to bloated conversation files:

# One-shot automatic recovery
nucleus recover auto <conversation-id>

# Or step-by-step:
nucleus recover detect                      # Find bloated conversations
nucleus recover extract <conversation-id>   # Extract context
nucleus recover bootstrap <conversation-id> # Create fresh session
nucleus recover rewrite <old-id> <new-id>   # Update test paths

Works across any IDE (Windsurf, Cursor, Antigravity) and CLI. Zero configuration required.

Configure (Claude Desktop / Cursor / Windsurf)

Add to your MCP config:

{
  "mcpServers": {
    "nucleus": {
      "command": "python3",
      "args": ["-m", "nucleus_mcp"],
      "env": {
        "NUCLEAR_BRAIN_PATH": "/path/to/your/.brain"
      }
    }
  }
}

πŸ—οΈ Agent CLI β€” v1.6.2

Nucleus speaks MCP + CLI + SDK. Every command auto-detects TTY (table) vs pipe (JSON).

# Memory
nucleus engram search "compliance"                    # Table in terminal, JSONL when piped
nucleus engram write my_key "important insight" --context Strategy --intensity 8
nucleus engram query --context Decision --limit 10

# Tasks
nucleus task list --status READY --format json        # Force JSON output
nucleus task add "Ship v1.4.0 CLI" --priority 1
nucleus task update task-abc123 --status DONE

# Sessions
nucleus session save "Working on CLI implementation"
nucleus session resume                                # Most recent session

# Growth
nucleus growth pulse                                  # GitHub stars + PyPI + compound
nucleus growth status                                 # Metrics without side effects

# Outbound I/O
nucleus outbound check reddit r/ClaudeAI              # Idempotency gate
nucleus outbound record reddit r/ClaudeAI --permalink https://reddit.com/abc
nucleus outbound plan                                 # What's ready vs posted

# Pipe-friendly (Unix composable)
nucleus engram search "test" | jq '.key'
nucleus task list --format tsv | cut -f1,3

Global flags: --format json|table|tsv β€’ --brain-path /path/to/.brain β€’ --version


οΏ½πŸ₯ž The Layered Open-Core Model

Nucleus is designed for progressive adoption. You can start local and scale up to full institutional compliance seamlessly.

  1. Layer 1: Sovereign Core (OSS): 100% local, persistent engrams, session state, and essential file governance.
  2. Layer 2: CLI-First Tooling: morning-brief, end-of-day, and the dogfood tracker for compounding intelligence.
  3. Layer 3: Deployment Kit: 1-command jurisdiction deployments (nucleus deploy --jurisdiction eu-dora).
  4. Layer 4: Institutional Compliance: DSoR Trace Viewer, Audit Report HTML exports (DORA/MAS TRM), and strict HITL gates.

πŸ›οΈ Why Nucleus for Regulated Industries

Jurisdiction-Aware Compliance

One command to configure for any regulatory framework:

nucleus comply --jurisdiction eu-dora       # EU DORA (7yr retention, kill switch)
nucleus comply --jurisdiction sg-mas-trm    # Singapore MAS TRM (5yr, strictest HITL)
nucleus comply --jurisdiction us-soc2       # US SOC2 (1yr retention)
nucleus comply --report                     # Check compliance status
JurisdictionRegionRetentionHITL OpsKill Switch
eu-doraEU7 years5 typesβœ… Required
sg-mas-trmSingapore5 years5 typesβœ… Required
us-soc2US/Global1 year3 typesβšͺ Optional
global-defaultGlobal90 days2 typesβšͺ Optional

KYC Compliance Demo

Built-in demo workflow showing how Nucleus governs a KYC document review:

nucleus kyc review APP-001  # Low risk β†’ βœ… APPROVE
nucleus kyc review APP-002  # Medium risk β†’ ⚠️ ESCALATE (PEP match)
nucleus kyc review APP-003  # High risk β†’ ❌ REJECT (sanctions)
nucleus kyc demo            # Run all 3 in sequence

Each review generates:

  • 5 automated checks (sanctions, PEP, document validity, risk factors, source of funds)
  • Full decision trail stored as DSoR (Decision System of Record) trace
  • HITL approval request for risky applications
  • Sovereignty guarantee: all processing is local

Audit Reports

Generate audit-ready reports for regulators:

nucleus audit-report                              # Terminal text
nucleus audit-report --format json                # JSON for APIs
nucleus audit-report --format html -o report.html # HTML for compliance officers

Sovereignty Status

See your full sovereignty posture:

nucleus sovereign

Shows: sovereignty score (0-100), memory health, governance posture, DSoR integrity, data residency guarantee.


πŸ›  Full Feature Set

Core β€” Persistent Agent Memory

FeatureCommandDescription
Engramsnucleus_engramsPersistent knowledge that survives sessions
Sessionsnucleus_sessionsSave and resume work context
Morning Briefnucleus morning-briefDaily compounding intelligence brief
End of Daynucleus end-of-dayCapture learnings as engrams

Governance β€” Agent Controls

FeatureCommandDescription
Compliancenucleus complyJurisdiction-aware configuration
Audit Reportsnucleus audit-reportAudit-ready compliance reports
KYC Demonucleus kycPre-built compliance demo workflow
DSoR Tracesnucleus traceBrowse decision trails
Sovereigntynucleus sovereignFull sovereignty posture report
Securenucleus secureOne-command hardening + security certificate
HITLBuilt-inHuman-in-the-loop approval gates
Kill SwitchBuilt-inEmergency halt for agent operations
Hypervisornucleus_governanceFile locking, security, mode control

Interactive β€” AI Chat

FeatureCommandDescription
Chatnucleus chatMulti-provider terminal AI (Gemini/Anthropic/Groq)
Multi-TurnBuilt-inNative conversation history with session resume
Tool CallingBuilt-inNative function calling + <execute> tag fallback
Dual-Agent/dual <provider>Primary generates, reviewer critiques

Orchestration β€” Multi-Agent Coordination

FeatureCommandDescription
Tasksnucleus_tasksTrack work across agents
Syncnucleus_syncMulti-agent brain synchronization
Slotsnucleus_slotsAgent orchestration with sprint mode
Federationnucleus_federationMulti-brain coordination

⚑ Comparison

Cloud Agent PlatformsIDE-Native AgentsNucleus
Security⚠️ Varies widely⚠️ Cloud-managedβœ… Hypervisor + audit trail
Compliance❌ None❌ Noneβœ… DORA, MAS TRM, SOC2
Audit Trail❌⚠️ Basic logsβœ… Full DSoR + HTML reports
HITL❌⚠️ Limitedβœ… Jurisdiction-configurable
Cross-Platform⚠️ Vendor lock-in❌ Single IDEβœ… Any MCP client
Local-First❌ Cloud-required⚠️ Some cloudβœ… 100% local
Open Source⚠️ Varies❌ Mostly closedβœ… MIT

🐳 Deployment

Docker (per jurisdiction)

# EU DORA deployment
docker compose -f deploy/docker-compose.eu-dora.yml up -d

# Or use the one-command deployment script
./deploy/deploy.sh eu-dora

Local

pip install nucleus-mcp
nucleus init
nucleus comply --jurisdiction eu-dora
nucleus sovereign  # Verify

πŸ”­ Anonymous Telemetry

Nucleus collects anonymous, aggregate usage statistics to improve the product. No personal data, no engram content, no org docs β€” ever.

⚠️ Note: Anonymous telemetry powers the autonomous incident brain engine (telemetry.nucleusos.dev). Disabling it may degrade or disable autonomy features like policy adaptation, crash-loop detection, and rollout health scoring. Only opt out if you have a fully local telemetry stack.

Opt out in 1 command:

nucleus config --no-telemetry
# or via env:    NUCLEUS_ANON_TELEMETRY=false
# or in config:  telemetry.anonymous.enabled: false

What's collected: command name, duration, error type, Nucleus/Python version, OS platform.
What's NEVER collected: engram content, file paths, prompts, API keys, any PII.

See TELEMETRY.md for full details.


πŸ“¦ v1.6.2 β€” Interactive Intelligence

  • Multi-Provider Chat β€” nucleus chat with Gemini, Anthropic, Groq (hot-switchable via /provider)
  • Native Tool Calling β€” Anthropic tool_use API + Groq OpenAI function calling
  • Model-Aware Gating β€” 70b+ models use native tools; 8b models use <execute> tags
  • Groq Auto-Rotation β€” Cascades across models on rate limit
  • Session Resume β€” Chat history auto-loads from disk on startup
  • nucleus secure β€” One-command security hardening + posture report with certificate
  • 263 tests passing β€” Routing fuzzer, session resume, tool pattern detection

πŸ“¦ v1.6.0 β€” The Autonomous Incident Brain

  • Automated Incident Response, Adaptive Policy Engine, Reliability Policy Surface
  • Full-Stack Health Monitoring with crash-loop defense
  • Safe Rollouts & Auto-Rollback with health-gated releases

πŸ“¦ v1.5.0 β€” The Sovereign Kernel

  • Adaptive Path Discovery β€” Zero-conf brain location (Env > CWD > Home)
  • Universal Shell Integration β€” Integrated bash/zsh completions via self-setup
  • Federation Level 1 β€” Automated local peer discovery via IPC
  • DSoR Self-Healing β€” Automated reconciliation of orphaned decisions in audit logs
  • CLI Sovereignty β€” Unified routing, Python-native bootstrap, and health monitoring
  • 80+ tests β€” All passing (including stale lock recovery and recursion guards)

See CHANGELOG.md for full details.


🀝 Community & Contributing

πŸ“œ License

MIT Β© 2026 Nucleus Team | [email protected]


Built for the AI-native enterprise. Star us if Nucleus gives your agents a brain β€” and a conscience. ⭐

Verwandte Server