mcp-memory-service: Why Devs Are Ditching Cloud Memory APIs
mcp-memory-service: Why Devs Are Ditching Cloud Memory APIs
Your AI just forgot everything. Again.
You spent 45 minutes explaining your microservices architecture to Claude. You mapped the Kafka topics, the GraphQL federation strategy, the CI/CD pipeline quirks. The next morning? Fresh chat. Blank slate. "What's your tech stack?" it asks, and your soul leaves your body.
This isn't a bug. It's the fundamental amnesia baked into every AI tool you use. Context windows balloon to 500K+ tokens, performance crawls, and you restart—losing every decision, every pattern, every hard-won insight.
What if your AI remembered? Not just within a session. Forever. Across every tool, every framework, every device you own.
Enter mcp-memory-service—the open-source memory backend that top developers are quietly deploying to make their AI agents actually intelligent. Not cloud-rented intelligence. Yours. Running locally, retrieving context in 5ms, sharing knowledge graphs between agents without a single API call to Silicon Valley.
This isn't another memory wrapper. This is persistent shared memory for AI agent pipelines that works with LangGraph, CrewAI, AutoGen, Claude Desktop, and even your browser-based claude.ai sessions. And it costs zero dollars.
Ready to stop re-explaining your life to machines? Let's dive deep.
What is mcp-memory-service?
mcp-memory-service is an open-source, self-hosted persistent memory service for AI agents and assistants. Created by doobidoo and released under Apache 2.0, it provides a unified memory layer that any AI tool can read from and write to—regardless of framework, vendor, or deployment model.
At its core, it's three things that nobody else combines:
- A Model Context Protocol (MCP) server — the emerging standard for tool-augmented AI
- A 76-endpoint REST API — framework-agnostic, language-agnostic HTTP interface
- A knowledge graph with typed causal edges — not just vector search, but relationships between memories
The project exploded in popularity because it solves a problem that commercial solutions pretend doesn't exist: AI memory should not be a recurring subscription. Mem0 charges per call. Zep gates features behind enterprise contracts. Redis+Pinecone DIY stacks demand weeks of glue code. mcp-memory-service gives you production-grade memory infrastructure for $0, with embeddings running locally via ONNX so your data never leaves your hardware.
Why it's trending now: The MCP protocol (pioneered by Anthropic) is becoming the universal plug for AI tools. But most MCP servers are stateless—each interaction starts fresh. mcp-memory-service is one of the first to provide stateful MCP: your Claude Desktop, Claude Code, Cursor, Windsurf, and even browser-based claude.ai all share the same persistent memory pool. When the community discovered it also supports Remote MCP for claude.ai without any desktop software, adoption accelerated dramatically.
The repository currently ships with 25+ compatible AI tools, framework-specific guides for LangGraph/CrewAI/AutoGen, a web dashboard, OAuth 2.0 + Dynamic Client Registration for team deployments, and even Cloudflare-backed multi-device sync. It's not a prototype. It's infrastructure.
Key Features That Separate It From the Herd
Let's dissect what makes this technically special—not marketing fluff, but architectural decisions that matter.
🔒 100% Local-First, Privacy-By-Design
Embeddings run via ONNX Runtime using all-MiniLM-L6-v2 (384d). No OpenAI API key. No data exfiltration. Your proprietary code patterns, security decisions, and architectural debates stay on your silicon. For quality scoring, you can even plug in Ollama, LiteLLM, or MLX—keeping the entire inference chain local.
🧠 Knowledge Graph With Typed Causal Edges
Most memory systems store flat vectors. mcp-memory-service stores relationships: causes, fixes, contradicts, supports, follows. When your agent learns that "Rate limit on Provider X is 50 RPM," it can later retrieve not just that fact, but what caused you to discover it, what fixed it, and what contradicts prior assumptions. The D3.js interactive visualization in the web dashboard turns this into explorable intelligence.
⚡ 5ms Retrieval With Hybrid Search
BM25 keyword search + vector semantic search + Reciprocal Rank Fusion (RRF) for SQLite-vec. For Milvus backends, full BM25 hybrid with anns_field optimization. The benchmarks are public: 80.4% R@5 on LongMemEval, 91.1% Recall@5 on DevBench—all with zero LLM API calls during retrieval.
🌐 Remote MCP: claude.ai in Your Browser Unlike every other MCP memory solution, this works directly in claude.ai without Claude Desktop. Streamable HTTP mode + OAuth 2.0 + CORS means your phone, tablet, or locked-down corporate laptop can access the same memory. Cloudflare Tunnel deployment takes 5 minutes.
🔄 Autonomous Memory Consolidation Memories don't just accumulate—they decay, compress, and surface insights automatically. The consolidation engine detects patterns, trends, and knowledge gaps across your corpus, generating structured "Insight Cards." Old memories get compressed; contradictions get flagged; high-value mistake notes are protected from forgetting.
🏷️ X-Agent-ID Header: Multi-Agent Native
Every memory auto-tags with the agent identity via HTTP headers. researcher agent's findings don't pollute coder agent's retrieval unless you want cross-pollination. Tags become inter-agent signals: msg:cluster sentinels let 5-agent OpenClaw clusters use memory as a messaging bus with zero additional infrastructure.
☁️ Optional Cloud Sync Without Lock-In SQLite for local speed (5ms). Cloudflare Workers + Vectorize for multi-device sync. Hybrid mode for both. Milvus Lite, self-hosted Milvus Docker↗ Bright Coding Blog, or Zilliz Cloud for dedicated vector DB needs. Your choice, your data, your backends.
Use Cases: Where This Actually Shines
1. The Solo Developer Who's Tired of Groundhog Day
You juggle 6 projects. Each morning, you open Claude and re-explain your Next.js↗ Bright Coding Blog/Prisma/tRPC stack. With mcp-memory-service, you store architecture decisions once. Fresh sessions start with "I remember—Next.js App Router with Prisma and tRPC. What should we build?" 10 minutes saved per session, compounded daily.
2. Multi-Agent Research Clusters
A 5-agent OpenClaw deployment where cluster-agent-3 discovers a provider rate limit. It stores: "Rate limit on provider X is 50 RPM — switch to provider Y after 40" with tag msg:cluster. Your local agent polls for msg:cluster tags and receives cross-cluster intelligence. Memory becomes the coordination layer—no RabbitMQ, no Redis Pub/Sub, no custom protocol.
3. Enterprise Teams With Data Sovereignty Requirements
Financial services. Healthcare. Defense. You cannot ship embeddings to OpenAI or Pinecone. Deploy mcp-memory-service on-premise with Milvus backend, OAuth 2.0 + DCR for team auth, and Cloudflare Tunnel for remote access. Full audit trail, zero external data exposure, 76 REST endpoints for internal tool integration.
4. Browser-Based AI Workflows on Locked-Down Machines
Corporate laptop with no admin rights? No Claude Desktop install possible. Start the server with MCP_STREAMABLE_HTTP_MODE=1, tunnel via Cloudflare, add as claude.ai Connector. Your browser-based AI now has persistent memory—the only solution that does this with MCP protocol compliance.
5. Homelab Quality Scoring With Local LLMs
Set MCP_QUALITY_AI_PROVIDER=openai-compatible, point at your Ollama instance running qwen2.5:7b-instruct, and every memory gets quality-scored without cloud dependency. The :quality-cpu Docker image pre-exports ONNX models—no PyTorch bloat at runtime.
Step-by-Step Installation & Setup Guide
The 60-Second Personal Setup
# Install from PyPI
pip install mcp-memory-service
# Start with anonymous access for local experimentation
MCP_ALLOW_ANONYMOUS_ACCESS=true memory server --http
# REST API now running at http://localhost:8000
# Web dashboard at http://localhost:8000/dashboard
That's it. No Docker. No database configuration. SQLite-vec with local ONNX embeddings, ready for personal use.
Claude Desktop Integration
Edit your Claude Desktop config:
{
"mcpServers": {
"memory": {
"command": "memory",
"args": ["server"]
}
}
}
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
Restart Claude Desktop. Your AI now remembers across every conversation.
Claude Code (Terminal)
claude mcp add memory -- memory server
Restart Claude Code. Memory tools appear automatically in your terminal AI workflow.
Remote MCP for claude.ai (Browser) — The Secret Weapon
# 1. Start server with Remote MCP enabled
MCP_STREAMABLE_HTTP_MODE=1 \
MCP_SSE_HOST=0.0.0.0 \
MCP_SSE_PORT=8765 \
MCP_OAUTH_ENABLED=true \
python↗ Bright Coding Blog -m mcp_memory_service.server
# 2. Expose via Cloudflare Tunnel (install cloudflared first)
cloudflared tunnel --url http://localhost:8765
# → Outputs: https://random-name.trycloudflare.com
# 3. In claude.ai: Settings → Connectors → Add Connector
# Paste: https://random-name.trycloudflare.com/mcp
# OAuth flow handles auth automatically
Production hardening: Add Cloudflare ZeroTrust with subnet-based access control (allow Anthropic subnets + your IPs). Enable Client IP Address Filtering on API tokens. For IPv6, include your /64 network in allowlists. Request offline_access scope for rotating refresh tokens (default 30-day lifetime, configurable via MCP_OAUTH_REFRESH_TOKEN_EXPIRE_DAYS).
Production Docker Stack
git clone https://github.com/doobidoo/mcp-memory-service.git
cd mcp-memory-service
python scripts/installation/install.py
Choose your backend:
- SQLite: Local, fastest, single-user
- Cloudflare: Multi-device sync, edge-deployed
- Hybrid: 5ms local reads + background cloud sync
- Milvus: Dedicated vector DB (Lite file, self-hosted Docker, or Zilliz Cloud)
For long-running services, prefer Docker Milvus or Zilliz Cloud over Milvus Lite—Milvus Lite's file-based locking isn't designed for concurrent server processes.
Background Server Lifecycle (v10.49.0+)
# Start HTTP server in background (default localhost:8000)
memory launch
# Custom port
memory launch --port 8192
# Check health and logs
memory info --port 8192
memory health --port 8192
memory logs --lines 50
# Stop cleanly
memory stop --port 8192
These commands use lazy loading—heavy ML dependencies initialize only when first needed, giving you sub-second startup for basic operations.
Security critical: Default bind is 127.0.0.1. Use --host 0.0.0.0 or MCP_HTTP_HOST=0.0.0.0 only in trusted networks with TLS termination (reverse proxy with HTTPS) or VPN overlays. Never expose raw HTTP to untrusted networks.
REAL Code Examples From the Repository
Example 1: Basic Store and Retrieve With Agent Identity
This is the foundational pattern—every other use case builds on this:
import httpx
BASE_URL = "http://localhost:8000"
async with httpx.AsyncClient() as client:
# STORE: Auto-tag with X-Agent-ID header
# The service automatically appends "agent:{id}" to your tags
await client.post(f"{BASE_URL}/api/memories", json={
"content": "API rate limit is 100 req/min",
"tags": ["api", "limits"],
}, headers={"X-Agent-ID": "researcher"})
# Stored with tags: ["api", "limits", "agent:researcher"]
# SEARCH: Scope retrieval to specific agent identity
# Prevents cross-contamination between different agents' contexts
results = await client.post(f"{BASE_URL}/api/memories/search", json={
"query": "API rate limits",
"tags": ["agent:researcher"], # Filter to this agent only
})
print(results.json()["memories"])
Why this matters: The X-Agent-ID header isn't just metadata—it's a security boundary. Your researcher agent's exploration of failed authentication patterns doesn't leak into your production-deploy agent's retrieval. Yet both can write to the same memory service, enabling selective cross-agent learning when you intentionally omit the filter.
Example 2: Inter-Agent Messaging With Sentinel Tags
This pattern emerged from real community usage—a 5-agent cluster using memory as a message bus:
# Cluster agent stores a learning and flags it for the local agent
# The "msg:cluster" tag acts as a channel selector
await client.post(f"{BASE_URL}/api/memories", json={
"content": "Rate limit on provider X is 50 RPM — switch to provider Y after 40",
"tags": ["api", "limits", "msg:cluster"], # sentinel tag = channel
}, headers={"X-Agent-ID": "cluster-agent-3"})
# Local agent polls for cluster messages
# No WebSockets, no message queue, no custom protocol—just semantic search
results = await client.post(f"{BASE_URL}/api/memories/search", json={
"query": "messages from cluster", # Semantic query finds relevant messages
"tags": ["msg:cluster"], # Exact tag filter for the channel
})
The architectural insight: Tags aren't just labels—they're communication primitives. The combination of semantic search ("messages from cluster" finds content even without exact keyword matches) and exact tag filtering (msg:cluster) gives you both fuzzy discovery and precise routing. This "emerges naturally from the tagging system"—no additional infrastructure, no protocol design, no operational complexity.
Example 3: Remote MCP Server Launch for Browser Integration
# Enable Streamable HTTP mode (not just SSE)—required for claude.ai browser
MCP_STREAMABLE_HTTP_MODE=1 \
# Bind to all interfaces so Cloudflare Tunnel can reach it
MCP_SSE_HOST=0.0.0.0 \
# Non-privileged port, easily tunneled
MCP_SSE_PORT=8765 \
# Enable OAuth 2.0 + Dynamic Client Registration for secure browser auth
MCP_OAUTH_ENABLED=true \
# Launch the server
python -m mcp_memory_service.server
Critical environment variables explained:
MCP_STREAMABLE_HTTP_MODE=1: Switches from SSE-only to Streamable HTTP transport, which claude.ai's browser client requires for Remote MCP. This is the only way to get persistent memory in claude.ai without desktop software.MCP_SSE_HOST=0.0.0.0: Necessary for tunneling; default127.0.0.1would reject Cloudflare's connections.MCP_OAUTH_ENABLED=true: Without this, there's no authentication on your exposed endpoint. Never deploy to production without OAuth.
Example 4: Homelab Quality Scoring With Ollama
# Use OpenAI-compatible API for local LLM quality scoring
MCP_QUALITY_AI_PROVIDER=openai-compatible
# Point at your local Ollama instance
MCP_QUALITY_AI_BASE_URL=http://localhost:11434/v1
# Qwen 7B instruct is recommended for quality/speed balance
MCP_QUALITY_AI_MODEL=qwen2.5:7b-instruct
# Ollama doesn't require API keys, but field must be set if your proxy does
# MCP_QUALITY_AI_API_KEY=ollama
What happens here: Every stored memory gets quality-scored by your local 7B model instead of cloud APIs or simple heuristics. On endpoint failure, the system gracefully falls back to implicit signals (access patterns, recency, etc.). The qwen2.5:7b-instruct model is specifically recommended because it handles evaluation tasks well at small size; MLX users can use mlx-community/Qwen2.5-7B-Instruct-4bit for Apple Silicon efficiency.
Example 5: CLI Lifecycle Management
# Background launch—no terminal occupation
memory launch
# Verify it's healthy before connecting clients
memory health
# Expected: {"status": "healthy", "version": "10.59.0", ...}
# Check what's running
memory info
# Shows: PID, port, backend type, memory count, uptime
# Inspect recent operations for debugging
memory logs --lines 50
# Timestamped: stores, searches, consolidation runs, errors
# Clean shutdown preserves data integrity
memory stop
Operational advantage: The memory CLI subcommands avoid loading PyTorch, transformers, or heavy ML frameworks unless a request actually needs them. For info, health, and logs, startup is sub-second. This matters when you're SSH'd into a remote server and need to check status without waiting 10 seconds for TensorFlow initialization.
Advanced Usage & Best Practices
Tag Architecture as API Design
Treat tags as your inter-agent contract. Establish conventions early: project:{name}, env:{prod|staging}, severity:{critical|warning|info}, msg:{channel}. The tag_match=AND/OR parameter (v10.54.0+) lets you build precise boolean queries: {"tags": ["project:payment", "severity:critical"], "tag_match": "AND"}.
Conversation-Aware Deduplication
Use conversation_id when storing incremental conversation turns. This bypasses semantic deduplication that would otherwise collapse similar utterances. Critical for accurate session reconstruction.
Session-Level Storage for Benchmark Parity
When you need LongMemEval-style session retrieval (86.0% R@5 vs 80.4% turn-level), use memory_store_session (v10.35.0+). Trade granularity for structural alignment with session-oriented benchmarks.
Consolidation Scheduling
Automatic consolidation is disable-by-default as of v10.47.2. Enable intentionally with MCP_CONSOLIDATION_SCHEDULE—don't let background processes surprise you during demos. The MAINTAIN_SCAN_LIMIT parameter (v10.56.0+) prevents runaway maintenance on large corpora.
Docker Security Layers
For production: Cloudflare Tunnel → AuthMCP Gateway (or mcp-auth-proxy) → mcp-memory-service. Never expose 0.0.0.0:8000 directly. Use the :quality-cpu image to eliminate PyTorch from your attack surface—only onnxruntime ships at runtime.
Stale Memory Detection
Use stale_days filter (v10.46.0+) in memory_list to surface dormant memories for archival or refresh. Combine with last_accessed_at tracking (v10.57.3+ for Milvus) to identify knowledge decay patterns.
Comparison With Alternatives
| Capability | Mem0 | Zep | DIY Redis+Pinecone | mcp-memory-service |
|---|---|---|---|---|
| License | Proprietary | Enterprise | — | Apache 2.0 |
| Cost | Per-call API fees | Enterprise contract | Infrastructure + labor | $0 |
| claude.ai Browser | ❌ Desktop only | ❌ Desktop only | ❌ | ✅ Remote MCP |
| OAuth 2.0 + DCR | ❓ Unknown | ❓ Unknown | ❌ | ✅ Enterprise-ready |
| Streamable HTTP | ❌ | ❌ | ❌ | ✅ |
| Framework Integration | SDK-locked | SDK-locked | Manual glue code | REST API (any HTTP client) |
| Knowledge Graph | No | Limited | No | ✅ Typed causal edges |
| Auto Consolidation | No | No | No | ✅ Decay + compression |
| On-Premise Embeddings | No | No | Manual setup | ✅ ONNX, local |
| Privacy | Cloud-hosted | Cloud-hosted | Partial | 100% local option |
| Hybrid Search | No | Yes | Manual | ✅ BM25 + vector |
| MCP Protocol | No | No | No | ✅ Native |
| REST API Endpoints | Limited | Limited | Build your own | 76 endpoints |
vs. MemPalace (MCP-native alternative):
| MemPalace | mcp-memory-service | |
|---|---|---|
| LongMemEval R@5 | 96.6%¹ (raw ChromaDB, zero LLM) | 86.0% (session) / 80.4% (turn) |
| Storage Granularity | Session-level only | Turn-level + session-level |
| Multi-Device Sync | ❌ Local only | ✅ Cloudflare sync |
| REST API / Dashboard | ❌ | ✅ Full featured |
| OAuth + Multi-User | ❌ | ✅ OAuth 2.1 |
| Knowledge Graph | ❌ | ✅ Typed edges |
| Compatible Tools | Claude-focused | 25+ tools |
¹ MemPalace's 96.6% is ChromaDB + default embeddings in "raw mode"—their Palace architecture (Wings, Rooms, Halls) is bypassed. Per community code review (Issue #27), this measures the underlying vector store, not their structural retrieval. mcp-memory-service's turn-level granularity trades benchmark optimization for real-world precision: finding exactly what was said, not just which session contained it.
FAQ
Q: Is mcp-memory-service free for commercial use? Yes. Apache 2.0 licensed. No usage limits, no API keys, no attribution requirements beyond preserving the license file. Deploy internally, ship in products, modify freely.
Q: How does this compare to just using Redis for agent memory? Redis gives you fast key-value storage. It doesn't give you semantic search, knowledge graphs, automatic consolidation, cross-agent identity scoping, or MCP protocol compliance. You'd build all of that yourself—weeks of work, ongoing maintenance, and you'll still lack the 76-endpoint API that frameworks expect.
Q: Can I use this without Claude Desktop installed? Absolutely. The Remote MCP feature (Streamable HTTP + OAuth) lets you use mcp-memory-service directly in claude.ai in any browser. It's the only open-source memory solution that does this. Also works with ChatGPT Developer Mode, Claude Code terminal, Cursor, Windsurf, and 20+ other tools.
Q: What happens to my data if the server restarts? SQLite backend: fully persistent, survives any restart. Cloudflare backend: synced to edge, durable. Hybrid: local SQLite with background cloud sync—best of both. All embeddings are stored, not recomputed on restart.
Q: How do I prevent agents from seeing each other's memories?
Use the X-Agent-ID header. Memories auto-tag with agent:{id}. Search with "tags": ["agent:researcher"] to scope retrieval. For cross-agent sharing, use sentinel tags like msg:cluster—agents opt-in to specific channels.
Q: Is the quality scoring reliable with local 7B models?
The v10.45.0+ OpenAI-compatible provider uses qwen2.5:7b-instruct or equivalent. On endpoint failure, it falls back to implicit signals (access count, recency, etc.). For highest accuracy, use the :quality-cpu Docker image with pre-exported ONNX DeBERTa models—no local LLM needed.
Q: Can multiple team members share one memory instance? Yes, with OAuth 2.0 + Dynamic Client Registration. Each user authenticates independently. Per-user access control via AuthMCP Gateway or mcp-auth-proxy. Cloudflare Tunnel provides secure remote access with subnet-based filtering.
Conclusion: Memory Is Infrastructure, Not a Feature
The AI tools you use daily are stateless by design. That's not a limitation they'll fix—it's a business model. Cloud memory APIs rent you recollection by the call, forever. Every session starts at zero, and you're trapped re-explaining, re-contextualizing, re-wasting time.
mcp-memory-service inverts this. It makes memory infrastructure you own: self-hosted, protocol-native, framework-agnostic, and permanently free. Your agents share causal knowledge graphs. Your browser-based AI remembers across devices. Your team collaborates without shipping data to third parties.
The benchmarks are public. The code is audited. The community is building real patterns—inter-agent messaging, quality scoring with local LLMs, production Docker stacks with Cloudflare tunnels—that no commercial alternative enables at any price.
Stop renting your AI's memory. Start owning it.
👉 Star and deploy mcp-memory-service on GitHub — your future sessions will remember why you did.
Last updated: Reflects v10.59.0 (May 16, 2026) with OAuth PEM key files, IDE redirect URI schemes, and memory-scorer affinity fixes.
Outils recommandés
Explore on the BrightCoding network
Hand-picked resources from our other sites.
coder/coder: Self-Hosted Cloud Dev Environments with Terraform
coder/coder is a self-hosted platform for cloud development environments and AI agents using Terraform. Define workspaces as code, connect via Wireguard®, and r...
yoshiko-pg/difit: Local Git Diff Viewer with AI Prompt Generation
yoshiko-pg/difit is a 2,983-star MIT-licensed CLI tool that renders Git diffs in a local GitHub-style web UI with AI-ready comment prompts. Built in TypeScript...
GiovanniPasq/agentic-rag-for-dummies: Build Agentic RAG with LangGraph
Modular Agentic RAG system built with LangGraph featuring hierarchical indexing, conversation memory, multi-agent map-reduce, and human-in-the-loop query clarif...
Continuez votre lecture
Why Alexandrie is the Ultimate Markdown Note-Taking App
Why CrossPaste is the Ultimate Game Changer for Clipboard Management
Why Chandra is the Ultimate OCR Tool for Handwriting and Tables
Stop Coding Alone: OPC-Skills Gives Your AI Agent Superpowers
Commentaires 0
Aucun commentaire pour l'instant. Soyez le premier à réagir !