lessons-mcp
lessons-mcp
一个用于 Claude Code 的 MCP 服务器,用于存储和搜索经验教训,从而避免 Claude 重复过去的错误。可以将其视为一个带有全文搜索和基于标签导航的持久化经验日志。
快速开始
git clone https://github.com/<your>/lessons-mcp
cd lessons-mcp
pip install mcp添加到 ~/.claude/mcp.json:
{
"mcpServers": {
"lessons": {
"command": "python3",
"args": ["/path/to/lessons-mcp/server/server.py"]
}
}
}Related MCP server: Support Engineer MCP Server
工具
suggest_metadata
在写入前预览可用的类别/标签。返回现有的概况和建议。
record_lesson
记录一条新经验。返回关于标签重用一致性的反馈。
search_lessons
搜索过去的经验。使用 FTS5(标签/类别/标题)+ LIKE 回退(中文正文)。
list_categories
浏览带有近期标签活动的类别。
list_tags
浏览类别内带有使用计数的标签。
存储
SQLite 位于 ~/.claude/lessons.db(或 $LESSONS_DB_PATH)。
包含一个表 + FTS5 索引,首次运行时自动创建。
与 Claude Code 集成
1. 添加到 MCP 配置
添加到 ~/.claude/mcp.json:
{
"mcpServers": {
"lessons": {
"command": "/Users/karsa/proj/lessons-mcp/.venv/bin/python3",
"args": ["/Users/karsa/proj/lessons-mcp/server/server.py"]
}
}
}2. 添加指针到 MEMORY.md
添加到 ~/.claude/memory/MEMORY.md:
## Lessons System
Lessons MCP available. Tools: search_lessons, suggest_metadata, record_lesson,
list_categories, list_tags3. 重启 Claude Code
服务器会在 Claude Code 启动时自动运行。
你应该会在日志中看到:lessons-mcp v1.0.0 | ~/.claude/lessons.db | 1 lessons
This server cannot be deployed
Maintenance
Related MCP Connectors
An MCP server that automatically collects feedback on your MCP server.
An MCP server for deep research or task groups
An MCP server that provides tools to discover and retrieve podcast episodes transcripts.
The MCP server that vets MCP servers: identity, risk grade and per-tool risk before you install.
Related MCP Servers
- AlicenseAqualityCmaintenanceAn MCP server that allows users to efficiently search and reference user-configured documents through document listing, grep searching, semantic searching with OpenAI Embeddings, and full document retrieval.43MIT
- -licenseNot gradedqualityBmaintenanceA vendor-agnostic MCP server for technical support engineers, providing knowledge search, ticket analysis, and resolution suggestions.-
- AlicenseNot gradedqualityCmaintenanceA tiny local MCP memory server that stores lessons learned and resurfaces them before your AI agent repeats the same mistake. It provides tools for adding, searching, listing, forgetting, and inspecting lessons via MCP stdio.MIT
- FlicenseNot gradedqualityCmaintenanceMCP server that enables DevOps infrastructure Q&A, providing tools to search infrastructure docs, look up hosts, and query logs.-