Integrations
Provides the runtime environment for the MCP server implementation.
Used for package management and running scripts for the MCP server.
Implements the Model Context Protocol server using TypeScript for type safety and modern JavaScript features.
mem0 MCP 服务器
用于 mem0 的模型上下文协议 (MCP) 服务器的 TypeScript 实现,通过 Mem0 集成提供内存流功能。
特征
- 使用 Mem0 集成创建内存流
- 将内容附加到内存流
- 使用 Mem0 的语义搜索来搜索记忆
- 从内存流读取
- 基于资源的内存流访问
- 删除内存流
先决条件
- Node.js 和 npm 已安装
- Mem0 API 密钥(从mem0.ai获取)
安装
Copy
配置
将您的 Mem0 API 密钥设置为环境变量:
Copy
建筑
Copy
运行服务器
Copy
测试
运行测试客户端来验证服务器功能:
Copy
API
工具
create-memory-stream
- 参数:
name
:字符串initialContent
:字符串(可选)userId
:字符串(可选)- Mem0 用户 IDagentId
:字符串(可选)- Mem0 代理 ID
- 返回:流 ID 和元数据
- 参数:
append-to-stream
- 参数:
streamId
:字符串content
:字符串role
:“用户”|“助理”(可选)
- 返回:成功确认
- 参数:
search-memories
- 参数:
query
:字符串userId
:字符串agentId
:字符串(可选)threshold
:数字(可选)
- 返回:来自 Mem0 的搜索结果
- 参数:
read-stream
- 参数:
streamId
:字符串startIndex
:数字(可选)endIndex
:数字(可选)
- 返回:流内容
- 参数:
delete-stream
- 参数:
streamId
:字符串
- 返回:删除确认
- 参数:
资源
memory://{streamId}
- 直接访问内存流内容memory://
- 列出所有内存流
发展
该服务器使用 MCP TypeScript SDK 实现,并与 Mem0 集成,用于持久内存存储和语义搜索。扩展实现方式如下:
- 添加更多 Mem0 功能(例如,内存标记、元数据)
- 实施适当的错误处理
- 添加身份验证和授权
- 添加额外的内存操作
执照
麻省理工学院
This server cannot be installed
模型上下文协议服务器的 TypeScript 实现,可通过 Mem0 集成实现内存流的创建、管理和语义搜索。