记忆银行MCP服务器为客户端提供数据读写服务,通过解析请求并操作SQLite数据库,实现对项目关键信息的管理。以下将详细介绍其安装配置、功能使用等内容。
npm install
npm start
.env文件并添加以下内容,根据需要修改数据库路径:DB_PATH=./memory-bank/memory.db
section参数。section参数确定目标数据库表。记忆银行的核心由以下SQLite表组成,用于存储项目的关键信息:
{
"tool": "update_memory_bank_entry",
"args": {
"section": "decisions",
"entry_data": {
"reason": "采用模块化架构以提高可维护性。",
"outcome": "成功实施模块化架构,减少了耦合度。"
}
}
}
{
"tool": "get_memory_bank_section",
"args": {
"section": "progress",
"limit": 5
}
}
graph TD
Client["客户端"] -- "工具调用\n(例如,更新条目,section='decisions')" --> MCPServer["记忆银行MCP服务器"]
MCPServer -- "解析请求" --> Router{"路由/逻辑"}
subgraph "数据库交互"
direction LR
Router -- "section='product_context'?" --> Table_PC["product_context表"]
Router -- "section='decisions'?" --> Table_DEC["decisions表"]
Router -- "section='progress'?" --> Table_PROG["progress表"]
Router -- "section='focus'?" --> Table_FOC["focus表"]
Router -- "section='system_patterns'?" --> Table_SP["system_patterns表"]
Table_PC -- "读写操作" --> SQLiteDB["SQLite数据库"]
Table_DEC -- "读写操作" --> SQLiteDB
Table_PROG -- "读写操作" --> SQLiteDB
Table_FOC -- "读写操作" --> SQLiteDB
Table_SP -- "读写操作" --> SQLiteDB
end
SQLiteDB -- "操作结果" --> MCPServer
MCPServer -- "格式化响应" --> Client
.env文件中的数据库路径配置正确。通过以上步骤和说明,您可以顺利配置并使用记忆银行MCP服务器。如有任何问题或建议,请随时联系支持团队。