memory-api-mcp-server
TypeScript icon, indicating that this package has built-in type declarations

1.1.5 • Public • Published

Memory API MCP Server

npm version

🧠 Intelligent Memory Management for Cursor - Automatically save and retrieve code contexts, patterns, and solutions using the Model Context Protocol (MCP).

⚠️ Important Note: This project is not Open Source. All data is encrypted and embedded in a way that only AI can read and interpret the content.

✨ Features

  • 🤖 Automatic Context Saving: Cursor intelligently decides when to save interesting code
  • 🔍 Semantic Search: Find code patterns and solutions using natural language
  • 🏷️ Smart Tagging: Automatic categorization by language, complexity, and reusability
  • 📊 Structured Metadata: Rich context with file paths, complexity levels, and more
  • 🚀 Zero Configuration: Works out of the box with any Memory API instance
  • 🔄 Real-time Sync: Instant saving and retrieval of memories

🚀 Quick Start

Installation

npm install -g memory-api-mcp-server

Setup with Cursor

  1. Install the package globally:

    npm install -g memory-api-mcp-server
  2. Configure Cursor MCP: Add to your ~/.cursor/mcp.json:

    {
      "mcpServers": {
        "memory-api": {
          "command": "memory-api-mcp-server"
        }
      }
    }
  3. Restart Cursor and start coding!

Auto-Configuration Script

For easier setup, use our configuration script:

npx memory-api-mcp-server configure

🛠️ Available Tools

Core Memory Operations

  • create_memory - Create new memories manually
  • search_memories - Search existing memories by content
  • list_memories - List all memories with pagination
  • get_memory - Retrieve specific memory by ID
  • delete_memory - Remove memories

Intelligent Auto-Save

  • smart_auto_save - Automatically save interesting code contexts
    • Detects complex solutions
    • Identifies reusable patterns
    • Captures bug fixes and optimizations
    • Saves configurations and utilities

🧠 Intelligent Auto-Save

The server includes smart auto-save functionality that automatically captures:

  • Complex Solutions - Code that took significant effort to implement
  • Reusable Patterns - Functions and classes with high reuse potential
  • Bug Fixes - Interesting problem resolutions
  • Optimizations - Performance improvements
  • Configurations - Useful setup and config code
  • Utilities - Helper functions and tools

Example Auto-Save

When you write something like this:

const optimizeQuery = (sql) => {
  // Complex optimization logic
  return optimizedSql;
};

Cursor automatically saves it with structured metadata:

{
  "content": "CONTEXTO: optimization\nARQUIVO: utils/db.js\n\nconst optimizeQuery = (sql) => {\n  // Complex optimization logic\n  return optimizedSql;\n};",
  "containerTags": ["optimization", "javascript", "medium_complexity", "high_reusability"]
}

📝 Usage Examples

Manual Memory Creation

// In Cursor chat
"Create a memory about this regex pattern for email validation"

Searching Memories

// In Cursor chat
"Search for memories about database optimization"
"Find all JavaScript utility functions"
"Show me high reusability patterns"

Auto-Save Configuration

Add a .cursorrules file to your project:

# Auto-Memory Rules
Use `smart_auto_save` automatically when detecting:
- Complex algorithms
- Reusable utilities
- Bug fixes
- Performance optimizations
- Configuration patterns

🔧 Configuration

Environment Variables

Memory API Compatibility

This server is compatible with any Memory API that implements the Supermemory AI specification:

  • POST /v3/memories - Create memories
  • POST /v3/search - Search memories
  • GET /v3/memories - List memories
  • GET /v3/memories/{id} - Get specific memory
  • DELETE /v3/memories/{id} - Delete memory

🏗️ Architecture

Cursor ←→ MCP Server ←→ Memory API ←→ PostgreSQL + Vector DB
  • Cursor: Provides the AI interface and code context
  • MCP Server: Handles protocol translation and intelligent decisions
  • Memory API: Manages storage and semantic search
  • Database: Stores memories with vector embeddings for similarity search

🔗 Links

📧 Contact


Made with 🧠 by Italo Coimbra

Package Sidebar

Install

npm i memory-api-mcp-server

Weekly Downloads

9

Version

1.1.5

License

MIT

Unpacked Size

33.7 kB

Total Files

5

Last publish

Collaborators

  • efipee