Memory MCP Server

Memory MCP Server

A lightweight MCP server that provides persistent key-value storage for AI agents using SQLite and Bun. It enables agents to store, retrieve, and manage memories with optional JSON metadata for long-term context retention.

Category
Visit Server

README

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

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured