memory-mcp
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提供两个可执行文件:
命令 | 用途 |
| MCP 服务器(默认为 stdio,通过 |
| 存储维护 CLI( |
快速开始
stdio(默认)
将 MCP 客户端指向服务器可执行文件:
{
"mcpServers": {
"memory": {
"command": "memory-mcp-server"
}
}
}或直接运行:
memory-mcp-server使用 npx 时,请显式指定服务器可执行文件(首次使用时会先安装该包):
npx -y -p @jommar/memory-mcp memory-mcp-serverHTTP(仅限 localhost)
MEMORY_TRANSPORT=http memory-mcp-serverHTTP 端点默认绑定到 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在模型可用之前,remember 和 recall 仍然可以工作——它们只会退化为关键词搜索。模型就绪后,可使用CLI reindex 回填向量。
配置
所有配置均通过 MEMORY_* 环境变量完成(无配置文件):
变量 | 默认值 | 用途 |
|
| SQLite 数据库文件 |
|
|
|
|
| HTTP绑定主机(仅限 localhost) |
|
| HTTP绑定端口 |
|
| 设为 |
|
| 模型下载尝试的超时时间 |
|
| 已下载模型的缓存位置 |
工具
共注册了十个工具:remember、recall、get、update、forget、list、confirm、contradict、promote、consolidate。 有关输入和行为的完整参考,请参阅 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文档文档
docs/tools.md — 工具参考
docs/rliability.md — 可靠性模型与生命周期规则 (
consolidate背后的仅报告维护引擎)
许可协议
MIT — 请参阅 LICENSE。
This server cannot be installed
Maintenance
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
Persistent memory and knowledge management for AI agents with semantic search and 50+ tools.
Persistent memory for AI agents: add, search, update, and delete long-term memories.
Persistent memory for AI agents. Search, store, and recall across sessions.
Persistent memory for AI agents. Search and store durable facts, preferences and decisions.
Related MCP Servers
- -licenseNot gradedqualityNot gradedmaintenanceProvides 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
- AlicenseNot gradedqualityNot gradedmaintenanceProvides 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.
- FlicenseNot gradedqualityDmaintenanceProvides 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.
- AlicenseNot gradedqualityCmaintenanceProvides persistent long-term memory for LLMs via local SQLite storage and semantic search, enabling recall across sessions without external APIs.194MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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