Simple Memory Extension MCP server

Persistent key-value memory store with semantic search using SQLite and E5 embeddings, enabling contextual information retrieval and long-term memory extension for complex multi-step tasks.
Back to servers
Setup instructions
Provider
George Macev
Release date
Mar 08, 2025
Language
TypeScript
Stats
9 stars

This MCP server extends context window and memory for agents, allowing them to store and recall important information during coding sessions. It's particularly useful when working on large features or during extended coding sessions where maintaining context is crucial.

Installation and Setup

Prerequisites

  • Node.js and npm installed on your system

Installing and Starting the Server

Install dependencies and start the server with:

npm install
npm start

Configuration Options

You can configure the server through environment variables in a .env file:

# Path to SQLite database file
DB_PATH=./data/context.db

PORT=3000

# Use HTTP SSE or Stdio
USE_HTTP_SSE=true

# Logging Configuration: debug, info, warn, error
LOG_LEVEL=info

MCP Integration

To connect the server with your agent, add the following configuration to your MCP setup:

"mcpServers": {
  "simple-memory": {
    "url": "http://localhost:3000/sse",
    "trust": false
  }
}

Using the Memory Extension

Available Tools

The server provides several tools organized into categories:

Context Item Management

  • Store Context Item: Save information with a specific key in a namespace
  • Retrieve Context Item by Key: Fetch stored information using its key
  • Delete Context Item: Remove a specific key-value pair

Namespace Management

  • Create Namespace: Create a new organizational namespace
  • Delete Namespace: Remove a namespace and all its contents
  • List Namespaces: View all available namespaces
  • List Context Item Keys: See all keys within a specific namespace

Semantic Search

  • Retrieve Context Items by Semantic Search: Find items based on meaning rather than exact key match

Semantic Search Feature

The semantic search functionality allows finding information based on meaning rather than exact matches:

  1. Your query is converted to a vector using the E5 embedding model
  2. Text is automatically split into chunks for better matching
  3. The system calculates similarity between your query and stored items
  4. Results are filtered by relevance threshold and sorted
  5. The most relevant matches are returned with their full values

Semantic Search Setup

The semantic search feature utilizes Python dependencies that should be automatically installed when starting the server. It uses the multilingual E5 large instruct model from Hugging Face for embeddings.

Practical Usage

  1. Start by creating a namespace for your project
  2. Store important code snippets, decisions, or implementation details
  3. Retrieve information when needed either by key or semantic search
  4. Let your agent manage memory automatically during extended sessions
  5. Clean up by deleting items or entire namespaces when no longer needed

This server is especially valuable during extended coding sessions where maintaining context between interactions is important for productivity and consistency.

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 "simple-memory-extension" '{"command":"npm","args":["start"],"cwd":"${workspaceFolder}"}'

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": {
        "simple-memory-extension": {
            "command": "npm",
            "args": [
                "start"
            ],
            "cwd": "${workspaceFolder}"
        }
    }
}

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": {
        "simple-memory-extension": {
            "command": "npm",
            "args": [
                "start"
            ],
            "cwd": "${workspaceFolder}"
        }
    }
}

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