mcp-memory-server
Persistent agent memory MCP server using Markdown files and SQLite FTS5 for saving and recalling memories via tools like memory_save and memory_recall.
README
MCP Memory Server
Persistent agent memory for Blockbrain (or any MCP client) via Markdown files + SQLite FTS5 full-text search.
Why?
Blockbrain agents don't persist memory between sessions. Every conversation starts from zero. This MCP server fixes that — the agent can save what it learned and recall it next time.
How it works:
- Agent solves a problem → calls
memory_savewith the solution - Agent starts a new task → calls
memory_recallto check for similar past problems - All memories are stored as readable Markdown files + indexed in SQLite for fast search
Tools
| Tool | Description |
|---|---|
memory_save |
Store a memory entry (topic, title, content) |
memory_recall |
Search memories by keyword/topic (FTS5) |
memory_list_topics |
List all stored topics with entry counts |
memory_delete |
Remove a memory entry by ID |
Quick Start (Docker)
# 1. Clone
git clone https://github.com/lanlibbi/mcp-memory-server.git
cd mcp-memory-server
# 2. Configure
cp .env.example .env
# Edit .env — set MEMORY_API_KEY!
# Generate a key: openssl rand -hex 32
# 3. Run
docker compose up -d
# 4. Verify
curl http://localhost:8080/health
Blockbrain Integration
-
Expose the server publicly — Blockbrain needs an HTTPS URL:
- Option A: Cloudflare Tunnel (
cloudflared tunnel --url http://localhost:8080) - Option B: Any reverse proxy (nginx, Caddy, Traefik) with TLS
- Option C: ngrok for testing (
ngrok http 8080)
- Option A: Cloudflare Tunnel (
-
Register in Blockbrain:
- Go to Admin → Agents → MCP Servers
- Click "+ Add MCP Server"
- Fill in:
- Name: Memory Server
- Server URL:
https://<your-public-url>/sse - Transport: SSE
- Authentication: API Key
- API Key: (the value from your .env)
- Save & activate
-
Assign to an agent and add instructions to the agent's system prompt:
Before starting a new task, call memory_recall with keywords related to the task. After completing a task or learning something new, call memory_save with: - topic: a category for the task (e.g. "contract-review", "supplier-issue") - title: a short descriptive title - content: what was the problem, what was the solution, what was learned
Configuration
All config via environment variables:
| Variable | Default | Description |
|---|---|---|
MEMORY_API_KEY |
(empty = no auth) | API key for X-API-Key header |
MEMORY_DATA_DIR |
/data/memories |
Where Markdown files are stored |
MEMORY_PORT |
8080 |
HTTP port |
MEMORY_MAX_RESULTS |
10 |
Max search results per query |
LOG_LEVEL |
info |
debug, info, warning, error |
Storage
Memories are stored as Markdown files with YAML frontmatter:
/data/memories/
├── contract-review/
│ ├── nda-standard-clauses.md
│ └── liability-clause-fix.md
├── supplier-issue/
│ └── delayed-delivery-workaround.md
└── memory.db ← SQLite FTS5 index
Each file looks like:
---
id: a1b2c3d4e5f67890
topic: contract-review
title: NDA Standard Clauses
created_at: 2026-08-20T15:00:00Z
updated_at: 2026-08-20T15:00:00Z
---
# NDA Standard Clauses
The standard NDA should always include...
You can browse, edit, or delete memories directly — they're just Markdown files. The SQLite index stays in sync automatically.
Local Development (without Docker)
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
export MEMORY_API_KEY=test-key
export MEMORY_DATA_DIR=./data/memories
python -m uvicorn src.server:app --host 0.0.0.0 --port 8080
API Endpoints
| Endpoint | Method | Description |
|---|---|---|
/health |
GET | Health check (no auth required) |
/sse |
GET | SSE endpoint for MCP client connection |
/messages/ |
POST | MCP message endpoint (used by SSE transport) |
Tech Stack
- Python 3.12 + MCP SDK
- Starlette + Uvicorn for HTTP/SSE
- SQLite FTS5 for full-text search (zero external dependencies)
- Markdown for human-readable storage
License
MIT
Recommended Servers
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.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.