Skip to main content

Add your description here

Project description

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

  1. Clone this repository
  2. Initialize the uv environment:
uv venv
  1. Activate the virtual environment:
source .venv/bin/activate
  1. Install the dependencies using uv:
# Install in editable mode from pyproject.toml
uv pip install -e .
  1. Update .env file in the root directory with your mem0 API key:
MEM0_API_KEY=your_api_key_here

Usage

  1. Start the MCP server:
uv run main.py
  1. In Cursor, connect to the SSE endpoint, follow this doc for reference:
http://0.0.0.0:8080/sse
  1. 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:

  1. 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
  2. get_all_coding_preferences: Retrieve all stored coding preferences to analyze patterns, review implementations, and ensure no relevant information is missed.

  3. 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iflow_mcp_mem0_mcp-0.1.0.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iflow_mcp_mem0_mcp-0.1.0-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

Details for the file iflow_mcp_mem0_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: iflow_mcp_mem0_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.9

File hashes

Hashes for iflow_mcp_mem0_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5d2b46fe4bc3bb6482387018141486c5a4d2e174a56a1ff785760029163d4c24
MD5 04f7cbcd75cc78bb62b40d6f78816fa8
BLAKE2b-256 d079ed0f34fac43941f38b4145ca1ffaa9b06738ca9b5fc744e3c837dd97f77f

See more details on using hashes here.

File details

Details for the file iflow_mcp_mem0_mcp-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for iflow_mcp_mem0_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d9ab915567a7f0ab6fd427a52a6c73ef42457a3be8e6bfd1305769905f0638f8
MD5 468d29650009815a3f00963461106f20
BLAKE2b-256 60c9dc9b707d92085772eb0ee96a0481afba6860345c3e14115f73bf1cb4f783

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page