Memory Box MCP Server
Cline and Claude Desktop MCP integration for Memory Box - save, search, and format memories with semantic understanding
此MCP服务器提供与Memory Box实例交互的工具,允许您直接从Cline和Claude Desktop使用语义搜索来保存和搜索内存。
相关项目
此MCP服务器旨在与 记忆盒,一个基于向量嵌入的语义记忆存储和检索系统。
Memory Box提供此MCP服务器与之通信的后端API,允许您:
- 使用向量嵌入存储记忆以进行语义搜索
- 将记忆组织到可定制的存储桶中
- 根据意义而不仅仅是关键字搜索记忆
- 检索具有详细上下文的记忆
- 查找语义相关的记忆
- 跟踪内存处理状态
有关Memory Box的更多信息,包括如何设置自己的实例,请访问 内存盒网站.
特性
- 保存记忆:将格式化的内存与源信息和元数据一起保存到内存盒中
- 搜索记忆:使用带分页和日期排序的语义搜索来搜索您的记忆
- 找回记忆:从特定存储桶中获取所有记忆或记忆
- 水桶管理:创建和删除用于组织记忆的存储桶
- 内存管理:更新或删除现有记忆
- 查找相关记忆:发现语义相似的记忆
- 检查内存状态:监控记忆的处理状态
- 格式化内存:根据结构化系统提示格式化内存
- 使用统计:查看您当前的计划、使用指标和资源限制
安装
服务器已安装并配置为与Cline一起使用。请注意,您需要一个正在运行的Memory Box实例(自托管或使用memorybox.amovv.ai上的托管版本)才能使用此MCP服务器。
安装为Claude桌面扩展(推荐)
将Memory Box与Claude Desktop一起使用的最简单方法是通过桌面扩展:
- 下载最新
memory-box.mcpb文件来自 发布页面 - 打开克劳德桌面
- 前往“设置”>“扩展”
- 点击“从文件安装”
- 选择已下载的
memory-box.mcpb文件 - 在扩展设置中配置内存盒API令牌
该扩展将自动配置所有必要的环境变量和工具。
通过Smithery安装
通过以下方式自动安装克劳德桌面的内存盒MCP服务器 铁匠铺:
npx -y @smithery/cli install @amotivv/memory-box-mcp --client claude要完成设置,请执行以下操作:
- 在以下位置编辑Cline MCP设置文件:
~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json- 将您的Memory Box令牌添加到
MEMORY_BOX_TOKEN环境变量:
"memory-box-mcp": {
"command": "node",
"args": [
"
/build/index.js"
],
"env": {
"MEMORY_BOX_API_URL": "https://memorybox.amotivv.ai",
"MEMORY_BOX_TOKEN": "your-token-here",
"DEFAULT_BUCKET": "General"
},
"disabled": false,
"autoApprove": []
}- 您也可以通过更改默认bucket来自定义默认bucket
DEFAULT_BUCKET价值。
用法
配置后,您可以在Cline中使用以下工具:
保存存储器
使用正确的格式将内存保存到内存盒:
Use the save_memory tool to save this information about vector databases: "Vector databases like pgvector store and query high-dimensional vectors for semantic search applications."参数:
text(必填):要保存的内存内容bucket_id(可选):用于保存内存的bucket(默认值:“General”)format(可选):是否根据系统提示格式化内存(默认:true)type(可选):用于格式化的内存类型(技术、决策、解决方案、概念、参考、应用、事实)(默认值:“技术”)source_type(可选):内存源类型(默认:“llm_plugin”)reference_data(可选):有关内存源和上下文的其他元数据
搜索记忆
使用语义搜索搜索记忆:
Use the search_memories tool to find information about "vector databases"参数:
query(必填):搜索查询debug(可选):在结果中包含调试信息(默认值:false)
获取所有回忆
检索所有记忆:
Use the get_all_memories tool to show me all my saved memories获取Bucket记忆
从特定的存储桶中获取回忆:
Use the get_bucket_memories tool to show me memories in the "Learning" bucket参数:
bucket_id(必填):用于检索记忆的桶
格式化存储器
根据内存系统提示格式化文本,不保存:
Use the format_memory tool to format this text: "Vector databases like pgvector store and query high-dimensional vectors for semantic search applications."参数:
text(必填):文本格式type(可选):内存类型(技术、决策、解决方案、概念、参考、应用、事实)(默认值:“技术”)
获取相关记忆
查找与特定记忆在语义上相似的记忆:
Use the get_related_memories tool with memory ID 123参数:
memory_id(必填):用于查找相关内存的内存IDmin_similarity(可选):相关记忆的最小相似性阈值(0.0-1.0)(默认值:0.7)
检查内存状态
检查内存的处理状态:
Use the check_memory_status tool with memory ID 123参数:
memory_id(必填):用于检查状态的内存ID
获取使用情况统计信息
检索用户使用统计数据和计划信息:
Use the get_usage_stats tool to show me my current plan and usage metrics此工具返回:
- 当前计划信息(例如,免费、基本、专业、传统)
- 用户状态和限额执行信息
- 当月使用指标(存储操作、搜索操作、API调用)
- 具有人类可读格式的数据处理量
- 基于您的计划的资源限制(如适用)
- 按类型细分的操作
此操作不需要任何参数。
获取Buckets
列出所有可用桶:
Use the get_buckets tool to show me all available buckets此工具返回所有存储桶的列表,包括它们的名称、ID、内存计数和创建日期。
创建Bucket
创建一个新的存储桶来组织回忆:
Use the create_bucket tool to create a bucket named "Project Ideas"参数:
bucket_name(必填):要创建的bucket的名称
删除Bucket
删除现有存储桶:
Use the delete_bucket tool to delete the bucket named "Old Notes"参数:
bucket_name(必填):要删除的bucket的名称force(可选):即使bucket包含内存,也强制删除(默认值:false)
更新存储器
更新现有内存的内容、存储桶或元数据:
Use the update_memory tool to update memory ID 123 with new text: "Updated information about vector databases"参数:
memory_id(必填):要更新的内存的IDtext(可选):内存中的新文本内容bucket_id(可选):内存的新存储桶reference_data(可选):更新的参考数据,包括关系
删除内存
删除特定内存:
Use the delete_memory tool to delete memory ID 123参数:
memory_id(必填):要删除的内存的ID
定制
系统提示定制
Memory Box MCP服务器使用系统提示根据特定指南格式化内存。您可以自定义此提示以更改内存的格式。
默认系统提示
默认系统提示包括不同类型内存的格式化指南:
You are a helpful AI assistant. When storing memories with Memory Box, follow these enhanced formatting guidelines:
1. STRUCTURE: Format memories based on the type of information:
- TECHNICAL: "TECHNICAL - [Brief topic]: [Concise explanation with specific details]"
- DECISION: "DECISION - [Brief topic]: [Decision made] because [rationale]. Alternatives considered: [options]."
- SOLUTION: "SOLUTION - [Problem summary]: [Implementation details that solved the issue]"
- CONCEPT: "CONCEPT - [Topic]: [Clear explanation of the concept with examples]"
- REFERENCE: "REFERENCE - [Topic]: [URL, tool name, or resource] for [specific purpose]"
- APPLICATION: "APPLICATION - [App name]: [User-friendly description] followed by [technical implementation details]"
2. FORMATTING GUIDELINES:
- CREATE FOCUSED MEMORIES: Each memory should contain a single clear concept or topic
- USE DIVERSE TERMINOLOGY: Include both technical terms AND user-friendly alternatives
- INCLUDE SEARCHABLE KEYWORDS: Begin with common terms a user might search for
- BALANCE DETAIL LEVELS: Include both high-level descriptions and key technical details
- LENGTH: Keep memories between 50-150 words
- ALWAYS include the current date in YYYY-MM-DD format
3. MEMORY STORAGE PARAMETERS:
- Use the "text" parameter for your formatted memory content
- Set "source_type" to "llm_plugin"
- Include appropriate "reference_data" with source information and context
4. REFERENCE DATA STRUCTURE:
- source.platform: Identify your platform (e.g., "claude_desktop", "cline")
- source.type: Always set to "llm_plugin"
- source.version: Optional version information
- context.conversation_id: Include when available to link related conversation memories
- context.message_id: Optional identifier for the specific message
5. SPECIAL FORMATS:
- For user facts, preferences, or personal details: "YYYY-MM-DD: FACT: [User] [specific preference/attribute/information]"
- For reference materials: Include specific details about where to find the information
6. RELATED MEMORIES: After finding memories with search, check if there are related memories using the get_related_memories tool with the memory_id from search results. Present these additional memories to provide the user with more context.
7. RETRIEVAL CONSIDERATION: Before storing an important memory, consider: "What search terms might someone use to find this information later?" and ensure those terms are included.如何自定义系统提示
要自定义系统提示,请执行以下操作:
- 在以下位置编辑Cline MCP设置文件:
~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json- 将自定义系统提示添加到
SYSTEM_PROMPT环境变量:
"memory-box-mcp": {
"command": "node",
"args": [
"
/build/index.js"
],
"env": {
"MEMORY_BOX_API_URL": "https://your-memory-box-instance",
"MEMORY_BOX_TOKEN": "your-token-here",
"DEFAULT_BUCKET": "General",
"SYSTEM_PROMPT": "Your custom system prompt here..."
},
"disabled": false,
"autoApprove": []
}模板文件提供于 /system-prompt-template.txt 您可以复制和修改。
- 重新启动Cline以应用更改
系统提示助手
Memory Box MCP服务器包括一个用于管理系统提示的辅助脚本:
# View the current system prompt
cd
npm run prompt-helper -- view
# Reset to the default system prompt
cd
npm run prompt-helper -- reset
# Validate a custom system prompt
cd
npm run prompt-helper -- validate其他配置选项
您还可以自定义这些环境变量:
MEMORY_BOX_API_URL:内存盒实例的URLMEMORY_BOX_TOKEN:您的Memory Box身份验证令牌DEFAULT_BUCKET:保存内存时使用的默认存储桶
故障排除
如果您遇到问题:
- 检查您的内存盒令牌是否配置正确
- 验证您的内存盒实例是否正在运行且可访问
- 检查Cline日志中是否有任何错误消息
发展
要更改服务器,请执行以下操作:
- 在中编辑源代码 `
/src/`
- 重建服务器:
cd
npm run build- 重新启动Cline以应用更改
构建桌面扩展
要构建桌面扩展包,请执行以下操作:
- 安装依赖项:
npm install- 构建扩展:
npm run build-extension- 已建成的扩建部分将于
dist/memory-box.mcpb
发布过程
- 更新版本
package.json - 更新
CHANGELOG.md随着新的变化 - 提交更改
- 创建新的GitHub版本
- 上传
memory-box.mcpb文件作为发布资产
