myAI Memory MCP server

Synchronizes personal memory templates across Claude interfaces, enabling consistent user preferences and response styles without manual copying.
Back to servers
Setup instructions
Provider
James King
Release date
Mar 19, 2025
Language
TypeScript
Stats
8 stars

myAI Memory Sync is a powerful MCP (Model Context Protocol) tool that seamlessly synchronizes your preferences, personal details, and code standards across all Claude interfaces. By updating information once, your changes instantly appear everywhere - from Claude Desktop to Claude Code, Windsurf, and Claude.ai web. The built-in caching system dramatically improves memory-related query performance.

Installation Options

Option 1: Direct Install (Recommended)

Install from npm:

npm install -g myai-memory-sync

Start the server:

# Start with stdio transport (default)
myai

# Start with HTTP transport
myai server --transport http

# Process memory commands
myai remember "I prefer dark mode"

# Sync across platforms
myai sync

Option 2: Run from Source

Clone and build from source:

git clone https://github.com/Jktfe/myaimemory-mcp.git
cd myaimemory-mcp
npm install
npm run build
npm start  # Start with stdio transport
# or
npm run start:http  # Start with HTTP transport

Option 3: Docker

Build and run with Docker:

docker build -t myai-memory-sync .
docker run -v myai-memory:/app/data -p 3000:3000 myai-memory-sync

Server Options

The unified server script supports multiple options:

# Start with stdio transport (default)
./start-server.sh

# Start with HTTP transport
./start-server.sh --http

# Start with HTTP transport on custom port
./start-server.sh --http --port=8080

# Start with direct implementation (no SDK)
./start-server.sh --direct

# Start with direct implementation and HTTP transport
./start-server.sh --direct --http

# Enable debug mode
./start-server.sh --debug

Direct Sync Method (Simple Alternative)

For a simpler approach that doesn't require running an MCP server:

# One-time sync of all memory files
npm run sync

# Or for emergency sync (fixes permissions)
npm run sync:emergency

MCP Configuration

Claude Desktop Configuration

Add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "myai-memory-sync": {
      "command": "npx",
      "args": [
        "-y",
        "myai"
      ],
      "env": {
        "TEMPLATE_PATH": "/path/to/custom/template.md",
        "ENABLE_ANTHROPIC": "true",
        "ANTHROPIC_API_KEY": "your-api-key-here"
      }
    }
  }
}

Claude.ai with Smithery

  1. Visit Smithery.ai
  2. Add the myAI Memory Sync MCP:
    @Jktfe/myaimemory-mcp
    
  3. Configure with your API key in the Smithery settings

Windsurf Integration

In Windsurf, add to your .codeium/config.json:

{
  "mcp": {
    "servers": {
      "myai-memory-sync": {
        "command": "npx",
        "args": [
          "-y",
          "myai"
        ]
      }
    }
  }
}

HTTP Server Mode

For HTTP transport instead of stdio:

# Using npm scripts:
npm run start:http

# Using the unified CLI:
myai server --transport http

# Using the shell script with custom port:
./start-server.sh --http --port=8080

# Using environment variable:
PORT=8080 npm run start:http

Environment Variables

Create a .env file with the following options:

# Basic configuration
DEBUG=true                      # Enable debug logging
TEMPLATE_PATH=./data/template.md  # Custom template location
PORT=3000                       # Port for HTTP transport (default: 3000)
USE_DIRECT=true                 # Use direct implementation (no SDK)

# Platform-specific paths
WINDSURF_MEMORY_PATH=~/.codeium/windsurf/memories/global_rules.md
CLAUDE_PROJECTS_PATH=~/CascadeProjects

# Performance optimization
ENABLE_ANTHROPIC=true           # Enable Anthropic API integration
ANTHROPIC_API_KEY=your-api-key  # Your Anthropic API key
ENABLE_PROMPT_CACHE=true        # Enable prompt caching system
CACHE_TTL=300000                # Cache TTL in milliseconds (5 minutes)

# Claude web sync (optional)
CLAUDE_WEB_SYNC_ENABLED=false   # Enable Claude.ai web synchronization
[email protected]  # Your Claude.ai email
CLAUDE_WEB_HEADLESS=true        # Run browser in headless mode

System Prompt Integration

For best results, add this to your Claude system prompt:

Memory Integration Instructions:
When you receive a command that starts with "use myAI Memory to", you should:

1. Process the rest of the instruction as a memory management command
2. Try to determine the appropriate section to update based on the content
3. Use the myAI Memory Sync MCP to update your memory
4. Confirm the update with a brief acknowledgment

For example:
"use myAI Memory to remember I prefer dark mode" 
→ Update the preferences section with dark mode preference

When asked questions about preferences or personal information, first check your memory via the myAI Memory Sync MCP. Always reference information from memory rather than making assumptions.

Using Natural Language Commands

You can interact with myAI Memory using these natural language patterns:

Command Pattern Example Purpose
Use myAI Memory to remember [information] "Use myAI Memory to remember I prefer TypeScript over JavaScript" Adds information to the appropriate section based on content
Remember that [information] "Remember that I live in London" Shorter alternative to add information to memory
Add to my memory that [information] "Add to my memory that I have two cars" Another way to add information to memory
Use myAI Memory to add to [section] [information] "Use myAI Memory to add to Coding Preferences I prefer dark mode" Add information to a specific section
Update my [section] to include that [information] "Update my User Information to include that my birthday is March 29" Update a specific section with new information

Example usage:

You: Use myAI Memory to remember I prefer TypeScript over JavaScript
Claude: ✅ Added to your Coding Preferences! I'll remember you prefer TypeScript over JavaScript.

Memory Template Format

The system uses a structured markdown format to organize your preferences:

# myAI Memory

# User Information
## Use this information if you need to reference them directly
-~- Name: Your Name
-~- Location: Your Location
-~- Likes: Reading, Hiking, Technology

# General Response Style
## Use this in every response
-~- Style: Friendly and concise
-~- Use UK English Spellings: true
-~- Include emojis when appropriate: true

# Coding Preferences
## General Preference when responding to coding questions
-~- I prefer TypeScript over JavaScript
-~- Show step-by-step explanations

Advanced Usage

Memory Presets

Switch between different personas easily:

You: Use myAI Memory to list presets
Claude: Available presets: personal, work, developer

You: Use myAI Memory to load preset developer
Claude: ✅ Loaded developer preset!

Emergency Sync

When you need to fix synchronization issues across all platforms:

# Sync everything immediately
./emergency-sync.sh

Troubleshooting

Common Issues

  1. CLAUDE.md Not Updating

    • Check file permissions with ls -la CLAUDE.md
    • Try emergency sync with ./emergency-sync.sh
    • Verify platform paths in your .env file
  2. MCP Connection Failures

    • Ensure MCP server is running with ps aux | grep myai-memory
    • Check Claude Desktop logs for MCP errors
    • Verify your Claude Desktop configuration file
  3. Caching Issues

    • Clear cache with node dist/cli.js --clear-cache
    • Verify Anthropic API key is correctly set
    • Check memory file integrity with node dist/cli.js --validate
  4. Natural Language Commands Not Working

    • Make sure to use exactly one of the supported command patterns
    • If Claude doesn't recognize your command, try a different pattern
    • For syncing across all platforms, use the direct script: node sync-memory.js

Manual Syncing

If you're experiencing issues with natural language commands or the MCP server:

# Direct sync approach (most reliable)
cd /path/to/myAImemory
node sync-memory.js

# Alternative emergency sync (if permissions need fixing)
cd /path/to/myAImemory
./safe-memory.sh sync

Logs and Debugging

Enable debug mode to see detailed logs:

DEBUG=true npm run start

Log files are stored in:

  • Linux/macOS: ~/.local/share/myai-memory/logs/
  • Windows: %APPDATA%\myai-memory\logs\

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "myai-memory-sync" '{"command":"npx","args":["-y","myai"],"env":{"TEMPLATE_PATH":"/path/to/custom/template.md","ENABLE_ANTHROPIC":"true","ANTHROPIC_API_KEY":"your-api-key-here"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "myai-memory-sync": {
            "command": "npx",
            "args": [
                "-y",
                "myai"
            ],
            "env": {
                "TEMPLATE_PATH": "/path/to/custom/template.md",
                "ENABLE_ANTHROPIC": "true",
                "ANTHROPIC_API_KEY": "your-api-key-here"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "myai-memory-sync": {
            "command": "npx",
            "args": [
                "-y",
                "myai"
            ],
            "env": {
                "TEMPLATE_PATH": "/path/to/custom/template.md",
                "ENABLE_ANTHROPIC": "true",
                "ANTHROPIC_API_KEY": "your-api-key-here"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later