layer-memory
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@layer-memoryremember my favorite color is blue"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Layer Memory
本地优先、Markdown 原生的 AI 代理分层记忆系统。基于 Midway.js 的 MCP 服务,SQLite 存储,pnpm monorepo。
项目架构
layer-memory/
├── packages/
│ └── core/ # 记忆核心库(框架无关)
│ └── src/store/ # 存储层抽象、SQLite 实现、类型定义
├── apps/
│ ├── mcp-server/ # MCP 服务端(Midway.js 4.0)
│ │ └── src/tools/ # 4 个 MCP Tools
├── docs/ # 文档站(dumi 2.x)
├── skill/ # AI Agent skill 定义
├── .husky/ # Git hooks
├── .changeset/ # 版本管理
├── docker-compose.yml
├── Dockerfile
└── pnpm-workspace.yamlMCP Tools
工具 | 说明 | 参数 |
| 存储一条记忆 | key, value, type(可选), tags(可选) |
| 搜索已存储的记忆 | query, type(可选), tags(可选), limit(可选) |
| 导出所有记忆为 JSON | outputPath |
| 从 JSON 文件导入记忆 | inputPath |
记忆类型: working (工作记忆) / persona (人格画像) / fact (事实知识)
Related MCP server: Mneme Memory MCP
快速开始
前置要求
Node.js >= 20
pnpm 10.x(安装:
corepack enable && corepack prepare pnpm@10.15.0 --activate)
安装
git clone https://github.com/Dante926/layer-memory.git
cd layer-memory
pnpm install本地开发
pnpm dev服务启动在 http://localhost:3000,MCP endpoint 在 /mcp。
构建
pnpm build所有包编译到各自 dist/ 目录。
文档站
pnpm docs:devDocker 部署
启动服务
docker compose up -d服务运行在 http://localhost:3000。
数据持久化
记忆数据存储在 Docker volume layer-memory-data 中,容器重启/更新不会丢失。
重新构建
docker compose build
docker compose up -d连接到 AI Agent
Claude Code
在 ~/.claude/settings.json 中配置 MCP:
{
"mcpServers": {
"layer-memory": {
"type": "url",
"url": "http://localhost:3000/mcp"
}
}
}Codex / Cursor
在项目的 .cursor/mcp.json 中配置:
{
"mcpServers": {
"layer-memory": {
"type": "url",
"url": "http://localhost:3000/mcp"
}
}
}使用示例
存储记忆:
调用 memory_store(
key="架构决策",
value="选择 Midway.js 4.0 MCP + SQLite",
type="fact",
tags="项目:layer-memory"
)搜索记忆:
调用 memory_recall(query="架构决策", limit=5)导出备份:
调用 memory_export(outputPath="backup.json")版本管理
本项目使用 Changeset 管理版本:
pnpm changeset # 创建变更记录
pnpm version # 更新版本号
pnpm publish # 发布开发
提交规范
使用 Conventional Commits:
feat:新功能fix:修复chore:工程化docs:文档
代码格式化
pnpm formatThis 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.
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/Dante926/layer-memory'
If you have feedback or need assistance with the MCP directory API, please join our Discord server