mcp-memory-server
MCP 内存服务器
通过 Markdown 文件 + SQLite FTS5 全文搜索,为 Blockbrain(或任何 MCP 客户端)提供持久的代理内存。
为什么?
Blockbrain 代理不会在会话之间保留内存。每次对话都从零开始。这个 MCP 服务器解决了这个问题——代理可以保存学到的内容,并在下次回忆起来。
工作原理:
代理解决问题 → 使用解决方案调用
memory_save代理开始新任务 → 调用
memory_recall检查过去是否遇到过类似问题所有记忆都存储为可读的 Markdown 文件,并索引到 SQLite 中以实现快速搜索
Related MCP server: universal-memory-mcp
工具
工具 | 描述 |
| 存储记忆条目(主题、标题、内容) |
| 按关键字/主题搜索记忆 (FTS5) |
| 列出所有已存储的主题及其条目数 |
| 按 ID 删除记忆条目 |
快速开始 (Docker)
# 1. Clone
git clone https://github.com/lanlibbi/mcp-memory-server.git
cd mcp-memory-server
# 2. Configure
cp .env.example .env
# Edit .env — set MEMORY_API_KEY!
# Generate a key: openssl rand -hex 32
# 3. Run
docker compose up -d
# 4. Verify
curl http://localhost:8080/healthBlockbrain 集成
公开暴露服务器 — Blockbrain 需要一个 HTTPS URL:
选项 A:Cloudflare Tunnel(
cloudflared tunnel --url http://localhost:8080)选项 B:任何支持 TLS 的反向代理(nginx、Caddy、Traefik)
选项 C:用于测试的 ngrok(
ngrok http 8080)
在 Blockbrain 中注册:
转到 管理 → 代理 → MCP 服务器
点击 "+ 添加 MCP 服务器"
填写:
名称: Memory Server
服务器 URL:
https://<your-public-url>/sse传输协议: SSE
身份验证: API 密钥
API 密钥: (来自 .env 的值)
保存并激活
分配给代理,并在代理的系统提示词中添加说明:
Before starting a new task, call memory_recall with keywords related to the task. After completing a task or learning something new, call memory_save with: - topic: a category for the task (e.g. "contract-review", "supplier-issue") - title: a short descriptive title - content: what was the problem, what was the solution, what was learned
配置
所有配置均通过环境变量进行:
变量 | 默认值 | 描述 |
| (空 = 无身份验证) | 用于 X-API-Key 头的 API 密钥 |
|
| Markdown 文件的存储位置 |
|
| HTTP 端口 |
|
| 每次查询的最大搜索结果数 |
|
| debug、info、warning、error |
存储
记忆以带有 YAML frontmatter 的 Markdown 文件形式存储:
/data/memories/
├── contract-review/
│ ├── nda-standard-clauses.md
│ └── liability-clause-fix.md
├── supplier-issue/
│ └── delayed-delivery-workaround.md
└── memory.db ← SQLite FTS5 index每个文件如下所示:
---
id: a1b2c3d4e5f67890
topic: contract-review
title: NDA Standard Clauses
created_at: 2026-08-20T15:00:00Z
updated_at: 2026-08-20T15:00:00Z
---
# NDA Standard Clauses
The standard NDA should always include...您可以直接浏览、编辑或删除记忆——它们只是 Markdown 文件。SQLite 索引会自动保持同步。
本地开发(不使用 Docker)
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
export MEMORY_API_KEY=test-key
export MEMORY_DATA_DIR=./data/memories
python -m uvicorn src.server:app --host 0.0.0.0 --port 8080API 端点
端点 | 方法 | 描述 |
| GET | 健康检查(无需身份验证) |
| GET | 用于 MCP 客户端连接的 SSE 端点 |
| POST | MCP 消息端点(由 SSE 传输使用) |
技术栈
Python 3.12 + MCP SDK
Starlette + Uvicorn 用于 HTTP/SSE
SQLite FTS5 用于全文搜索(零外部依赖)
Markdown 用于人类可读的存储
许可证
MIT
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 Servers
- AlicenseNot gradedqualityDmaintenanceMCP server providing persistent memory management for AI agents using SQLite and FTS5, enabling storage, full-text search, and recall of memories with namespace isolation.1MIT
- AlicenseAqualityCmaintenancePersistent memory MCP server for AI agents, using SQLite with hybrid keyword and semantic search for long-term memory storage.5Do What The F*ck You Want To Public
- AlicenseNot gradedqualityBmaintenancePersistent memory MCP server that stores and retrieves memories in Markdown files, enabling shared context across multiple AI agents with hybrid search and deduplication.MIT
- AlicenseAqualityBmaintenanceMCP server for persistent, cross-session, local-first memory for AI agents, storing memories as Markdown files with SQLite indexing for hybrid search.24Apache 2.0
Related MCP Connectors
Person-owned, portable AI memory as a remote MCP server, readable and writable by any MCP client.
Token-efficient MCP memory for Markdown vaults. Tiered search, GraphRAG, AI memories.
Cloud-hosted MCP server for durable AI memory
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/lanlibbi/mcp-memory-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server