Back to Browse

Remem MCP Server

Developer ToolsLow Risk10.0MCP RegistryLocal
Free

Server data from the Official MCP Registry

Local-first memory for AI coding agents. Memory + CodeGraph + Wiki in one SQLite file.

About

Local-first memory for AI coding agents. Memory + CodeGraph + Wiki in one SQLite file.

Security Report

10.0
Low Risk10.0Low Risk

Valid MCP server (1 strong, 1 medium validity signals). No known CVEs in dependencies. Package registry verified. Imported from the Official MCP Registry.

4 files analyzed · 1 issue found

Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.

Permissions Required

This plugin requests these system permissions. Most are normal for its category.

file_system

Check that this permission is expected for this type of plugin.

env_vars

Check that this permission is expected for this type of plugin.

Shell Command Execution

Runs commands on your machine. Be cautious — only use if you trust this plugin.

database

Check that this permission is expected for this type of plugin.

How to Install

Add this to your MCP configuration file:

{
  "mcpServers": {
    "io-github-tinhien11-remem-mcp": {
      "args": [
        "-y",
        "remem-mcp"
      ],
      "command": "npx"
    }
  }
}

Documentation

View on GitHub

From the project's GitHub README.

remem-mcp

npm version GitHub stars License: MIT Benchmark

Your coding agent stops repeating the same mistakes.

Local memory that survives context compaction — learns from every error, injects fixes before the next attempt, and syncs to your git repo so your whole team shares it.

One command setup. No API key. No cloud. No database server. Just a SQLite file.

Demo: Error learning loop

See it in action

Error learning loopCodeGraph searchWeb viewer
Error learningCodeGraphViewer
Viewer: overviewCodeGraph: callersCodeGraph: search
OverviewCallersSearch

Install

npx remem-mcp setup

That's it. Auto-detects Claude Code, Cursor, Devin, Codex. Registers MCP server + hooks. Restart your agent.

npx remem-mcp demo     # Live demo: real build, real errors, real hooks
npx remem-mcp demo-codegraph  # Live CodeGraph demo on facebook/react
npx remem-mcp status   # One dashboard: everything at a glance

The demo creates a real TypeScript project, runs real npm run build, captures real TS2307 errors, and shows the full learning loop — capture → inject → fix → zero retries. No hardcoded strings.


Why it's different

remem-mcpMem0Claude MEMORY.mdMneme
Survives compactionYes — PreCompact hook saves checkpoint, re-injects afterYes — cloud storeNo — 200-line cap, silent truncationYes — PreCompact hook
Learns from errorsYes — auto-captures, injects fixesNoNoNo
Semantic searchHybrid BM25 + sqlite-vecVector onlyNo — LLM filename picker, max 5 filesVector + graph
Setup1 commandAPI key + cloudBuilt-inBuild from source (Rust)
Data locationLocal SQLiteCloudLocal markdownLocal SQLite
Team sharingGit-native (commit, diff, merge)Cloud syncCopy-pasteManual
API keyNoYesNoNo
CostFree$19–249/moFreeFree

Per-agent install

claude mcp add remem-mcp --scope user -- npx -y remem-mcp
npx remem-mcp install-hooks

Install in Cursor

Or add to ~/.cursor/mcp.json:

{
  "mcpServers": {
    "remem-mcp": { "command": "npx", "args": ["-y", "remem-mcp"] }
  }
}
devin mcp add remem-mcp --scope user -- npx -y remem-mcp
npx remem-mcp install-hooks

Add to ~/.codex/config.toml:

[mcp_servers.remem-mcp]
command = "npx"
args = ["-y", "remem-mcp"]

[mcp_servers.remem-mcp.env]
REMEM_GLOBAL_SESSION_KEY = "global"

Then run npx remem-mcp install-hooks.

MCP tools require sandbox_mode = "danger-full-access".


How it works

Memory lives in a local SQLite database — outside the agent's context window. When the agent compacts or starts a new session, memory is re-injected automatically. No more re-explaining what you already told it yesterday.

PreCompact hook: when the agent is about to compact context, remem-mcp saves a checkpoint (decisions made, approaches tried, what's verified working) to the DB. After compaction, the agent recalls it — so the compact doesn't destroy your session's learnings.

Two layers: automatic (runs via hooks, zero tool calls) and on-demand (you call when you need deeper context).

Automatic — three learning loops + compaction survival

All run via lifecycle hooks. The agent doesn't need to call any tool.

  1. Error learning — command fails → capture → inject fix before next attempt → succeed → upvote.

  2. Decision learningnpm install, git commit, config → auto-capture → inject past decisions before similar commands.

  3. Pattern learning — Write/Edit → auto-capture code patterns → inject same-language patterns before editing.

  4. Compaction survival — PreCompact hook fires before context compaction → saves checkpoint → agent recalls after compact. Memory survives.

On-demand — CodeGraph, Wiki, Search

When the automatic loops aren't enough, use these for deeper code navigation.

CodeGraph — symbol search, callers/callees, impact analysis. Auto-indexes on first use — just call codegraph_search and it indexes src/ automatically. No manual codegraph_index needed.

# Search symbols (auto-indexes src/ on first call)
npx remem-mcp search-code --query "parseTar"
# → parseTar  at  src/parse.ts:22

# List symbols in a file
npx remem-mcp list-code src/reporters/fancy.ts
# → Class    L49-135  FancyReporter
# → Method   L86-134  formatLogObj

# Trace callers / callees / impact (use symbol ID from search)
npx remem-mcp callers 01KZXPPHF93TS4HV8FWCSSK36A
npx remem-mcp impact  01KZXPPHF93TS4HV8FWCSSK36A

# Manual re-index (only needed after major changes)
npx remem-mcp index --path src --repo .

# Wiki + viewer
npx remem-mcp wiki ingest --path docs      # Index markdown docs + ADRs
npx remem-mcp wiki outdated                 # Find outdated wiki pages
npx remem-mcp viewer                        # Web UI at localhost:7331
  • CodeGraph — symbol search, callers/callees, impact analysis. Auto-indexes on first codegraph_search call. Auto-scoped to your project.
  • Wiki — markdown docs, ADRs, outdated detection.
  • Search — hybrid BM25 + sqlite-vec vector search with RRF fusion. explain_recall shows scores.

CodeGraph demo


Daily commands

npx remem-mcp status           # Everything at a glance
npx remem-mcp viewer           # Web UI at localhost:7331
npx remem-mcp errors           # Error dashboard
npx remem-mcp decisions        # Decision dashboard
npx remem-mcp patterns         # Pattern dashboard
npx remem-mcp recent [N]       # Recent captures
npx remem-mcp help all         # Full list of 40+ subcommands

Configuration

All settings have defaults. Config file is optional: ~/.config/remem-mcp/config.json.

SettingEnv varDefault
DB pathREMEM_DB_PATH~/.local/share/remem-mcp/memory.db
Cross-project memoryREMEM_GLOBAL_SESSION_KEY(unset)
Cross-project errorsREMEM_GLOBAL_ERRORS(unset, set to 1)
Suppress hook feedbackREMEM_QUIET(unset, set to 1)
Retro window (days)REMEM_RETRO_DAYS7
Core-only mode (disable advanced tools)REMEM_CORE_ONLY(unset, set to 1)
LLM API key (pipeline)REMEM_LLM_API_KEY(unset)

Team sharingnpx remem-mcp sync-export writes .remem-mcp/memory-export.jsonl. Commit it to git. Team members get the same memory on git pull (auto-imports on startup).


TypeScript SDK

import { Memory } from "remem-mcp";

const memory = new Memory();
await memory.capture("We chose SQLite for storage.", "decision", ["arch"]);
const results = await memory.recall("storage decision");

Benchmark

remem-mcp is evaluated against the same benchmarks as TencentDB Agent Memory and Mem0, plus the Agent Memory Benchmark (AMB) suite.

Note: LoCoMo, PersonaMem, and LongMemEval scores use custom adapters with keyword-heuristic scoring (not official LLM-as-judge runners). AMB uses the official CLI. See scripts/bench-all.sh for methodology.

Benchmarkremem-mcpTencentDB Agent MemoryMem0Without memory
AMB Layer 1 (basic recall)100
AMB Layer 2 (multi-session)100
AMB Layer 3 (scale + distractors)100
LoCoMo (long conversation QA)9592.5
PersonaMem (personalization)1007648
LongMemEval (long-term memory, ICLR 2025)9694.4
  • PersonaMembowen-upenn/PersonaMem (588 questions, 20 personas, multiple-choice QA). TencentDB reports 76% with memory enabled, 48% without. remem-mcp scores 100% using a search-recall proxy (no LLM API key needed).
  • LoCoMo — long conversation multi-hop QA (19 sessions, 400+ turns). Mem0 reports 92.5%. remem-mcp scores 95% with keyword + semantic-similarity scoring.
  • AMB — Agent Memory Benchmark (L1: 56 recall tests, L2: 5 multi-session scenarios, L3: 1K+ memories with distractors). remem-mcp scores 100/100/100 using the official AMB CLI.
  • LongMemEvalxiaowu0162/LongMemEval (ICLR 2025, 500 questions, 5 memory abilities: temporal reasoning, multi-session, knowledge update, single-session recall, abstention). Mem0 reports 94.4%. remem-mcp scores 96% on the oracle variant.

Run the benchmarks:

bash scripts/bench-all.sh           # Full: AMB + LoCoMo + PersonaMem (~5 min)
bash scripts/bench-all.sh --quick   # AMB only (~2 min)

Credits

Core based on TencentDB Agent Memory (MIT, Tencent 2026). Replaces the cloud backend with embedded SQLite + sqlite-vec + FTS5. Adds error/decision/pattern learning loops and lifecycle hooks.

License

MIT. See LICENSE.

Reviews

No reviews yet

Be the first to review this server!