feishu-memory-mcp
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., "@feishu-memory-mcpsearch my knowledge base for meeting notes"
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.
feishu-memory-mcp
飞书驱动的 RAG 记忆库 MCP server。 Agent 长期记忆 + 个人知识库,两者都存飞书多维表格,通过同一套 Model Context Protocol 接口可检索。
这是什么
feishu-memory-mcp 把 飞书(Lark / Feishu) 当成持久化后端,
给 LLM agent 提供两套隔离但统一的记忆服务:
Scope | 用途 | 谁来写 | 谁来读 |
| agent 的长期记忆(对话片段、agent 自动 add 的内容、解析后的资料) | agent | 全部 agent + 你 |
| 你的个人知识库(笔记、规范、文档) | 你(或 lark-ui 录入) | agent 可消费 |
两库都用飞书多维表格做持久化 + 本地 SQLite + LanceDB 做查询缓存,agent 通过 8 个 MCP 工具读写。
Related MCP server: Lark Base MCP Server
5 分钟跑起来
# 1. 装 Python 包
pip install feishu-memory-mcp
# 2. 装系统依赖(自动检测 Node.js / npm 然后 npm install -g @larksuite/cli)
feishu-memory install-deps
# 3. lark-cli OAuth 授权(会打开浏览器)
lark-cli config init
# 4. 配环境变量
export FEISHU_APP_ID=cli_xxxxxxxxxxxx
export FEISHU_APP_SECRET=...
export MEMORY_BITABLE_APP_TOKEN=bascnxxxxxxxxxxxx
export MEMORY_BITABLE_TABLE_ID=tblxxxxxxxxxxxxxxxx
export KNOWLEDGE_BITABLE_APP_TOKEN=bascnyyyyyyyyyyyy
export KNOWLEDGE_BITABLE_TABLE_ID=tblyyyyyyyyyyyyy
# 5. 验证
feishu-memory doctor # 6/6 检查过
feishu-memory sync # 第一次拉飞书 Bitable 数据
feishu-memory serve # 启动 MCP server(agent 客户端连)第 4 步需要你在飞书 UI 提前创建 2 个多维表格(每个 16 字段),详细字段表见 docs/deployment.md。
给 agent 用:8 个 MCP 工具
把这段加到 agent 客户端的 mcp 配置(Claude Desktop / Cursor / Codex / etc):
{
"mcpServers": {
"feishu-memory": {
"command": "feishu-memory",
"args": ["serve"],
"env": { "FEISHU_APP_ID": "...", "...": "..." }
}
}
}启动后 agent 看到这 8 个 tool:
Tool | 用途 | Scope |
| 写一条记忆(agent 自己加,或保存对话) | memory / knowledge |
| 检索(4 种 mode:hybrid_rerank / hybrid / bm25 / vector) | memory / knowledge |
| 取一条完整内容 | memory / knowledge |
| 改一条的元数据(标题/标签) | memory / knowledge |
| 删除一条 | memory / knowledge |
| 列表(带分页 + 排序) | memory / knowledge |
| 计数 | memory / knowledge |
| 触发与飞书的同步(3 种 mode:incremental / full / rebuild) | memory / knowledge |
每个 tool 接受 scope 参数(memory / knowledge)。memory_query 还有 4 种 mode 选:
hybrid_rerank(默认):BM25 + 向量 + RRF + 重排hybrid:BM25 + 向量 + RRF(不要重排,更快)bm25_only:纯关键词vector_only:纯语义
详细 tool 文档:docs/tool-reference.md
命令行(CLI 运维)
feishu-memory 是个 single-binary CLI,每个子命令独立:
子命令 | 作用 |
| 打印首次安装的环境变量模板 |
| 检测 Node.js / npm 并装 lark-cli |
| 启动 MCP server(stdio 传输) |
| 诊断 Node / npm / lark-cli / config / cache 状态 |
| 手动触发与飞书的同步 |
| 看本地 cache 状态(记录数、最后 sync 时间、vector index 大小) |
| 导出 / 验证 Bitable 字段定义 vs spec |
| 重建本地 cache(model 切换后 / cache 损坏) |
| 打印版本号 |
每个子命令都支持 --help。
架构一览
[agent client] ←stdio/MCP→ [feishu-memory-mcp] ←subprocess→ [lark-cli] ←HTTPS→ [飞书]
• 8 tools │ │ Service Layer │ │ • Bitable
• stdin/stdout│ │ • MemoryService │ │ • Docx
│ │ • SearchService │ │ • Drive
│ │ • SyncService │ │
│ │ │ │
│ ├─ Index Engine │ │
│ │ • EmbeddingEngine │ │
│ │ (bge-m3 / MiniLM) │ │
│ │ • TextChunker │ │
│ │ • Reranker │ │
│ │ • RRFMerger │ │
│ │ │ │
│ └─ Local Storage │ │
│ • SQLite (FTS5) │ │
│ • LanceDB (vectors) │ │
│ │
└─ Skill file: skill/feishu-memory/SKILL.md详细架构:docs/architecture.md
Embedding 模型选择
feishu-memory-mcp 用 sentence-transformers
做 embedding。默认用最小最快的 all-MiniLM-L6-v2(80MB / 30秒下载 /
不需要 HF_TOKEN),所以任何机器装上就能跑。生产环境中文/多语种可换更大的:
Model | 大小 | 维度 | 何时用 |
| 80MB | 384 | 无 token 快速启动 |
| 33MB | 384 | 极简英文 |
| 2.3GB | 1024 | 中文/多语种推荐 |
| 1.3GB | 1024 | 纯英文高质量 |
| 1GB | 768 | 中英文平衡 |
切换:.env 里改 EMBEDDING_MODEL 然后重启 + 跑 feishu-memory migrate(不同 model 维度不同)。
加速下载:免费申请 HF_TOKEN https://huggingface.co/settings/tokens,5-10x 加速。
项目特点
飞书是唯一权威源 — 本地 cache 可任意删,
feishu-memory migrate一键从飞书恢复多 agent 共享同一记忆库 —
source_agent字段标记来源,不同 agent 共享同一张 Bitable可重建 vector index — 切换 embedding model 后
migrate重建 LanceDB失败容忍 — 飞书写失败不阻塞本地写,下次 sync 自动重试
CLI 优先 — 9 个子命令覆盖所有运维场景,不需要查 SQL / 直接读 Bitable
零额外 Node 包 —
lark-cli是 npm 全局唯一依赖;Python 端纯lancedb+sentence-transformers+ SQLiteOS 跨平台 — Windows / macOS / Linux 全部 CI 测过
真实环境验证 — 27 个 commit + 24 个 BUG 修复都是用真实飞书 Bitable 跑出来的
文档索引
docs/deployment.md — 11 步详细部署指南
docs/installation.md — 安装 + 飞书后台 + 模型选择
docs/architecture.md — 架构详解
docs/operations.md — sync 策略 + 运维 + 故障排查
docs/tool-reference.md — 8 个 tool 完整入参出参
CHANGELOG.md — 0.1.0 release notes
CONTRIBUTING.md — 贡献指南
skill/feishu-memory/SKILL.md — agent 自动加载的 skill
开发
git clone https://github.com/junqiu/feishu-memory-mcp
cd feishu-memory-mcp
pip install -e ".[dev]"
pytest # 跑全部 unit tests(205 个)
ruff check src testsCI:push 即跑(Python 3.11/3.12/3.13,Ubuntu latest)。
许可
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.
Latest Blog Posts
- 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/junqiu520/feishu-memory-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server