MCPHub LabRegistrymcp-memory-service
doobidoo

mcp memory service

Built by doobidoo โ€ข 1,558 stars

What is mcp memory service?

A high-performance MCP server implementation for mcp-memory-service that bridges the gap between the Model Context Protocol and external services. It allows Large Language Models to interact with your data and tools with low latency and native support.

How to use mcp memory service?

1. Ensure you have an MCP-compatible client (like Claude Desktop) installed. 2. Configure your server with: npx @modelcontextprotocol/mcp-memory-service 3. Restart your client and verify the new tools are available in the system catalog.
๐Ÿ›ก๏ธ Scoped (Restricted)
npx @modelcontextprotocol/mcp-memory-service --scope restricted
๐Ÿ”“ Unrestricted Access
npx @modelcontextprotocol/mcp-memory-service

Key Features

Native MCP Protocol Support
High-performance Data Streaming
Type-safe Tool Definitions
Seamless Environment Integration

Optimized Use Cases

Connecting external databases to AI workflows
Automating workflow tasks via natural language
Augmenting developer productivity with specialized tools

mcp memory service FAQ

Q

What is an MCP server?

MCP is an open standard that enables developers to build secure, two-way integrations between AI models and local or remote data sources.

Q

Is this server ready for production?

Yes, this server follows standard MCP security patterns and tool-restricted access.

Official Documentation

View on GitHub

mcp-memory-service

Persistent Shared Memory for AI Agent Pipelines

Open-source memory backend for AI agents โ€” REST API, MCP, OAuth, CLI, dashboard. One self-hosted service, every transport. Agents store decisions, share causal knowledge graphs, and retrieve context in 5ms โ€” without cloud lock-in or API costs.

Works with LangGraph ยท CrewAI ยท AutoGen ยท any HTTP client ยท Claude Desktop ยท OpenCode


Website License: Apache 2.0 PyPI version Python GitHub stars Remote MCP OAuth 2.0 Ask DeepWiki


<div align="center"> <video src="https://mcpmemory.services/assets/videos/knowledge-graph-3d.mp4" poster="https://mcpmemory.services/assets/images/knowledge-graph-3d-poster.png" width="820" autoplay loop muted playsinline controls> <a href="https://mcpmemory.services/"><img src="https://mcpmemory.services/assets/images/knowledge-graph-3d.png" alt="3D knowledge graph โ€” memories as a glowing, interactive galaxy" width="820"></a> </video> <p><em>โ–ถ <a href="https://mcpmemory.services/">The 3D knowledge graph in motion</a></em> โ€” every memory a glowing node, every relationship a curved edge.</p> </div>

Why Agents Need This

Your AI assistant forgets everything when you start a new chat. You spend 10 minutes re-explaining your architecture. Again. MCP Memory Service captures project context, architecture decisions, and code patterns automatically โ€” new sessions start with everything already known.

Without mcp-memory-serviceWith mcp-memory-service
Each agent run starts from zeroAgents retrieve prior decisions in 5ms
Memory is local to one graph/runMemory is shared across all agents and runs
You manage Redis + Pinecone + glue codeOne self-hosted service, zero cloud cost
No causal relationships between factsKnowledge graph with typed edges (causes, fixes, contradicts)
Context window limits create amnesiaAutonomous consolidation compresses old memories

Key capabilities for agent pipelines:

  • Framework-agnostic REST API โ€” no MCP client library needed; the live endpoint list is at /api/docs
  • Knowledge graph โ€” agents share causal chains, not just facts
  • X-Agent-ID header โ€” auto-tag memories by agent identity for scoped retrieval
  • conversation_id โ€” bypass deduplication for incremental conversation storage
  • SSE events โ€” real-time notifications when any agent stores or deletes a memory
  • Embeddings run locally via ONNX โ€” memory never leaves your infrastructure

๐Ÿš€ Get Started in 60 Seconds

Not sure which setup fits? The Setup Guide walks you to the right path in under a minute.

1. Install:

pip install mcp-memory-service

2. Configure your AI client:

<details open> <summary><strong>Claude Desktop</strong></summary>

Add to your config file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "memory": {
      "command": "memory",
      "args": ["server"]
    }
  }
}

Restart Claude Desktop. Your AI now remembers everything across sessions.

</details> <details> <summary><strong>Claude Code</strong></summary>
claude mcp add memory -- memory server

Restart Claude Code. Memory tools will appear automatically.

</details> <details> <summary><strong>Agent pipelines (REST API โ€” LangGraph, CrewAI, AutoGen, any HTTP client)</strong></summary>
MCP_ALLOW_ANONYMOUS_ACCESS=true memory server --http
# REST API running at http://localhost:8000

Store a memory with POST /api/memories, search with POST /api/search, retrieve by tag with POST /api/search/by-tag. Send X-Agent-ID: <id> on a store request and the server tags the memory agent:<id>, which a tag search then scopes retrieval by.

Worked examples per framework, the tag conventions and the async patterns: docs/agents/

</details> <details> <summary><strong>OpenCode</strong></summary>
MCP_ALLOW_ANONYMOUS_ACCESS=true memory server --http

The plugin ships as repository files for the local plugin directory, so clone the repository once even if you installed from PyPI. Install steps, the /memory slash command and the endpoint override: opencode/README.md

</details> <details> <summary><strong>Codex (automatic memory hooks)</strong></summary>

Start the Memory Service HTTP API, then install the hooks from this repository:

python3 codex/install_hooks.py

Restart Codex and review the hooks with /hooks. They retrieve project context, capture new learnings, and checkpoint outcomes before compaction and at session end. See Codex hook setup for prerequisites, authentication, and project-local installation.

</details> <details> <summary><strong>claude.ai and ChatGPT (browser โ€” Remote MCP)</strong></summary>

Remote MCP puts persistent memory in the browser on any device, no desktop app required: OAuth 2.0 over HTTPS, self-hosted or cloud-hosted. Both claude.ai and ChatGPT (Developer Mode) connect to the same endpoint.

Cloudflare Tunnel quick start, Let's Encrypt, nginx, Caddy and Docker production setups: Remote MCP Setup ยท 5-minute tutorial

</details> <details> <summary><strong>Advanced: custom backends and team setup</strong></summary>
git clone https://github.com/doobidoo/mcp-memory-service.git
cd mcp-memory-service
python scripts/installation/install.py

Choose from SQLite (local, fast, single-user), Cloudflare (cloud, multi-device sync), Hybrid (5ms local reads with background cloud sync โ€” recommended for production) or Milvus (dedicated vector DB: Lite file, self-hosted, or Zilliz Cloud). For self-hosted team setups, the Hybrid backend can sync to another HTTP MCP Memory Service instead of Cloudflare using MCP_HYBRID_SECONDARY_BACKEND=http.

For long-lived services, prefer Docker Milvus or Zilliz Cloud over Milvus Lite โ€” why.

</details>

โšก Works With Your Favorite AI Tools

  • Agent frameworks (REST): LangGraph ยท CrewAI ยท AutoGen ยท OpenClaw/Nanobot ยท any HTTP client
  • CLI and terminal (MCP): Claude Code ยท Gemini CLI ยท OpenCode ยท Codex CLI ยท Goose ยท Aider ยท Amp
  • Desktop and IDE (MCP): Claude Desktop ยท VS Code ยท Cursor ยท Windsurf ยท Raycast ยท JetBrains ยท Zed
  • Chat (MCP): ChatGPT (Developer Mode) ยท claude.ai (Remote MCP over HTTPS)

Full list, plus clients without OAuth such as Home Assistant: docs/integrations.md


โœจ Features

Store and retrieve context

  • ๐Ÿง  Persistent memory โ€” Keep decisions, notes, and project context across sessions and agents.
  • ๐Ÿ” Semantic and keyword search โ€” Combine vector search with BM25; use mode="ranked" to weigh recency, access frequency, and quality. An optional fallback cascade tries exact and tag matching when semantic results are sparse.
  • ๐Ÿท๏ธ Scoped retrieval โ€” Filter by tags with AND/OR matching, natural-language time ranges, and store partitions (default, docs, or all for cross-store search).
  • ๐Ÿ“ Optional search summaries โ€” Request summarize=true for query-aware summaries with validated source references. Requires MCP_SEARCH_SUMMARIZE_ENABLED=true and a configured LLM provider; unavailable summaries fall back to raw results. Search API and examples
  • ๐Ÿ“„ Document ingestion โ€” Import PDF, text, and Markdown with chunking for retrieval. Additional formats such as DOCX and PPTX require optional parsing tools. Document ingestion guide

Capture and maintain knowledge

  • โšก Automatic session capture โ€” Configurable Claude Code hooks retrieve context and save session learnings; the local memory_harvest tool extracts decisions, bugs, conventions, and lessons from transcripts. Hooks setup ยท Harvest configuration
  • ๐Ÿ’ก Autonomous consolidation โ€” Schedule clustering, compression, association discovery, and controlled forgetting. Insight cards surface patterns, trends, and knowledge gaps. Consolidation guide
  • ๐Ÿ’ญ Beliefs and contradiction handling โ€” Derive confidence-scored beliefs from observations. Heuristic contradiction detection can mark older memories as superseded, hiding them from default retrieval while retaining them for explicit lookup.
  • ๐Ÿค– Agent bootstrap profiles โ€” get_bootstrap_profile assembles behavioral context for a new agent within a token budget, with optional task-aware retrieval. Requires MCP_BOOTSTRAP_ENABLED=true; profiles are not isolated by project.
  • ๐Ÿงฌ Knowledge graph and entities โ€” Explore typed causal relationships in the interactive graph. ๐Ÿ”— Entity extraction links @mentions, #tags, URLs, and file paths to a queryable entity graph. Knowledge graph guide
  • ๐Ÿ  Quality scoring โ€” Use your own OpenAI-compatible endpoint, including Ollama, LiteLLM, or vLLM. Configuration guide

Run locally and share across devices

  • ๐Ÿ”’ Local-first storage โ€” Local ONNX embeddings and SQLite storage keep core memory operations on your infrastructure. Optional LLM features use the providers you configure.
  • โ˜๏ธ Cloud or self-hosted sync โ€” Use Cloudflare or another MCP Memory Service instance as a Hybrid secondary. Separately enabled delta-sync exchanges changes between hosts; it is off by default. Self-hosted sync guide
  • ๐Ÿ“ฆ Import, export, and migration โ€” Move memories through JSON import/export, including conversion of mem0 exports. Import/export tools ยท mem0 migration guide
  • ๐Ÿ’พ Database backups โ€” Configure scheduled backups or trigger one manually through the HTTP API. Inspect backup status and available snapshots through the backup endpoints in the live API reference at /api/docs.
  • ๐Ÿ“Š Web dashboard โ€” Search, browse, visualize, and manage memories at http://localhost:8000.

The dashboard has eight tabs โ€” Dashboard, Search, Browse, Documents, Manage, Analytics, Quality, API Docs. Two-minute walkthrough on YouTube ยท Web Dashboard Guide

How it compares to Mem0, Zep and the MCP-native alternatives, benchmark results, and deployments people run in production: mcpmemory.services


๐Ÿ› ๏ธ Configuration Highlights

memory launch                  # Start HTTP server in background (127.0.0.1:8000)
memory launch --port 8192      # Custom port
memory info                    # Status and health
memory logs --lines 50         # Recent logs
memory stop                    # Stop server

These commands are optimized for fast startup and avoid loading heavy ML dependencies unless needed.

โš ๏ธ Security note: the server binds to 127.0.0.1 (localhost only) by default. --host 0.0.0.0 / MCP_HTTP_HOST=0.0.0.0 exposes the API to your network โ€” do that only in trusted environments with authentication and firewall rules, or behind TLS termination or a VPN overlay.

Backends, embedding models, quality scoring and every environment variable: Configuration Guide


๐Ÿ“š Documentation

Also listed on Glama and Spark.


๐Ÿ“ฆ Releases

Every release, with upgrade notes: CHANGELOG.md ยท GitHub Releases ยท archived history


๐Ÿค Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines and SECURITY.md for reporting a vulnerability.

Who authors this project, who holds copyright, and what every change passes before it reaches main: AUTHORSHIP.md.

Quick Development Setup:

git clone https://github.com/doobidoo/mcp-memory-service.git
cd mcp-memory-service
pip install -e .  # Editable install
pytest tests/      # Run test suite

Supporting the Project

MCP Memory Service is maintained by one person. If it saves you or your company time, you can support its development via Ko-fi, Buy Me a Coffee or PayPal: SPONSORS.md.

Global Ranking

7.4
Trust ScoreMCPHub Index

Based on codebase health & activity.

Manual Config

{ "mcpServers": { "mcp-memory-service": { "command": "npx", "args": ["mcp-memory-service"] } } }