Python MCP Integration
YoMemo provides an out-of-the-box MCP server that enables AI assistants to save and retrieve encrypted memories. This is the easiest way to get started with YoMemo, especially if you’re using Claude Desktop, Cursor, or other MCP-compatible tools.
Video walkthrough (~50 seconds)
Section titled “Video walkthrough (~50 seconds)”Watch the full flow: sign in at yomemo.ai, configure MCP in Cursor, add the system prompt, and test save_memory.
Steps in the video:
- Sign in and get an API key — Open yomemo.ai, sign in with GitHub, email, or Google. Go to Settings in the left menu, then API Key. New users click Rotate Key to generate a new key.
- Configure MCP in Cursor — In Cursor, add the YoMemo MCP server using your API key and the path to your private PEM file from the previous step, then enable it.
- Copy the system prompt — Open github.com/yomemoai/yomemo-prompts and copy the system prompt (e.g. from
system-v0.0.0.txt). - Add the prompt as a Cursor rule — Paste that system prompt into Cursor as a system rule so the AI can automatically call
save_memoryat the right moments. - Test save — In a Cursor chat, trigger a save (e.g. ask the AI to remember something), then open a new chat and use
load_memoriesto confirm it worked.
Prerequisites
Section titled “Prerequisites”Before you begin, you need:
- Python 3.12 or higher
uvpackage manager (recommended) orpip- A YoMemoAI API key
- An RSA private key (PEM format)
Quick Start
Section titled “Quick Start”Install the MCP Server
The easiest way is to useuvxto run it directly without installation:Terminal window uvx yomemoai-mcp --helpOr install via
pip:Terminal window pip install yomemoai-mcpGet Your RSA Key Pair and Register Your Public Key
You need an RSA private key (PEM) for the MCP server, and the server must have your public key. We recommend creating the key pair locally (zero-trust); you can also generate it in the dashboard for a quick try.Follow the dedicated guide: Key Pairs (Public & Private) — it covers online vs. local generation, how to upload your public key if you generate locally, and security notes. Once you have
private.pemand the public key is registered, continue below.Configure Your MCP Client
Add the MCP server configuration to your client. The configuration location depends on your tool:For Cursor
Edit~/.cursor/mcp.json(Windows:%APPDATA%\Cursor\User\mcp.json):{"mcpServers": {"yomemoai": {"command": "uvx","args": ["yomemoai-mcp"],"env": {"MEMO_API_KEY": "your_api_key_here","MEMO_PRIVATE_KEY_PATH": "/path/to/private.pem","MEMO_BASE_URL": "https://api.yomemo.ai"}}}}For Claude Desktop
Edit~/Library/Application Support/Claude/claude_desktop_config.json(macOS) or%APPDATA%\Claude\claude_desktop_config.json(Windows):{"mcpServers": {"yomemoai": {"command": "uvx","args": ["yomemoai-mcp"],"env": {"MEMO_API_KEY": "your_api_key_here","MEMO_PRIVATE_KEY_PATH": "/path/to/private.pem","MEMO_BASE_URL": "https://api.yomemo.ai"}}}}Restart Your MCP Client
After saving the configuration, restart Cursor or Claude Desktop for the changes to take effect.Start Using YoMemo
Once configured, you can use YoMemo in your AI assistant conversations:- Save memories: Ask your AI assistant to remember important information
- Retrieve memories: Ask your AI assistant to recall previously saved information
- Organize with handles: Use categories like “work”, “personal”, “project-x” to organize memories
Available MCP Tools
Section titled “Available MCP Tools”save_memory
Section titled “save_memory”Store important information, user preferences, or conversation context as a permanent encrypted memory. When you use the same idempotent_key with the same handle, the existing memory is updated (upsert) instead of creating a duplicate.
Parameters:
content(required): The actual text/information to be rememberedhandle(optional): A category or tag (e.g., ‘work’, ‘personal’, ‘project-x’). Defaults to ‘general’description(optional): A brief summary of what this memory is aboutidempotent_key(optional): A stable key for upsert. If a memory with the same (handle, idempotent_key) already exists, it is updated; otherwise a new one is created. Use for project progress, habit tracking, or avoiding duplicate memories.
Example usage in Claude/Cursor:
"Please remember that my coffee machine password is 8888, with handle 'passwords'"load_memories
Section titled “load_memories”Retrieve previously stored memories or context.
Parameters:
handle(optional): Filter memories by category. If not specified, returns all memories
Example usage in Claude/Cursor:
"Can you recall my passwords?"Configuration Options
Section titled “Configuration Options”Environment Variables
Section titled “Environment Variables”You can configure the MCP server using environment variables:
MEMO_API_KEY(required): Your YoMemoAI API key for authenticationMEMO_PRIVATE_KEY_PATH(required): Absolute path to your RSA private key PEM fileMEMO_BASE_URL(optional): Base URL of the YoMemoAI API. Defaults tohttps://api.yomemo.ai
Using .env File (Local Development)
Section titled “Using .env File (Local Development)”For local development, you can also use a .env file in your project directory:
MEMO_API_KEY=your_api_key_hereMEMO_PRIVATE_KEY_PATH=./private.pemMEMO_BASE_URL=https://api.yomemo.aiThen run:
uv run memo-mcpHow It Works
Section titled “How It Works”The MCP integration works as a bridge between your AI assistant and the YoMemo backend:
-
On Write: When you ask your AI to save a memory:
- The MCP server encrypts the content using your local private key (AES-GCM + RSA-OAEP)
- Signs the encrypted data for integrity verification
- Sends the encrypted data to the YoMemo API
- The server only stores encrypted ciphertext and cannot see your plaintext
-
On Read: When you ask your AI to recall a memory:
- The MCP server fetches encrypted data from YoMemo API
- Decrypts it locally using your private key
- Returns the plaintext to your AI assistant
Throughout the entire process, the YoMemo server only handles encrypted ciphertext and public keys, ensuring your data remains private.
Troubleshooting
Section titled “Troubleshooting”MCP Server Not Starting
Section titled “MCP Server Not Starting”If the MCP server fails to start:
-
Check API Key: Verify your
MEMO_API_KEYis correct -
Check Private Key Path: Ensure the path is absolute and the file exists
-
Check Permissions: Make sure the private key file is readable (permissions
600recommended) -
Test Locally: Run the server directly to see error messages:
Terminal window MEMO_API_KEY="your_api_key" \MEMO_PRIVATE_KEY_PATH="/path/to/private.pem" \uvx yomemoai-mcp
Connection Issues
Section titled “Connection Issues”If you can’t connect to the YoMemo API:
- Verify
MEMO_BASE_URLis correct (default:https://api.yomemo.ai) - Check your internet connection
- Ensure your API key is valid and not expired
Decryption Errors
Section titled “Decryption Errors”If you see decryption errors:
- Verify you’re using the correct private key (the one that matches the public key stored on the server)
- Check that the private key file is not corrupted
- Ensure the private key format is correct (PEM format)
Next Steps
Section titled “Next Steps”- Learn about Go SDK integration for programmatic access
- Explore How It Works to understand the encryption architecture
- Check out the API reference for direct API access