mem0-mcp
by Dev-Khant
What is mem0-mcp
MCP Server with Mem0 for Managing Coding Preferences
This demonstrates a structured approach for using an MCP server with mem0 to manage coding preferences efficiently. The server can be used with Cursor and provides essential tools for storing, retrieving, and searching coding preferences.
Installation
- Clone this repository
- Initialize the
uv
environment:
uv venv
- Activate the virtual environment:
source .venv/bin/activate
- Install the dependencies using
uv
:
# Install in editable mode from pyproject.toml
uv pip install -e .
- Update
.env
file in the root directory with your mem0 API key:
MEM0_API_KEY=your_api_key_here
Usage
- Start the MCP server:
uv run main.py
- In Cursor, connect to the SSE endpoint, follow this doc for reference:
http://0.0.0.0:8080/sse
- Open the Composer in Cursor and switch to
Agent
mode.
Demo with Cursor
https://github.com/user-attachments/assets/56670550-fb11-4850-9905-692d3496231c
Features
The server provides three main tools for managing code preferences:
-
add_coding_preference
: Store code snippets, implementation details, and coding patterns with comprehensive context including:- Complete code with dependencies
- Language/framework versions
- Setup instructions
- Documentation and comments
- Example usage
- Best practices
-
get_all_coding_preferences
: Retrieve all stored coding preferences to analyze patterns, review implementations, and ensure no relevant information is missed. -
search_coding_preferences
: Semantically search through stored coding preferences to find relevant:- Code implementations
- Programming solutions
- Best practices
- Setup guides
- Technical documentation
Why?
This implementation allows for a persistent coding preferences system that can be accessed via MCP. The SSE-based server can run as a process that agents connect to, use, and disconnect from whenever needed. This pattern fits well with "cloud-native" use cases where the server and clients can be decoupled processes on different nodes.
Server
By default, the server runs on 0.0.0.0:8080 but is configurable with command line arguments like:
uv run main.py --host <your host> --port <your port>
The server exposes an SSE endpoint at /sse
that MCP clients can connect to for accessing the coding preferences management tools.
Leave a Comment
Comments section will be available soon. Stay tuned!
Frequently Asked Questions
What is MCP?
MCP (Model Context Protocol) is an open protocol that standardizes how applications provide context to LLMs. Think of MCP like a USB-C port for AI applications, providing a standardized way to connect AI models to different data sources and tools.
What are MCP Servers?
MCP Servers are lightweight programs that expose specific capabilities through the standardized Model Context Protocol. They act as bridges between LLMs like Claude and various data sources or services, allowing secure access to files, databases, APIs, and other resources.
How do MCP Servers work?
MCP Servers follow a client-server architecture where a host application (like Claude Desktop) connects to multiple servers. Each server provides specific functionality through standardized endpoints and protocols, enabling Claude to access data and perform actions through the standardized protocol.
Are MCP Servers secure?
Yes, MCP Servers are designed with security in mind. They run locally with explicit configuration and permissions, require user approval for actions, and include built-in security features to prevent unauthorized access and ensure data privacy.
Related MCP Servers
Ableton Live MCP Server
MCP Server implementation for Ableton Live OSC control
Airbnb MCP Server
AI Agent Marketplace Index Search MCP Server
MCP Server for AI Agent Marketplace Index from DeepNLP
Algorand MCP Implementation
Algorand Model Context Protocol (Server & Client)
mcp-server-apache-airflow
pypi.org/project/mcp-server-apache-airflow/
airtable-mcp-server
๐๏ธ๐ค Airtable Model Context Protocol Server, for allowing AI systems to interact with your Airtable bases
Airtable MCP Server
Search, create and update Airtable bases, tables, fields, and records using Claude Desktop and MCP (Model Context Protocol) clients
Alphavantage MCP Server
A MCP server for the stock market data API, Alphavantage API.
Amadeus MCP Server
Amadeus MCP(Model Context Protocol) Server
Anki MCP Server
An MCP server for Anki
Submit Your MCP Server
Share your MCP server with the community
Submit Now