memory-mcp
Enables agents to persist, search, and manage short- and long-term memories using local SQLite storage and offline embeddings, with tools for recall, update, confirmation, and consolidation without external services.
README
memory-mcp
A standalone MCP server for persistent agent memory — short/long-term tiers, measurable reliability, and lifecycle maintenance — backed by SQLite (FTS5 + sqlite-vec) with local MiniLM embeddings. No external services, no API keys.
Requirements
- Node.js >= 22
- The package ships compiled JavaScript, so no TypeScript toolchain is needed at runtime.
Install
npm install @jommar/memory-mcp
Two executables are provided:
| Command | Purpose |
|---|---|
memory-mcp-server |
The MCP server (stdio by default, HTTP via MEMORY_TRANSPORT) |
memory-mcp |
Store maintenance CLI (export, import, reindex, stats) |
Quickstart
stdio (default)
Point your MCP client at the server binary:
{
"mcpServers": {
"memory": {
"command": "memory-mcp-server"
}
}
}
Or run it directly:
memory-mcp-server
With npx, select the server bin explicitly (installs the package on first use):
npx -y -p @jommar/memory-mcp memory-mcp-server
HTTP (localhost only)
MEMORY_TRANSPORT=http memory-mcp-server
The HTTP endpoint binds to 127.0.0.1:3000 by default and serves both the modern
(2026-07-28) and legacy (2025-11-25) protocol revisions from the same endpoint, so
any MCP client can connect. The server is stateless — no session id is required.
First run
The store is created automatically at ~/.memory-mcp/memory.db. Embeddings are
offline-first: no model is downloaded unless you opt in.
# opt in to the one-time model download (about 23 MB, MiniLM-L6, q8 quantized)
MEMORY_EMBEDDING_OFFLINE=false memory-mcp-server
Until a model is available, remember and recall still work — they fall back to
keyword search only. Use the CLI reindex to backfill vectors after the model is
in place.
Configuration
All configuration is via MEMORY_* environment variables (no config file):
| Variable | Default | Purpose |
|---|---|---|
MEMORY_DB_PATH |
~/.memory-mcp/memory.db |
SQLite database file |
MEMORY_TRANSPORT |
stdio |
stdio or http |
MEMORY_HTTP_HOST |
127.0.0.1 |
HTTP bind host (localhost only) |
MEMORY_HTTP_PORT |
3000 |
HTTP bind port |
MEMORY_EMBEDDING_OFFLINE |
true |
false opts in to the one-time model download |
MEMORY_EMBEDDING_DOWNLOAD_TIMEOUT_MS |
300000 |
Timeout for a model download attempt |
MEMORY_EMBEDDING_CACHE_DIR |
~/.memory-mcp/cache |
Where downloaded models are cached |
MEMORY_UI_PORT |
3001 |
Explorer UI port (dev tool; auto-increments when busy) |
Tools
Ten tools are registered: remember, recall, get, update, forget, list,
confirm, contradict, promote, consolidate. See docs/tools.md
for the full reference with inputs and behaviors.
remember accepts an interactive opt-in: when it finds near-duplicate entries it
can ask the client to merge or create (MRTR), and degrades gracefully for clients
without interactive support.
Maintenance 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
Memory explorer (UI)
A read-only visual explorer for the store: links graph (React Flow, force-directed
layout clustered by type), reliability breakdown per memory, history, supersession
chains, filters by scope/type/tier/status, and a maintenance drawer listing
consolidate proposals (orphans, stale entries, duplicate clusters) with
click-to-select. It opens the SQLite database read-only, so it is safe
to run alongside a live server and cannot mutate data.
The UI lives in the ui/ workspace and is a development tool — it is not part of
the published package:
npm run ui:build # compile the API server + bundle the frontend
npm run ui:start # serve at http://127.0.0.1:3001
For frontend development with hot reload: npm run ui:dev in one terminal
(proxies /api to 3001) and npm run ui:start in another.
If the port is taken, the server auto-increments (3001 → 3010) and prints the
bound URL. Configuration: MEMORY_DB_PATH (same store as the server) and
MEMORY_UI_PORT (default 3001). The bind host is always 127.0.0.1.
Documentation
- docs/tools.md — tool reference
- docs/reliability.md — reliability model and lifecycle rules
(the report-only maintenance engine behind
consolidate)
License
MIT — see LICENSE.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。