Skip to main content
Glama
jommar
by jommar

memory-mcp

memory-mcp 是一个独立的 MCP 服务器,用于持久化智能体记忆 —— 短期/长期记忆分层、可度量的可靠性以及生命周期维护 —— 以 SQLite(FTS5 + sqlite-vec)为后端,并使用本地 MiniLM 嵌入。无需外部服务,无需 API 密钥。

环境要求

  • Node.js >= 22

  • 该包随附编译后的 JavaScript,因此运行时无需 TypeScript 工具链。

Related MCP server: MCP Vector Memory

安装

npm install @jommar/memory-mcp

提供两个可执行文件:

命令

用途

memory-mcp-server

MCP 服务器(默认为 stdio,通过 MEMORY_TRANSPORT 使用 HTTP)

memory-mcp

存储维护 CLI(exportimportreindexstats

快速开始

stdio(默认)

将 MCP 客户端指向服务器可执行文件:

{
  "mcpServers": {
    "memory": {
      "command": "memory-mcp-server"
    }
  }
}

或直接运行:

memory-mcp-server

使用 npx 时,请显式指定服务器可执行文件(首次使用时会先安装该包):

npx -y -p @jommar/memory-mcp memory-mcp-server

HTTP(仅限 localhost)

MEMORY_TRANSPORT=http memory-mcp-server

HTTP 端点默认绑定到 127.0.0.1:3000,并在同一端点同时提供新版(2026-07-28)和旧版(2025-11-25)协议修订版的协议,因此任何 MCP 客户端都能连接。服务器无状态——无需会话 ID。

首次运行

存储会在 ~/.memory-mcp/memory.db 自动创建。数据库中的嵌入是离线优先的:除非你主动选择,否则不会下载任何模型。

# opt in to the one-time model download (about 23 MB, MiniLM-L6, q8 quantized)
MEMORY_EMBEDDING_OFFLINE=false memory-mcp-server

在模型可用之前,rememberrecall 仍然可以工作——它们只会退化为关键词搜索。模型就绪后,可使用CLI reindex 回填向量。

配置

所有配置均通过 MEMORY_* 环境变量完成(无配置文件):

变量

默认值

用途

MEMORY_DB_PATH

~/.memory-mcp/memory.db

SQLite 数据库文件

MEMORY_TRANSPORT

stdio

stdiohttp

MEMORY_HTTP_HOST

127.0.0.1

HTTP绑定主机(仅限 localhost)

MEMORY_HTTP_PORT

3000

HTTP绑定端口

MEMORY_EMBEDDING_OFfLINE

true

设为 false 时一次性下载模型的模型,同时选择下载模型

MEMORY_EMBEDDING_DOWNLOAD_TIMEOUT_MS

300000

模型下载尝试的超时时间

MEMORY_EMBEDDING_CACHE_DIR

~/.memory-mcp/cache

已下载模型的缓存位置

工具

共注册了十个工具:rememberrecallgetupdateforgetlistconfirmcontradictpromoteconsolidate。 有关输入和行为的完整参考,请参阅 docs/tools.md

remember 支持 interactive 选择:当发现近似重复的条目时,它可以让客户端选择合并或创建(MRTR),并在客户端不支持交互式功能时优雅降级。

维护CLI

memory-mcp export ./out      # write every memory as a markdown frontmatter file
memory-mcp import ./staging  # validate, then import (never overwrites existing keys)
memory-mcp reindex           # rebuild FTS + vector indexes from stored content
memory-mcp stats             # print store counts

文档文档

许可协议

MIT — 请参阅 LICENSE

Maintenance

ActivityMaintained
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • -
    license
    Not graded
    quality
    Not graded
    maintenance
    Provides persistent local memory functionality for AI assistants, enabling them to store, retrieve, and search contextual information across conversations with SQLite-based full-text search. All data stays private on your machine while dramatically improving context retention and personalized assistance.
    3
  • A
    license
    Not graded
    quality
    Not graded
    maintenance
    Provides AI coding agents with persistent, long-term memory through local semantic search and SQLite storage. It enables agents to save and retrieve architectural decisions or project context across different conversation sessions without requiring cloud services.
  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides persistent AI agent memory using a local vector database for long-term semantic storage and short-term session scratchpads. It enables low-latency memory operations including search, storage, and bulk management without external cloud dependencies.
  • A
    license
    Not graded
    quality
    C
    maintenance
    Provides persistent long-term memory for LLMs via local SQLite storage and semantic search, enabling recall across sessions without external APIs.
    19
    4
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jommar/memory-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server