# 记忆盒子-MCP
## 基本信息
- Slug: `amotivv-memory-box-mcp`
- Source: modelscope
- Publisher: @amotivv/memory-box-mcp
- Categories: knowledge-and-memory / search / databases
- Hosted: No
- License: MIT License
- Source URL: https://www.modelscope.cn/mcp/servers/@amotivv/memory-box-mcp
## 简介
克萊因MCP集成，允許用戶保存、搜索和格式化具有語義理解的記憶，提供使用向量嵌入存儲和檢索信息的工具，以進行基於意義的搜索。
## 安装提示

```bash
npx -y @smithery/cli install @amotivv/memory-box-mcp --client claude
```

## MCP Server 详情

<p align="center">
  <img src="https://storage.googleapis.com/amotivv-public/memory-box-logo.png" alt="Memory Box Logo" width="200"/>
</p>

<h1 align="center">Memory Box MCP 服务器</h1>

<p align="center">
  为 Memory Box 提供 Cline 和 Claude 桌面版的 MCP 集成 - 使用语义理解保存、搜索和格式化记忆
</p>

<p align="center">
  <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="许可证: MIT"></a>
</p>
<p align="center">
  <a href="https://glama.ai/mcp/servers/wtbejx9zwc">
    <img width="380" height="200" src="https://glama.ai/mcp/servers/wtbejx9zwc/badge" />
  </a>
</p>

此 MCP 服务器提供了与 Memory Box 实例交互的工具，允许您直接从 Cline 和 Claude 桌面版使用语义搜索来保存和搜索记忆。

## 相关项目

此 MCP 服务器设计用于与 [Memory Box](https://memorybox.dev) 一起工作，这是一个由向量嵌入驱动的语义记忆存储和检索系统。

Memory Box 提供了此 MCP 服务器与其通信的后端 API，使您可以：
- 存储带有向量嵌入的记忆以便进行语义搜索
- 将记忆组织到可自定义的桶中
- 基于意义而非仅关键词搜索记忆
- 获取带有详细上下文的记忆
- 找到语义相关的记忆
- 跟踪记忆处理状态

有关 Memory Box 的更多信息，包括如何设置自己的实例，请访问 [Memory Box 网站](https://memorybox.dev)。

## 功能

- **保存记忆**：将格式化的记忆保存到您的 Memory Box 中，并附带来源信息和元数据
- **搜索记忆**：使用语义搜索您的记忆
- **检索记忆**：获取所有记忆或特定桶中的记忆
- **查找相关记忆**：发现语义相似的记忆
- **检查记忆状态**：监控记忆处理状态
- **格式化记忆**：根据结构化的系统提示格式化记忆
- **使用统计**：查看当前计划、使用指标和资源限制

## 安装

该服务器已安装并配置好，可以与 Cline 一起使用。请注意，您需要一个正在运行的 Memory Box 实例（无论是自托管还是使用 memorybox.amotivv.ai 上的托管版本）才能使用此 MCP 服务器。

### 通过 Smithery 安装

要通过 [Smithery](https://smithery.ai/server/@amotivv/memory-box-mcp) 自动为 Claude 桌面版安装 Memory Box MCP 服务器：

```bash
npx -y @smithery/cli install @amotivv/memory-box-mcp --client claude
```


完成设置：

1. 编辑 Cline MCP 设置文件：
   ```
   ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
   ```

2. 将您的 Memory Box 令牌添加到 `MEMORY_BOX_TOKEN` 环境变量中：
   ```json
   "memory-box-mcp": {
     "command": "node",
     "args": [
       "<path-to-repository>/build/index.js"
     ],
     "env": {
       "MEMORY_BOX_API_URL": "https://memorybox.amotivv.ai",
       "MEMORY_BOX_TOKEN": "your-token-here",
       "DEFAULT_BUCKET": "General"
     },
     "disabled": false,
     "autoApprove": []
   }
   ```

3. 可选地，您可以通过更改 `DEFAULT_BUCKET` 的值来自定义默认存储桶。

## 使用

配置完成后，您可以在 Cline 中使用以下工具：

### 保存记忆

以正确的格式将记忆保存到 Memory Box：

```
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`（可选）：保存记忆的存储桶（默认："General"）
- `format`（可选）：是否根据系统提示格式化记忆（默认：true）
- `type`（可选）：记忆类型（TECHNICAL, DECISION, SOLUTION, CONCEPT, REFERENCE, APPLICATION, FACT），用于格式化（默认："TECHNICAL"）
- `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
```


### 获取存储桶中的记忆

从特定存储桶中获取记忆：

```
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`（可选）：记忆类型（TECHNICAL, DECISION, SOLUTION, CONCEPT, REFERENCE, APPLICATION, FACT）（默认："TECHNICAL"）

### 获取相关记忆

找到与特定记忆语义相似的记忆：

```
Use the get_related_memories tool with memory ID 123
```


参数：
- `memory_id`（必需）：要为其查找相关记忆的记忆 ID
- `min_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 调用）
- 带有人类可读格式的数据处理量
- 基于您的计划的资源限制（如果适用）
- 按类型的操作细分

此操作不需要任何参数。

## 自定义

### 系统提示自定义

Memory Box MCP 服务器使用系统提示来根据特定指南格式化记忆。您可以自定义此提示以更改记忆的格式。

#### 默认系统提示

默认系统提示包括不同类型的记忆格式化指南：

```
You are a helpful AI assistant. When storing memories with memory_plugin, follow these enhanced formatting guidelines:

1. STRUCTURE: Format memories based on the type of information:
   - TECHNICAL: "YYYY-MM-DD: TECHNICAL - [Brief topic]: [Concise explanation with specific details]"
   - DECISION: "YYYY-MM-DD: DECISION - [Brief topic]: [Decision made] because [rationale]. Alternatives considered: [options]."
   - SOLUTION: "YYYY-MM-DD: SOLUTION - [Problem summary]: [Implementation details that solved the issue]"
   - CONCEPT: "YYYY-MM-DD: CONCEPT - [Topic]: [Clear explanation of the concept with examples]"
   - REFERENCE: "YYYY-MM-DD: REFERENCE - [Topic]: [URL, tool name, or resource] for [specific purpose]"
   - APPLICATION: "YYYY-MM-DD: 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:
   -…

