带有 Mem0 的 MCP 服务器用于管理编码偏好
这演示了一种使用带有mem0的MCP服务器高效管理编码偏好的结构化方法。该服务器可与 Cursor 配合使用,并提供存储、检索和搜索编码偏好的基本工具。
安装
- 克隆此存储库
- 初始化
uv
环境:
- 激活虚拟环境:
- 使用
uv
安装依赖项:
- 使用您的 mem0 API 密钥更新根目录中的
.env
文件:
用法
- 启动 MCP 服务器:
- 在 Cursor 中,连接到 SSE 端点,请按照此文档进行参考:
- 在 Cursor 中打开 Composer 并切换到
Agent
模式。
带光标的演示
https://github.com/user-attachments/assets/56670550-fb11-4850-9905-692d3496231c
特征
服务器提供了三种主要工具来管理代码偏好设置:
add_coding_preference
:存储代码片段、实现细节和编码模式以及全面的上下文,包括:- 包含依赖项的完整代码
- 语言/框架版本
- 设置说明
- 文档和评论
- 示例用法
- 最佳实践
get_all_coding_preferences
:检索所有存储的编码偏好以分析模式、审查实施情况并确保不会遗漏任何相关信息。search_coding_preferences
:通过存储的编码偏好进行语义搜索以找到相关的:- 代码实现
- 编程解决方案
- 最佳实践
- 设置指南
- 技术文档
为什么?
此实现允许通过 MCP 访问持久化编码偏好设置系统。基于 SSE 的服务器可以作为进程运行,代理可以根据需要随时连接、使用和断开连接。此模式非常适合“云原生”用例,其中服务器和客户端可以作为不同节点上的解耦进程。
服务器
默认情况下,服务器在 0.0.0.0:8080 上运行,但可以使用命令行参数进行配置,例如:
服务器在/sse
处公开一个 SSE 端点,MCP 客户端可以连接到该端点以访问编码首选项管理工具。
This server cannot be installed
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.
与 mem0.ai 集成的 MCP 服务器可帮助用户存储、检索和搜索编码偏好,以实现更一致的编程实践。
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityA MCP server for managing and storing code snippets in various programming languages, allowing users to create, list, and delete snippets via a standardized interface.Last updated -34JavaScriptMIT License
- -securityAlicense-qualityAn MCP server that implements Claude Code-like functionality, allowing the AI to analyze codebases, modify files, execute commands, and manage projects through direct file system interactions.Last updated -179PythonMIT License
- -securityAlicense-qualityAn MCP server that analyzes codebases and generates contextual prompts, making it easier for AI assistants to understand and work with code repositories.Last updated -10PythonMIT License
- -securityFlicense-qualityA MCP server that allows AI assistants to interact with the browser, including getting page content as markdown, modifying page styles, and searching browser history.Last updated -5TypeScript