This repository has moved to GitHub
Active development, issues, pull requests, CI and releases are at https://github.com/doobidoo/mcp-memory-service as of 5 September 2026.
This copy stays here, readable and unchanged, so that existing links, issue numbers and pull request references keep resolving. It receives no further pushes and its CI no longer runs. Please do not open issues or pull requests here, they will not be seen.
The wiki moved too: https://github.com/doobidoo/mcp-memory-service/wiki
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
▶ The 3D knowledge graph in motion — every memory a glowing node, every relationship a curved edge. (Video not playing? See it live at mcpmemory.services.)
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-service | With mcp-memory-service |
|---|---|
| Each agent run starts from zero | Agents retrieve prior decisions in 5ms |
| Memory is local to one graph/run | Memory is shared across all agents and runs |
| You manage Redis + Pinecone + glue code | One self-hosted service, zero cloud cost |
| No causal relationships between facts | Knowledge graph with typed edges (causes, fixes, contradicts) |
| Context window limits create amnesia | Autonomous consolidation compresses old memories |
Key capabilities for agent pipelines:
- Framework-agnostic REST API — 76 endpoints, no MCP client library needed
- Knowledge graph — agents share causal chains, not just facts
X-Agent-IDheader — auto-tag memories by agent identity for scoped retrievalconversation_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 your needs? See the Setup Guide — a decision tree walks you to the right path in under a minute.
1. Install:
pip install mcp-memory-service
2. Configure your AI client:
Claude Desktop
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.
Claude Code
claude mcp add memory -- memory server
Restart Claude Code. Memory tools will appear automatically.
Agent pipelines (REST API — LangGraph, CrewAI, AutoGen, any HTTP client)
MCP_ALLOW_ANONYMOUS_ACCESS=true memory server --http
# REST API running at http://localhost:8000
import asyncio
import httpx
BASE_URL = "http://localhost:8000"
async def main():
async with httpx.AsyncClient() as client:
# Store — auto-tag with X-Agent-ID header
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 to a specific agent
results = await client.post(f"{BASE_URL}/api/memories/search", json={
"query": "API rate limits",
"tags": ["agent:researcher"],
})
print(results.json()["memories"])
asyncio.run(main())
Framework-specific guides: docs/agents/
OpenCode
Start the HTTP API:
MCP_ALLOW_ANONYMOUS_ACCESS=true memory server --http
Install the local plugin:
git clone https://github.com/doobidoo/mcp-memory-service.git
cd mcp-memory-service
mkdir -p ~/.config/opencode/plugins
cp opencode/memory-plugin.js ~/.config/opencode/plugins/
cp opencode/memory-plugin.config.example.json ~/.config/opencode/memory-plugin.json
OpenCode automatically loads local plugins from ~/.config/opencode/plugins/ and .opencode/plugins/.
Optional: register the /memory slash command in ~/.config/opencode/opencode.json to query status, search, and health from inside the TUI:
{
"command": {
"memory": {
"description": "Show MCP Memory Service status. Usage: /memory, /memory search <query>, /memory health",
"template": ""
}
}
}
See OpenCode integration guide for configuration, project-local installs, slash command details, TUI toasts, and current limitations.
The current OpenCode integration ships as repository files for the local plugin directory. If you installed only the PyPI package, clone the repository once to copy the plugin files.
The plugin defaults to
http://127.0.0.1:8000, butmemoryService.endpointandOPENCODE_MEMORY_ENDPOINTlet you target any reachable HTTP deployment.
🌐 claude.ai (Browser — Remote MCP)
Unlike desktop-only MCP servers, mcp-memory-service supports Remote MCP: persistent memory directly in your browser, on any device — no Claude Desktop required. Enterprise-ready (OAuth 2.0 + HTTPS + CORS), self-hosted or cloud-hosted.
# 1. Start server with Remote MCP
MCP_STREAMABLE_HTTP_MODE=1 \
MCP_SSE_HOST=0.0.0.0 \
MCP_OAUTH_ENABLED=true \
python -m mcp_memory_service.server
# 2. Expose publicly (Cloudflare Tunnel)
cloudflared tunnel --url http://localhost:8765
# 3. Add connector in claude.ai Settings → Connectors with the tunnel URL
# OAuth flow will handle authentication automatically
Production Setup: Remote MCP Setup Guide (Let's Encrypt, nginx, Docker, firewall). Step-by-Step Tutorial: Blog: 5-Minute claude.ai Setup | [Wiki Guide](https://github
