Memory MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
bun install
bun build src/index.ts --outdir=build --target=bun
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add local-memory -- bun "<FULL_PATH_TO_LOCAL_MCP>/dist/index.js"

Replace <FULL_PATH_TO_LOCAL_MCP>/dist/index.js with the actual folder you prepared in step 1.

README.md

A lightweight MCP server for persistent agent memory using SQLite and Bun.

Memory MCP Server

A lightweight MCP (Model Context Protocol) server for persistent agent memory using SQLite and Bun.

Features

  • store_memory: Store key-value pairs with optional JSON metadata
  • retrieve_memory: Retrieve a memory by its key
  • list_memories: List all memories with optional limit
  • delete_memory: Delete a memory by its key

Prerequisites

  • Bun v1.3.9 or higher

Installation

bun install

Build

bun build src/index.ts --outdir=build --target=bun

Run

bun run src/index.ts

Or use the built version:

bun run build/index.js

Configuration

Environment Variables

  • MEMORY_DB_PATH: Path to the SQLite database file (default: ./memory.db)

MCP Settings Integration

To use this MCP server with Roo Code or Claude Desktop, add the following configuration to your MCP settings file:

Roo Code (Windows): %APPDATA%\roo-code\settings\mcp_settings.json Claude Desktop (Windows): %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "memory": {
      "command": "bun",
      "args": ["/path/to/local-mcp/build/index.js"],
      "env": {
        "MEMORY_DB_PATH": "/path/to/local-mcp/memory.db"
      }
    }
  }
}

Replace /path/to/local-mcp with the absolute path to this directory.

Usage Examples

Once configured, you can use the memory tools in your MCP client:

Store a memory

store_memory with key="user_preference", value="dark_mode", metadata='{"category":"ui"}'

Retrieve a memory

retrieve_memory with key="user_preference"

List all memories

list_memories

List limited memories

list_memories with limit=10

Delete a memory

delete_memory with key="user_preference"

Project Structure

local-mcp/
├── src/
│   ├── db/
│   │   └── index.ts          # Database initialization and types
│   ├── tools/
│   │   ├── store-memory/     # Store memory tool
│   │   ├── retrieve-memory/  # Retrieve memory tool
│   │   ├── list-memories/    # List memories tool
│   │   └── delete-memory/    # Delete memory tool
│   └── index.ts              # Main server entry point
├── build/                    # Compiled output
├── memory.db                 # SQLite database (created automatically)
├── .env.example              # Environment variables template
├── package.json
├── tsconfig.json
└── README.md

Database Schema

CREATE TABLE memories (
  key TEXT PRIMARY KEY,
  value TEXT NOT NULL,
  metadata TEXT,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

License

MIT

Tools (4)

store_memoryStore key-value pairs with optional JSON metadata
retrieve_memoryRetrieve a memory by its key
list_memoriesList all memories with optional limit
delete_memoryDelete a memory by its key

Environment Variables

MEMORY_DB_PATHPath to the SQLite database file

Configuration

claude_desktop_config.json
{"mcpServers": {"memory": {"command": "bun", "args": ["/path/to/local-mcp/build/index.js"], "env": {"MEMORY_DB_PATH": "/path/to/local-mcp/memory.db"}}}}

Try it

Store a new memory with key 'project_status' and value 'in-progress' with metadata indicating it is a project update.
Retrieve the memory associated with the key 'user_preference'.
List the last 5 memories stored in the database.
Delete the memory entry for 'temporary_note'.

Frequently Asked Questions

What are the key features of Memory MCP Server?

Persistent key-value storage using SQLite. Support for JSON metadata for enhanced context. Ability to list and limit retrieved memory entries. Simple key-based retrieval and deletion.

What can I use Memory MCP Server for?

Storing user preferences across different AI sessions. Maintaining long-term context for complex coding projects. Caching frequently accessed data to reduce redundant processing. Managing stateful information for autonomous agent workflows.

How do I install Memory MCP Server?

Install Memory MCP Server by running: bun install && bun build src/index.ts --outdir=build --target=bun

What MCP clients work with Memory MCP Server?

Memory MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Memory MCP Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare