Mem0 MCP Server

Official

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Manages environment variables to securely store API keys, including mem0 API key configuration.

  • Provides demo capabilities through GitHub assets, demonstrating the coding preferences functionality in action.

带有 Mem0 的 MCP 服务器用于管理编码偏好

这演示了一种使用带有mem0MCP服务器高效管理编码偏好的结构化方法。该服务器可与 Cursor 配合使用,并提供存储、检索和搜索编码偏好的基本工具。

安装

  1. 克隆此存储库
  2. 初始化uv环境:
uv venv
  1. 激活虚拟环境:
source .venv/bin/activate
  1. 使用uv安装依赖项:
# Install in editable mode from pyproject.toml uv pip install -e .
  1. 使用您的 mem0 API 密钥更新根目录中的.env文件:
MEM0_API_KEY=your_api_key_here

用法

  1. 启动 MCP 服务器:
uv run main.py
  1. 在 Cursor 中,连接到 SSE 端点,请按照此文档进行参考:
http://0.0.0.0:8080/sse
  1. 在 Cursor 中打开 Composer 并切换到Agent模式。

带光标的演示

https://github.com/user-attachments/assets/56670550-fb11-4850-9905-692d3496231c

特征

服务器提供了三种主要工具来管理代码偏好设置:

  1. add_coding_preference :存储代码片段、实现细节和编码模式以及全面的上下文,包括:
    • 包含依赖项的完整代码
    • 语言/框架版本
    • 设置说明
    • 文档和评论
    • 示例用法
    • 最佳实践
  2. get_all_coding_preferences :检索所有存储的编码偏好以分析模式、审查实施情况并确保不会遗漏任何相关信息。
  3. search_coding_preferences :通过存储的编码偏好进行语义搜索以找到相关的:
    • 代码实现
    • 编程解决方案
    • 最佳实践
    • 设置指南
    • 技术文档

为什么?

此实现允许通过 MCP 访问持久化编码偏好设置系统。基于 SSE 的服务器可以作为进程运行,代理可以根据需要随时连接、使用和断开连接。此模式非常适合“云原生”用例,其中服务器和客户端可以作为不同节点上的解耦进程。

服务器

默认情况下,服务器在 0.0.0.0:8080 上运行,但可以使用命令行参数进行配置,例如:

uv run main.py --host <your host> --port <your port>

服务器在/sse处公开一个 SSE 端点,MCP 客户端可以连接到该端点以访问编码首选项管理工具。

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

与 mem0.ai 集成的 MCP 服务器可帮助用户存储、检索和搜索编码偏好,以实现更一致的编程实践。

  1. Installation
    1. Usage
      1. Demo with Cursor
        1. Features
          1. Why?
            1. Server
          ID: 15jw4c18y6