Skip to main content
Glama

mem0 MCP 服务器

用于 mem0 的模型上下文协议 (MCP) 服务器的 TypeScript 实现,通过 Mem0 集成提供内存流功能。

特征

  • 使用 Mem0 集成创建内存流

  • 将内容附加到内存流

  • 使用 Mem0 的语义搜索来搜索记忆

  • 从内存流读取

  • 基于资源的内存流访问

  • 删除内存流

Related MCP server: MCP Framework

先决条件

  1. Node.js 和 npm 已安装

  2. Mem0 API 密钥(从mem0.ai获取)

安装

npm install

配置

将您的 Mem0 API 密钥设置为环境变量:

export MEM0_API_KEY=your-api-key-here

建筑

npm run build

运行服务器

npm start

测试

运行测试客户端来验证服务器功能:

npm test

API

工具

  1. create-memory-stream

    • 参数:

      • name :字符串

      • initialContent :字符串(可选)

      • userId :字符串(可选)- Mem0 用户 ID

      • agentId :字符串(可选)- Mem0 代理 ID

    • 返回:流 ID 和元数据

  2. append-to-stream

    • 参数:

      • streamId :字符串

      • content :字符串

      • role :“用户”|“助理”(可选)

    • 返回:成功确认

  3. search-memories

    • 参数:

      • query :字符串

      • userId :字符串

      • agentId :字符串(可选)

      • threshold :数字(可选)

    • 返回:来自 Mem0 的搜索结果

  4. read-stream

    • 参数:

      • streamId :字符串

      • startIndex :数字(可选)

      • endIndex :数字(可选)

    • 返回:流内容

  5. delete-stream

    • 参数:

      • streamId :字符串

    • 返回:删除确认

资源

  • memory://{streamId} - 直接访问内存流内容

  • memory:// - 列出所有内存流

发展

该服务器使用 MCP TypeScript SDK 实现,并与 Mem0 集成,用于持久内存存储和语义搜索。扩展实现方式如下:

  1. 添加更多 Mem0 功能(例如,内存标记、元数据)

  2. 实施适当的错误处理

  3. 添加身份验证和授权

  4. 添加额外的内存操作

执照

麻省理工学院

-
security - not tested
F
license - not found
-
quality - not tested

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sadiuysal/mem0-mcp-server-ts'

If you have feedback or need assistance with the MCP directory API, please join our Discord server