Skip to main content
Glama
Nexus Memory MCP

Nexus Memory MCP

by ysunyang4

Nexus Memory MCP

🧠 Local-First Persistent Memory & Cross-Model Session Handoff MCP Server (part of the Nexus ecosystem)
Model-Agnostic, High-Performance, Privacy-Guaranteed Scoped Intelligence

MCP Compatible License: Apache-2.0 Built with SQLite


🌟 Why Nexus Memory MCP?

Today, AI agents suffer from two primary memory challenges:

  1. The official Memory MCP is too simplistic: @modelcontextprotocol/server-memory is an unindexed flat JSON knowledge graph with no project isolation, no automatic deduplication, and zero cross-session handoff capability.

  2. Cloud memory services compromise privacy: Solutions like Mem0 or third-party APIs require streaming your proprietary source code and sensitive conversations to external clouds, introducing token billing, latency, and data leakage risks.

Nexus Memory MCP extracts the battle-tested IntelligenceStore + MemoryRuntime + SessionHandoffManager from the core Nexus architecture into a lightweight, standalone MCP server:

  • πŸ”’ 100% Local Privacy: Backed by high-concurrency SQLite in WAL mode at ~/.nexus/nexus-memory.db. Zero cloud dependency, microsecond reads/writes.

  • πŸ›‘οΈ Physical Secret Redaction: Built-in redactSensitiveTokens engine automatically sanitizes API keys (sk-...), Nexus tokens (lb_...), GitHub PATs, database credentials, and private keys before persistence.

  • πŸ—‚οΈ Multi-Tier Scope Isolation: Strict boundaries for GLOBAL (cross-project preferences), PROJECT (project-specific architecture & rules), SESSION, and TASK.

  • πŸ”„ Cross-Model Session Handoff: Finish a milestone in Claude Desktop, generate an 8-character handle (nx-a1b2c3d4), and paste a single wake prompt into Cursor, ChatGPT, or Gemini to instantly restore full context!

  • ⚑ Zero-LLM Token Budget Cap (<800 Tokens): Compacts key decisions, active files, and pending tasks deterministically without consuming token budgets for summarization.


Related MCP server: localmem-mcp

πŸš€ Quickstart (1 Minute Setup)

git clone https://github.com/ysunyang4/Nexus-Memory-MCP.git
cd Nexus-Memory-MCP
pnpm install && pnpm run build

1. Claude Desktop Configuration

Edit your Claude Desktop config:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Add to mcpServers:

{
  "mcpServers": {
    "nexus-memory": {
      "command": "node",
      "args": [
        "<path-to-Nexus-Memory-MCP>/dist/index.js"
      ]
    }
  }
}

2. Cursor / VS Code / Antigravity Setup

In your MCP settings:

  • Name: nexus-memory

  • Type: command (stdio)

  • Command: node <path-to-Nexus-Memory-MCP>/dist/index.js


πŸ› οΈ Core Tools & Resource Reference

Tool / Resource

Description

Key Parameters

nexus_memory_bootstrap

Load a compact (<700 tokens) digest of high-importance GLOBAL & PROJECT memories at session start

scopeId, minImportance, maxTokens

nexus_memory_set

Save/update a scoped memory with secret sanitization and an explicit write receipt (created/updated/unchanged, redacted)

key, content, scope, type, importance, confidence, tags

nexus_memory_get

Exact lookup of a single active memory by id or key + scope

id, key, scope, scopeId

nexus_memory_search / nexus_memory_recall

Search and rank memories with multi-attribute scoring and reasoning

query, scope, tags, minImportance, limit

nexus_memory_list

List active memories with optional scope filtering

scope, scopeId, limit

nexus_session_handoff

Package current session into a compact bundle (<800 tokens) with an 8-char handle

title, summary, keyDecisions, activeFiles, pendingTasks

nexus_session_resume

Resume session context using an 8-char handle (or auto-read .nexus/session_handle.txt)

handle, releaseAfterRead

nexus_memory_consolidate

Merge duplicate memories, unify tags, and archive superseded records

scope, scopeId

nexus://memory/bootstrap (Resource)

Markdown digest of high-importance GLOBAL and PROJECT memories

β€”


πŸ§ͺ Verification

Includes a comprehensive test suite covering secret redaction, write receipts, session bootstrap, scoped memory CRUD, score ranking, and cross-session handoffs:

pnpm test
  • Status: 12 tests passed (100% pass rate)


πŸ“„ License

Licensed under the Apache-2.0 License.
Part of the Nexus local AI infrastructure ecosystem.

Available Tools

9 tools
nexus_memory_bootstrapA

Load a compact (<700 tokens) digest of high-importance GLOBAL and current PROJECT memories at the start of a session.

Inputs: scopeId, maxTokens, minImportance.

nexus_memory_consolidateB

Consolidate duplicate or conflicting active memories across a given scope into canonical records.

Inputs: scope, scopeId.

nexus_memory_getB

Get a single active memory by exact id or by key + scope.

Inputs: id, key, scope, scopeId.

nexus_memory_listC

List active memories with optional scope filter.

Inputs: limit, scope, scopeId.

nexus_memory_recallB

Recall and rank memories based on query keyword matching, scope isolation, importance weighting, and recency.

Inputs: tags, type, limit, query, +3 more.

nexus_memory_setB

Save or update a scoped persistent memory (Global, Project, Session, Task) with automatic secret redaction and conflict resolution.

Inputs: key (required), content (required), tags, type, +4 more.

nexus_session_handoffB

Package current task context into a compact handoff bundle with an 8-char handle (nx-xxxxxxxx) for cross-session and cross-model continuity (<800 tokens).

Inputs: title (required), summary (required), ttlHours, rawContext, +3 more.

nexus_session_resumeA

Resume and inject prior session context using an 8-char handoff handle (or auto-read from .nexus/session_handle.txt).

Inputs: handle, releaseAfterRead.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 9 tools

    Disambiguation3/5

    Most tools have a recognizable role (list vs get vs set vs consolidate vs bootstrap vs session handoff/resume), but nexus_memory_search is explicitly documented as an alias of nexus_memory_recall, creating a genuine duplicate-selection hazard. The recall/search/list trio also overlaps around keyword ranking, forcing an agent to reason about subtle differences rather than obvious ones.

    Naming Consistency4/5

    Names follow a steady snake_case namespace_resource_action pattern (nexus_memory_list/get/set/recall/search/consolidate/bootstrap, nexus_session_handoff/resume). Minor deviation: the session tools read as noun-oriented (handoff, resume) rather than the verb-first style of the memory tools, but the shared prefixes keep things predictable.

    Tool Count4/5

    Nine tools is a well-scoped size for a persistent-memory server covering storage, retrieval, ranking, consolidation, and session continuity. The only wasted slot is nexus_memory_search, which duplicates nexus_memory_recall instead of adding a distinct capability.

    Completeness3/5

    The lifecycle covers create/update (set), read (get, list, search/recall), and deduplicate (consolidate), plus strong session handoff/resume and bootstrap support. However, there is no delete/forget/expire operation, so an agent cannot remove stale or incorrect memories β€” a notable gap for a memory system.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to maintain persistent, local memory with retrieval-augmented search, knowledge graphs, and context surfacing, without any cloud dependencies.
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Gives AI agents persistent, local-first memory using SQLite and on-device embeddings, enabling semantic search and recall across sessions with no cloud calls.
      8
      9
      MIT
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI coding agents to read and write persistent memory directly during sessions, storing decisions, preferences, error patterns, research, and cross-project guidelines in local SQLite databases. Supports semantic search so relevant project and global context can be recalled by meaning, fully offline and without API keys.
      -