原型 · 预览版:收录官方注册中心里的全部服务器,每 30 分钟同步一次。评价和账户功能将在后续阶段推出。
PopNx MCP为使用 AI 的人准备的 MCP 服务器 · 用大白话讲清楚

Longterm Memory

作者:MarcelRoozekrans版本 1.6.1i★ –i在你的电脑上运行
注册名称io.github.MarcelRoozekrans/longterm-memory

安装

概览

作者提供的说明(英文原文)

A fully local MCP server for long-term memory with semantic search

PopNx MCP 的三大支柱

这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。

它能帮你做什么

我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。

  • 连接方式: 在你的电脑上运行
  • 传输方式: stdio
  • 分类: 搜索与 AI 记忆

安装

选择你使用的 AI 应用,然后复制设置。

安装之前

  • 基础检查:1 项中通过 1 项
  • 在你的电脑上运行,拥有你的用户账户的权限(文件、网络、应用)。
  • 注册中心没有列出需要填写的密钥。

你需要

  • npm已安装 Node.js(用于 npx 命令)

你用的是哪个应用?

在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。

打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json

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

在终端中运行这条命令

claude mcp add longterm-memory -- npx -y longterm-memory-mcp

在 Cursor 中打开

或者自己复制设置

粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json

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

浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。

在 VS Code 中打开

或者自己复制设置

粘贴到项目中的 .vscode/mcp.json

{
  "servers": {
    "longterm-memory": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "longterm-memory-mcp"
      ]
    }
  }
}

浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。

这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。

你的选择通过 Cookie 保存在这台设备上,无需账户。

这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。

它能做什么

它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。

基础检查i

我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月6日

  • ✓ 通过

    作者与仓库一致

    注册名称已通过 GitHub 账户 MarcelRoozekrans 验证,该账户拥有此仓库

  • … 尚未检查

    仍在维护

    我们还没有从 GitHub 读取这个仓库

  • … 尚未检查

    有许可证

    我们还没有从 GitHub 读取这个仓库

  • – 不适用

    端点有响应

    它在你的电脑上运行,没有互联网端点

  • – 不适用

    使用 OAuth 登录

    在你的电脑上运行,改用本地设置

  • … 尚未检查

    工具描述中没有隐藏指令

    它在你的电脑上运行;我们只能读取互联网端点的工具列表

与“搜索与 AI 记忆”中的其他服务器比较i

  • 星标数多于此分类中其他 7247 个服务器的 0%
  • 发布到注册中心的时间比此分类中其他 7247 个服务器的 84% 更新
  • 基础检查结果等于或优于此分类中其他 7247 个服务器的 100%

与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。

常见问题

Longterm Memory 安全吗?

它在 1 项适用的基础检查中通过了 1 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。

它需要哪些密钥或代码?

注册中心没有列出必需的密钥,不过有些服务器会在首次使用时要求你登录。

它在我的电脑上运行还是在云端?

它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。

它还在维护吗?

GitHub 仓库最后更新于–,最新版本(1.6.1)于6天前进入注册中心。

哪些应用可以使用它?

支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Node.js。

有什么可以替代它?

同一分类中有:Context7, Codebase Memory, Exa

替代选择

同一分类中其他作者的服务器,按星标数排序。

如何看卡片:★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i

Context7

作者:upstash

Up-to-date docs for AI agents

电脑或云端★ 64,224MIT今天更新
安装

Codebase Memory

作者:DeusData

Codebase knowledge graph for AI agents — 162 languages, sub-ms queries, 99% fewer tokens.

在你的电脑上运行★ 48,148MIT20天前更新
安装

Exa

作者:exa-labs

Connect AI agents to Exa for web search, content fetching, and multi-step research.

在云端运行★ 5,213MIT上个月更新
安装

作者的 README

打开 README

按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。

LongtermMemory-MCP

A fully local MCP server that gives AI agents persistent, semantic long-term memory — without any cloud dependencies.

Inspired by mcp-mem0, but runs 100% on your machine:

Featuremcp-mem0This project
StoragePostgreSQL / SupabaseSQLite (Node's built-in node:sqlite)
EmbeddingsOpenAI APILocal transformer (all-MiniLM-L6-v2)
Vector searchCloud vector DBIn-process cosine similarity
LLM dependencyOpenAI / OpenRouter / OllamaNone
SetupDatabase + API keys`npx longterm-memory-mcp`

Tools

Core
ToolDescription
save_memoryStore text with auto-generated semantic embedding, tags, importance, and type
search_memoryFind relevant memories using natural language queries (cosine similarity)
update_memoryModify an existing memory's content, metadata, tags, importance, or type
delete_memoryRemove a specific memory by ID
delete_all_memoriesWipe all memories (irreversible)
get_all_memoriesList all stored memories (paginated)
memory_statsGet count and database location
Search
ToolDescription
search_by_typeFilter memories by category (general, fact, preference, conversation, task, ephemeral)
search_by_tagsFind memories matching any of the provided tags
search_by_date_rangeFind memories created within a specific date range (ISO format)
Maintenance
ToolDescription
create_backupManually trigger a database backup with JSON export

Quick Start

Claude Code Plugin (recommended)

Install via the Claude Code marketplace — this sets up both the MCP server and a companion skill that teaches Claude how to use memory effectively:

/plugin marketplace add MarcelRoozekrans/LongtermMemory-MCP

/plugin install longterm-memory@longterm-memory-marketplace

This automatically:

  • Configures the MCP server (no manual JSON editing), pinned to the plugin's version: a plugin update also updates the server
  • Adds the automatic recall hook
  • Installs the long-term-memory skill (Claude learns to recall context at session start, save insights after tasks, and deduplicate memories)
Use with npx (no install needed)
npx longterm-memory-mcp

npx keeps running the version it cached first and does not look for updates. To move to a new release, name the version, as in npx -y longterm-memory-mcp@1.6.0, or use @latest, which checks the registry on every start.

Or install globally
npm install -g longterm-memory-mcp

longterm-memory-mcp

Or from source
git clone https://github.com/MarcelRoozekrans/LongtermMemory-MCP.git

cd LongtermMemory-MCP npm install && npm run build npm start

Configuration

Claude Code

If you installed via the plugin marketplace, the MCP server is already configured. For manual setup, add to your MCP settings (~/.claude/settings.json or project .claude/settings.json):

{

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

Claude Desktop

Add to claude_desktop_config.json:

{

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

Agent Instructions

The repo includes agent instructions that teach AI agents how to use memory effectively (automatic recall, save patterns, deduplication):

FilePurpose
skills/long-term-memory/SKILL.mdSelf-contained skill — auto-loaded by Claude Code plugin, can be referenced from any MCP client

Database Location

By default, memories are stored in a shared, user-scoped location:

~/.longterm-memory-mcp/memories.db

This means every project and every MCP client shares the same memory pool — you save a memory in one project and it's available everywhere.

Several sessions can use the same database at once. Each server process reads and writes the shared file directly (SQLite in WAL mode), so a memory saved in one session is visible to every other session right away, and no session overwrites what another saved. Requires Node.js 22.13 or later.

Databases from older releases open unchanged. A database from v1.0–1.3, which has no schema_meta table, is migrated in place with all its memories kept; a copy named memories.db.pre-migration- .bak is written next to it first.

Upgrading from 1.4 or earlier: stop every running session that uses the old version before starting one with the new version. Older releases keep the whole database in memory and rewrite the file on each save, so an old process left running would overwrite what new sessions saved.

Per-project database

To isolate memories for a specific project, set the MEMORY_DB_PATH environment variable:

{

"mcpServers": { "longterm-memory": { "command": "npx", "args": ["-y", "longterm-memory-mcp"], "env": { "MEMORY_DB_PATH": "/path/to/project/memories.db" } } } }

Memory Types

Each memory has a memory_type that determines how it's categorized and how quickly it decays:

TypeDescriptionDecay half-life
generalDefault catch-all60 days
factVerified information120 days
preferenceUser/project preferences90 days
conversationConversation context45 days
taskTask-related notes30 days
ephemeralShort-lived context10 days

Tags & Importance

  • Tags: Categorize memories with string tags (e.g. ["auth", "backend"]). Search with search_by_tags.
  • Importance (1–10): Controls how resistant a memory is to decay. Default is 5. Higher importance decays more slowly.
  • Protected tags: Memories tagged with core, identity, or pinned skip decay entirely.

Decay & Reinforcement

Memories decay over time to keep the store relevant:

  • Decay: Each memory type has a half-life (see table above). Importance decreases exponentially based on time since last access, with a floor that prevents full deletion.
  • Reinforcement: Every time a memory is accessed via search, its importance increases by +0.1 (up to a max of 10). Frequently accessed memories stay important.
  • Lazy evaluation: Decay is calculated on access, not on a timer — no background processes needed.

Content Deduplication

Memory content is hashed (SHA-256) on save. If identical content already exists, the save is rejected with a reference to the existing memory ID. This prevents duplicate entries automatically.

Content Guard

Memories end up in the database and in its JSON backups, so content is filtered before it is stored:

  • ` ` spans are removed. Text inside … is never stored, embedded or hashed. An unclosed removes everything after it. Content that is empty once the spans are removed is rejected.
  • Secrets are rejected. save_memory and update_memory refuse content, metadata values and tags that look like a secret. The error names the pattern that matched and never the value.
PatternMatches
private-keyPEM / OpenSSH / PGP private key headers (certificates are allowed)
github-tokenghp_, gho_, ghu_, ghs_, ghr_ and github_pat_ tokens
api-keysk-… style API keys
aws-access-keyAKIA… / ASIA… access key ids
jwtJSON Web Tokens
slack-tokenxoxb-, xoxp- and similar Slack tokens
secret-assignmentrandom-looking values after password=, token:, secret=, api_key=, KEY= and similar. References ($VAR, ${{ … }}), placeholders (<…>), calls and plain words are allowed

Configure it with environment variables:

{

"mcpServers": { "longterm-memory": { "command": "npx", "args": ["longterm-memory-mcp"], "env": { "MEMORY_GUARD_DISABLE": "jwt,slack-token", "MEMORY_GUARD_EXTRA_PATTERNS": "{\"internal-host\": \"\\\\b[a-z0-9-]+\\\\.corp\\\\.example\\\\b\"}" } } } }

  • MEMORY_GUARD_DISABLE: a comma-separated list of pattern names to turn off, or all for every built-in pattern. spans are removed either way. An unknown name stops the server at startup.
  • MEMORY_GUARD_EXTRA_PATTERNS: a JSON object of extra patterns to reject, as name → regular expression.

The guard applies to new saves and updates only. Memories stored before it existed are not rescanned.

Automatic Recall

The Claude Code plugin ships a UserPromptSubmit hook that recalls memories without the agent having to ask. On the first prompt of each session it searches with the prompt text and adds the best matches to the context as a short list:

Long-term memories that may be relevant (longterm-memory; search_memory gives the full text):
  • [2026-10-22 fact] pkill -f also matches the agent's own shell … (id 31ece450-…)
  • Once per session: the hook keeps a marker file per session id in recall-sessions/ next to the database. Later prompts in that session cost one node start, about 30 ms, and no search.
  • Project: the hook takes the project name from the session's working directory. A memory that names the project in its content, tags or metadata ranks a little higher. The name is not part of the search text: a short prompt would then match on the project name alone.
  • Cheap when it misses: nothing is injected when no memory reaches the threshold, and the block never exceeds the token cap.
  • Content guard: a stored memory that the guard rejects, such as one saved before the guard existed, is never injected.
  • Never blocks a prompt: errors go to stderr and the prompt continues.
  • Pinned version: the hook runs npx longterm-memory-mcp@ recall --hook, so a cached older copy is never used. The plugin's MCP server is pinned the same way.

Configure it with environment variables in your Claude Code settings (env in ~/.claude/settings.json). The hook runs in Claude Code's environment, not the MCP server's, so a custom MEMORY_DB_PATH has to be set there too.

VariableDefaultMeaning
MEMORY_RECALL_ENABLEDtruefalse turns the hook off
MEMORY_RECALL_K5at most this many memories (1–50)
MEMORY_RECALL_THRESHOLD0.5minimum cosine similarity (-1 to 1)
MEMORY_RECALL_MAX_TOKENS400cap on the injected block, estimated at 4 characters per token
MEMORY_RECALL_STATE_DIR /recall-sessionswhere the once-per-session markers live; markers older than 30 days are removed
Recall CLI

The hook calls the recall subcommand, which also works on its own:

npx longterm-memory-mcp recall "how do we deploy the stack"

npx longterm-memory-mcp recall --k 3 --threshold 0.4 --project docker "deploy"

It prints the same list the hook injects, or No relevant memories found. on stderr. Options: --k, --threshold, --max-tokens and --project (default: the current directory's name, "" for none). It does not create a database that does not exist yet. With --hook it reads a Claude Code UserPromptSubmit event from stdin and answers with additionalContext.

Backups

Backups are managed automatically and can also be triggered manually via the create_backup tool.

只显示了开头部分;其余内容请在仓库中阅读

问 PopNx