Skip to main content
Glama

🧠 MindGate MCP (v1.6.0) β€” بوابة Ψ§Ω„ΨΉΩ‚Ω„

npm version npm downloads License: MIT Security: Node2Shell Hardened Version: 1.6.0

Stop re-explaining your codebase every morning.
A 100% local-first persistent memory MCP server for Cursor, Claude Desktop, Antigravity, Windsurf, and Codex β€” backed by SQLite + FTS5, automatic secret redaction, and auto-compiled AGENTS.md / .cursorrules / CLAUDE.md rules.

πŸ‡ͺπŸ‡¬ Ψ§Ω„ΨͺΩˆΨ«ΩŠΩ‚ Ψ¨Ψ§Ω„ΨΉΨ±Ψ¨ΩŠΨ© Β· πŸ–₯️ Landing Page Β· πŸ“¦ npm Β· 🎬 58-second Demo

🎬 Watch the 58-second demo β€” Start a feature in Cursor, switch to Claude Desktop or Antigravity, and pick up with zero context loss.


⚑ Quick Start (30 Seconds)

1. Run with npx (Zero-Install)

npx -y mindgate-mcp init

2. Add to Cursor / Claude Desktop / Antigravity

{
  "mcpServers": {
    "mindgate": {
      "command": "npx",
      "args": ["-y", "mindgate-mcp"]
    }
  }
}

3. Install via Smithery (Claude Desktop)

npx -y @smithery/cli install mindgate-mcp --client claude
git clone https://github.com/aaserag1/mindgate-mcp.git
cd mindgate-mcp
npm install
npm run build
npm run init-config
{
  "mcpServers": {
    "mindgate": {
      "command": "node",
      "args": ["C:\\path\\to\\mindgate-mcp\\dist\\index.js"],
      "env": {
        "MINDGATE_DB_PATH": "C:\\Users\\YOUR_USER\\.mindgate\\mindgate.db"
      }
    }
  }
}

Related MCP server: Sugar Memory

πŸ†š Why MindGate vs. Alternatives?

Feature

MindGate MCP

Mem0 MCP

Basic Memory

100% Local-First (No Cloud / No API Key)

βœ… SQLite + FTS5 on disk

❌ Hosted service / API key

βœ… Local Markdown files

Cross-Agent Handoff (Cursor ↔ Claude ↔ Codex)

βœ… Structured handoffs

βœ… Cross-tool

βœ… Cross-tool

Auto-Compiled AGENTS.md / .cursorrules / CLAUDE.md

βœ… Atomic write + .bak

❌

❌

Automatic Secret Redaction on Write

βœ… Masks API keys & JWTs

❌

❌

Local Web Dashboard + Git Post-Commit Hook

βœ… Built-in (127.0.0.1:4242)

❌

❌

Offline Cross-Lingual Search (Arabic ↔ English)

βœ… Optional ONNX profile

❌

❌


πŸ’‘ Core Capabilities

  • πŸ—„οΈ Blazing-Fast Local SQLite + FTS5 BM25: Instant full-text retrieval of architectural decisions, bugfixes, conventions, preferences, and session handoffs β€” zero network calls, zero telemetry.

  • πŸ”„ Auto-Compiled Workspace Rules: sync_workspace_rules compiles stored decisions into AGENTS.md, .cursorrules, CLAUDE.md, .windsurfrules, or MINDGATE_CONTEXT.md. Writes are atomic, existing files get a .bak-<timestamp> backup, and hand-written files are never overwritten unless force: true.

  • πŸ”’ Secret Redaction on Write: Well-known token patterns (OpenAI, GitHub, AWS, Slack, Google, JWT, PEM private keys) are masked with [REDACTED:<kind>] before touching disk. Disable with MINDGATE_REDACT_SECRETS=false (not recommended).

  • πŸ”„ Decision Lifecycle & Compaction: Supersede outdated choices (supersedes), deprecate stale notes (deprecate_memory), update in-place (update_memory), and compact long session histories (compact_memories) to save tokens.

  • πŸ“’ Assumptions Ledger (v1.6.0): Dated, owned assumption records (record_assumption) with a review_date and an owner. An assumption whose review date has passed is excluded from recall_context and listed only under assumptions_needing_review until the operator confirms (confirm_assumption) or replaces it β€” so a stale assumption can never be silently reused. review_assumptions lists what is overdue and what is due within 7 days.

  • πŸ” Optional Hybrid Semantic & Arabic ↔ English Search (v1.4.0–v1.5.0): Combines BM25 with offline ONNX embeddings (all-MiniLM-L6-v2, ~23 MB, 384-dim) and a multilingual profile (mindgate-mcp download-model --multilingual) for >0.72 cosine alignment between Arabic queries and English decisions on CPU.

  • πŸ–₯️ Built-in Local Web Dashboard: Zero-dependency UI (mindgate-mcp ui) bound strictly to 127.0.0.1:4242 with Dark/Light themes, Arabic RTL & English LTR switch, live search, and JSON export.

  • πŸͺ Git Post-Commit Hook: Automatically logs commit messages and active files via mindgate-mcp git-hook install without blocking your workflow.

  • πŸ›‘οΈ Node2Shell (CVE-2026-111497) Hardened: stdio-only transport (zero HTTP attack surface on MCP), runtime version check, and a best-effort in-process lock of node:zlib Brotli decompression loaded first. See SECURITY.md.

⚠️ MindGate does not execute shell commands, does not open network sockets for MCP, and does not attempt to detect prompt injection in arbitrary text. Review generated rules files before committing them.


πŸ–₯️ Local Web Dashboard

mindgate-mcp ui              # Starts on http://127.0.0.1:4242
mindgate-mcp ui --port 5050  # Custom port
npm run ui                   # From cloned source
  • Visual Memory Manager: Real-time FTS5 BM25 search, status badges (active, superseded, deprecated), workspace & category filters.

  • Bi-Directional UI: One-click switch between English (LTR) and Arabic (RTL), plus Dark & Light themes.

  • Auto-Open from MCP Clients: Append --open-dashboard (and optionally --port 5050) to your client's args. Occupied ports never trigger duplicate browser launches.


πŸͺ Git Post-Commit Hook

mindgate-mcp git-hook install
mindgate-mcp git-hook install --workspace my-project
mindgate-mcp git-hook uninstall

Appends a non-blocking background hook bounded by # --- mindgate:post-commit --- sentinels to .git/hooks/post-commit, preserving existing hooks.


πŸ› οΈ MCP Tools (16), Resources (2) & Prompts (1)

Tools (16)

Tool Name

Description

remember_decision

Store a persistent memory (architecture / decision / bugfix / convention / context) with secret redaction and optional supersedes

update_memory

Update an existing memory in-place by ID (and optional status) while keeping FTS5 indexes in sync

recall_context

Search memories with FTS5 BM25 (and hybrid embeddings when available), workspace/category/status filters; falls back to recent memories (search.fallback: true)

deprecate_memory

Mark a memory as deprecated by ID with an optional reason without deleting history

record_assumption

Record a dated, owned assumption (review_date, owner) in the ledger; defaults to a 30-day review window

review_assumptions

List overdue assumptions (oldest first) and the count due within 7 days

confirm_assumption

Confirm an assumption (extend its review date) or replace it with a superseding record

compact_memories

Compact historical session handoffs into milestone summaries to reduce token usage

log_session_summary

Save a structured session handoff (summary, next steps, active files) for the next agent

get_dashboard_url

Return the local MindGate Web Dashboard URL (http://127.0.0.1:4242)

sync_workspace_rules

Compile stored memories into AGENTS.md, .cursorrules, CLAUDE.md, .windsurfrules, or MINDGATE_CONTEXT.md

export_memory_snapshot

Export a portable JSON backup of memories, handoffs, and preferences

set_user_preference

Save or update a persistent developer preference (key/value)

get_user_preferences

Retrieve saved preferences, optionally filtered by category

list_workspaces

List all workspaces with memory counts and last-updated timestamps

delete_memory

Delete a memory by its ID

Resources (2)

  • mindgate://context/latest β€” Recent memories, latest cross-agent handoff, and preferences (JSON).

  • mindgate://rules/agents-md β€” Live auto-compiled AGENTS.md preview (Markdown).

Prompts (1)

  • mindgate-bootstrap β€” Loads project memory, preferences, and latest session handoff at session start (workspace optional).


πŸ›οΈ Architecture

MindGate architecture β€” one local pipe: clients β†’ stdio β†’ bootstrap β†’ validate β†’ redact β†’ SQLite FTS5 β†’ compiled rules

flowchart TB
    subgraph Clients["MCP Clients (any of them)"]
        A1["Antigravity"]
        A2["Cursor"]
        A3["Claude Desktop"]
        A4["OpenCode / Codex / Windsurf"]
    end

    subgraph Server["MindGate MCP Server β€” 100% local"]
        direction TB
        BOOT["1 Β· security/bootstrap.ts β€” first import<br/>locks the node:zlib Brotli API<br/>+ runtime version check (CVE-2026-111497)"]
        TOOLS["2 Β· index.ts β€” MCP handlers<br/>13 tools Β· 2 resources Β· 1 prompt<br/>stdio JSON-RPC only"]
        VALID["3 Β· validation.ts<br/>type + range + size limits<br/>invalid input β†’ isError: true"]
        REDACT["4 Β· security/secretRedactor.ts<br/>sk-…, AKIA…, JWT, PEM β†’ [REDACTED:kind]"]
        STORE["5 Β· db/memoryStore.ts<br/>SQLite (WAL) + FTS5 BM25<br/>triggers keep the index in sync"]
        RULES["6 Β· rulesSync.ts<br/>atomic write + .bak backup<br/>hand-written files protected (sentinel)"]
        BOOT --> TOOLS
        TOOLS --> VALID
        VALID --> REDACT
        REDACT --> STORE
        VALID --> RULES
        STORE --> RULES
    end

    DB[("Local filesystem<br/>~/.mindgate/mindgate.db<br/>file chmod 600 Β· dir chmod 700")]
    PROJ["Project workspace<br/>AGENTS.md Β· CLAUDE.md Β· .cursorrules"]

    Clients <-->|"stdio JSON-RPC only<br/>no network Β· no HTTP"| BOOT
    STORE <--> DB
    RULES -->|"write / backup"| PROJ

βš™οΈ Environment Variables

Variable

Default

Description

MINDGATE_DB_PATH

~/.mindgate/mindgate.db

SQLite database path (parent dir 0700, file 0600).

MINDGATE_DEFAULT_WORKSPACE

global

Default workspace when workspace is omitted.

MINDGATE_REDACT_SECRETS

true

Set to false to disable secret redaction on write (not recommended).

MINDGATE_STRICT_NODE2SHELL

false

Set to true to refuse startup on an unpatched Node.js runtime.


❓ FAQ & Runtime Compatibility

  • Which Node.js version do I need?
    Compatibility: Runs on Node 20+ (with built-in node:zlib Brotli lock defense-in-depth).
    Recommended for full CVE-2026-111497 protection: ^22.23.4 || ^24.22.1 || >=26.12.1 (see SECURITY.md).

  • Where does my memory live? ~/.mindgate/mindgate.db (override with MINDGATE_DB_PATH). Delete the file to wipe everything.

  • Can I move memory between machines? Yes β€” copy the .db file or use export_memory_snapshot.

  • Does it work offline? Yes β€” after install, nothing leaves your machine.

If npm ci fails with EPERM ... better-sqlite3\prebuilds\win32-x64.node, a running agent/editor is locking the native binary:

  1. Close every app using MindGate (check the system tray) and VS Code windows on the repo.

  2. Run Get-Process node | Select-Object Id, Path then Stop-Process -Id <ID> -Force.

  3. Run Rename-Item node_modules node_modules.old β†’ npm ci β†’ npm test.

  4. Delete node_modules.old.


πŸ§ͺ Testing & Verification

npm run typecheck   # TypeScript --noEmit
npm test            # 65 tests (real SQLite + FTS5)
npm run build       # emit dist/

All 65 tests pass on Linux.


πŸ“„ License

Released under the MIT License.

Available Tools

13 tools
compact_memoriesB

Compact and consolidate historical cross-agent sessions in a workspace into a dense milestone record, preventing context window bloat in long-running projects.

Inputs: workspace, max_sessions_to_keep.

delete_memoryB

Delete an outdated or superseded memory record by its ID.

Inputs: id (required).

deprecate_memoryA

Mark an architectural decision or convention as deprecated so AI agents know not to follow it anymore, while preserving it for historical auditing.

Inputs: id (required), reason.

export_memory_snapshotB

Export a portable JSON backup snapshot of MindGate memories, session handoffs, and developer preferences.

Inputs: workspace.

get_dashboard_urlA

Get the local URL and launch instructions for the MindGate visual web dashboard (localhost:4242).

Inputs: port.

get_user_preferencesB

Retrieve all saved global developer preferences and coding rules.

Inputs: category.

list_workspacesB

List all project workspaces stored in MindGate along with memory counts.

Inputs: no named parameters.

log_session_summaryA

Log a session handoff summary when finishing work in one AI agent (e.g. Antigravity) so the next agent (e.g. OpenCode or Codex) can continue seamlessly.

Inputs: summary (required), workspace, next_steps, active_files, +1 more.

recall_contextB

Search MindGate (بوابة Ψ§Ω„ΨΉΩ‚Ω„) using FTS5 BM25 full-text ranking for relevant project decisions, latest cross-agent session handoff, and developer preferences.

Inputs: limit, query, status, category, +2 more.

remember_decisionA

Save an architectural decision, coding convention, bug root-cause, or important context into MindGate (بوابة Ψ§Ω„ΨΉΩ‚Ω„) so all AI tools remember it.

Inputs: title (required), content (required), tags, category, +3 more.

set_user_preferenceB

Save a persistent developer preference or global coding rule (e.g., preferred test runner, naming conventions, forbidden packages).

Inputs: key (required), value (required), category.

sync_workspace_rulesA

Generate a structured Markdown rules file (AGENTS.md, .cursorrules, or CLAUDE.md) from stored MindGate memories, conventions, preferences, and latest session handoff. Writes are atomic; existing files are backed up to .bak- and hand-written files are never overwritten unless force=true.

Inputs: force, workspace, project_dir, target_file, +1 more.

update_memoryB

Update an existing memory or architectural decision in-place by its ID without losing its record ID or creation timestamp.

Inputs: id (required), tags, title, status, +5 more.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 13 tools

    Disambiguation4/5

    Most tools have clearly distinct purposes: creating, updating, deleting, deprecating, recalling, compacting, exporting, and syncing memories are separable. There is minor potential overlap between remember_decision and set_user_preference because both can store conventions/rules, but the descriptions distinguish project decisions from developer preferences.

    Naming Consistency5/5

    All 13 tool names consistently use snake_case with a verb_noun pattern. Differences like singular/plural nouns (memory vs memories) are natural and do not break predictability.

    Tool Count5/5

    The server has 13 tools, which is well within the typical 3-15 range for a focused memory/context server. Each tool appears to earn its place by covering a distinct operation in the memory lifecycle.

    Completeness4/5

    The surface covers core memory CRUD/lifecycle operations, preferences, session handoffs, compaction, export, and rules synchronization. Minor gaps exist, such as no direct get_memory_by_id or import/restore counterpart for export_memory_snapshot, but agents can work around these with recall_context and existing update/delete tools.

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      A
      maintenance
      Gives AI coding agents persistent, local-first memory so they can store, semantically search, and recall decisions, preferences, error patterns, and cross-project guidelines directly during a session. It also optionally queues tasks for autonomous execution against that same memory.
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Provides AI coding agents with a local-first persistent memory layer they can read and write during sessions, storing decisions, preferences, error patterns, and research per project or globally. Enables semantic and keyword search, formatted context recall, and cross-project guideline surfacing without API keys or cloud storage.
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Gives AI coding agents a local-first persistent memory they can read and write directly during sessions, storing decisions, preferences, error patterns, and guidelines in per-project and global SQLite stores. Enables semantic and keyword retrieval of relevant context across sessions so agents start work already knowing a codebase's conventions and history.
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI coding agents to store and retrieve persistent project and cross-project memories via semantic search, so decisions, preferences, error patterns, and guidelines survive across sessions. Optionally supports autonomous task execution built on the same local-first knowledge store.
      -