MCP MITM Mem0
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP MITM Mem0 search for our last conversation about Docker commands"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP MITM Mem0
This project is experimental and deprecated. A new, improved version is being developed at https://github.com/terrymunro/mcp-claude-memories. Please consider using the new version for future projects.
A simplified memory service for Claude that intercepts conversations via MITM proxy and provides memory access through MCP.
Overview
This project provides three core components:
MITM Addon - Intercepts Claude API conversations and stores them in Mem0
MCP Server - Provides tools for Claude to query and manage memories
Reflection Agent - Analyzes conversations to identify patterns and provide insights
Related MCP server: acheron-mcp-server
What This Project IS For
β Core Use Cases
Personal AI Assistant Memory
Give Claude memory of your past conversations
Enable continuity across sessions
Example: "Claude, what was that Docker command we used last week?"
Project Context Persistence
Maintain project-specific knowledge across conversations
Track decisions, approaches, and solutions
Example: Claude remembers your preferred coding style and project structure
Learning and Adaptation
Claude learns your preferences over time
Identifies patterns in your questions and needs
Example: Claude notices you prefer concise answers and adapts accordingly
Development Workflow Enhancement
Remember debugging sessions and solutions
Track what approaches worked or failed
Example: Claude recalls "We tried approach X for this error before, it didn't work because..."
π― Real-World Examples
Example 1: Continuing Work
User: "Let's continue working on that authentication system"
Claude: *searches memories* "I found our previous discussion about JWT authentication.
We were implementing refresh tokens and had decided to store them in HTTP-only cookies..."Example 2: Learning Preferences
Claude: *after analyzing conversations* "I've noticed you prefer functional programming
patterns and often ask about TypeScript. Should I prioritize these in my responses?"Example 3: Debugging History
User: "I'm getting that CORS error again"
Claude: *searches memories* "We encountered this CORS error before with your React app.
The solution was to add the proxy configuration in package.json..."What This Project is NOT For
β Not Designed For
Enterprise Knowledge Management
β Multi-tenant memory isolation with RBAC
β Compliance features (GDPR right-to-be-forgotten, HIPAA, SOC2)
β Complex retention policies and data governance
β Instead: Simple user-based memory storage
Team Collaboration
β Shared memory pools across team members
β Real-time sync between multiple Claude instances
β Collaborative knowledge base editing
β Instead: Personal memory for individual users
Structured Data Systems
β CRM replacement for tracking contacts/customers
β Project management tool with tasks and deadlines
β Documentation platform with versioning
β Instead: Conversational memory storage
High-Performance Requirements
β Sub-millisecond memory retrieval
β Real-time streaming of memories
β High-frequency trading or gaming applications
β Instead: Async cloud-based memory suitable for conversations
Complex Analytics
β Business intelligence dashboards
β Advanced NLP analysis pipelines
β Machine learning model training
β Instead: Simple pattern recognition for conversation insights
π« Anti-Patterns to Avoid
Don't try to use this as a general-purpose database
Don't expect ACID transactions or complex queries
Don't store sensitive data without understanding Mem0's security model
Don't assume memories are instantly available after storage
Features
π― Simple & Focused - Just memory capture and retrieval, no enterprise complexity
π Mem0 SaaS - Uses Mem0's cloud service, no local infrastructure needed
π Memory Search - Natural language search across conversation history
π Reflection Analysis - Identifies patterns and suggests improvements
π οΈ MCP Tools - Direct integration with Claude via MCP protocol
π Memory Resources - Browse memories as MCP resources
Setup
1. Get a Mem0 API Key
Sign up at https://app.mem0.ai and get your API key.
2. Configure Environment
cp .env.example .env
# Edit .env and add your MEM0_API_KEY3. Install Dependencies
uv syncUsage
Running the MITM Proxy
# Start mitmproxy with the memory addon
mitmdump -s memory_addon.pyConfigure your Claude client to use the proxy (typically localhost:8080).
Running the MCP Server
# Start the MCP server
uv run mcp-mitm-mem0Configure Claude Code
Add to your .mcp.json:
{
"mcpServers": {
"memory-service": {
"command": "uv",
"args": ["run", "mcp-mitm-mem0"],
"cwd": "/path/to/mcp-mitm-mem0"
}
}
}MCP Tools
search_memories(query, user_id?, limit?)- Search memories using natural languagelist_memories(user_id?)- List all memories for a useradd_memory(messages, user_id?, metadata?)- Manually add memoriesdelete_memory(memory_id)- Delete a specific memoryanalyze_conversations(user_id?, limit?)- Analyze patterns in recent conversationssuggest_next_actions(user_id?)- Get suggestions based on conversation history
MCP Resources
memory://{user_id}- Browse all memories for a specific usermemory://recent- View the 10 most recent memories
Architecture
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Claude Client ββββββΆβ MITM Proxy ββββββΆβ Anthropic API β
βββββββββββββββββββ ββββββββββ¬βββββββββ βββββββββββββββββββ
β
βΌ
βββββββββββββββββ
β Mem0 SaaS β
βββββββββ²ββββββββ
β
βββββββββββββββββββ βββββββββ΄ββββββββ
β Claude ββββββΆβ MCP Server β
β (via MCP) β β + Reflection β
βββββββββββββββββββ βββββββββββββββββConcrete Use Case Examples
π§ Software Development Assistant
Scenario: Working on a complex refactoring across multiple sessions
Day 1:
User: "I need to refactor the authentication system to use JWT"
Claude: "I'll help you refactor to JWT. Let's start by..."
[Discussion about JWT implementation]
Day 3:
User: "What was our plan for the refresh token rotation?"
Claude: _search_memories("JWT refresh token rotation")_
"From our discussion 2 days ago, we planned to implement refresh token rotation with
a 15-minute access token lifetime and 7-day refresh token lifetime..."π Debug Session Continuity
Scenario: Debugging an intermittent production issue
Week 1:
User: "Production is throwing intermittent 504 errors"
Claude: "Let's investigate. Can you share the logs?"
[Long debugging session]
Week 2:
User: "Those 504 errors are back"
Claude: _analyze_conversations()_
"I see we've encountered this issue before. Last time, we found it correlated with
database connection pool exhaustion during peak hours. We should check if the connection
pool settings we adjusted have reverted..."π Learning & Mentorship
Scenario: Learning a new technology with Claude as a mentor
Session 1:
User: "Can you teach me React hooks?"
Claude: "Let's start with useState..."
Session 5:
Claude: _analyze_conversations()_
"Based on our previous sessions, you've mastered useState and useEffect. You struggled
with useCallback dependencies. Today, let's focus on custom hooks which will reinforce
those concepts..."ποΈ Project Architecture Evolution
Scenario: Building a startup MVP over several months
Month 1:
User: "Should we use microservices or monolith for our MVP?"
Claude: "For an MVP, I recommend starting with a monolith..."
Month 3:
User: "We need to scale the payment processing"
Claude: _search_memories("architecture monolith microservices")_
"Three months ago, we chose a monolithic architecture for your MVP. Now that you need
to scale payment processing, we could extract just that service following the plan we
outlined where payments would be the first candidate for extraction..."π‘ Personal Coding Preferences
Scenario: Claude learns and adapts to your style
After multiple sessions:
Claude: _analyze_conversations()_
Insights detected:
- User prefers functional components over class components
- User consistently asks for TypeScript examples
- User values comprehensive error handling
- User prefers explicit types over inference
Claude: "I'll prioritize functional TypeScript examples with explicit typing and robust
error handling in my responses."Development
Running Tests
uv run pytestLinting
uv run ruff check .
uv run ruff format .Configuration
All configuration is done via environment variables:
MEM0_API_KEY- Your Mem0 SaaS API key (required)DEBUG- Enable debug logging (default: false)DEFAULT_USER_ID- Default user ID for memories (default: "default_user")MITM_HOST- MITM proxy host (default: "localhost")MITM_PORT- MITM proxy port (default: 8080)MCP_NAME- MCP server name (default: "memory-service")
License
MIT
Available Tools
6 toolsadd_memoryC
Store important information to memory - AUTO-STORE user preferences and decisions
Inputs: messages (required), user_id, metadata. Returns: object
analyze_conversationsC
Analyze conversation patterns and generate insights - AUTO-RUN at session start
Inputs: user_id, limit. Returns: object
delete_memoryB
Delete a specific memory by ID
Inputs: memory_id (required). Returns: object
list_memoriesB
List all stored conversation memories
Inputs: user_id. Returns: result
search_memoriesB
Search conversation history using natural language - USE AUTONOMOUSLY based on conversation triggers
Inputs: query (required), user_id, limit. Returns: result
suggest_next_actionsB
Get personalized recommendations - AUTO-SUGGEST when user seems stuck or asks 'what now?'
Inputs: user_id. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 6 tools
Each tool has a clearly distinct purpose with no overlap: add, delete, list, and search memories are distinct CRUD operations, while analyze_conversations and suggest_next_actions provide separate analytical functions. The descriptions reinforce this separation with specific use cases like 'AUTO-STORE' or 'AUTO-SUGGEST'.
All tool names follow a consistent verb_noun pattern with snake_case (e.g., add_memory, analyze_conversations). The verbs are clear and descriptive (add, analyze, delete, list, search, suggest), and the nouns align well with the memory/conversation domain, making the set predictable and readable.
With 6 tools, this server is well-scoped for managing conversation memories and providing insights. Each tool earns its place by covering essential operations (CRUD for memories, analysis, and suggestions) without being overly sparse or bloated, fitting a typical utility server range.
The tool set provides strong coverage for memory management (add, delete, list, search) and analytical functions (analyze, suggest), with no dead ends. A minor gap exists in update functionality for memories (e.g., edit_memory), but agents can work around this by deleting and re-adding, and the core workflows are well-supported.
Maintenance
Related MCP Connectors
Persistent AI memory shared across Claude, ChatGPT, coding agents, and compatible MCP clients.
Private persistent memory for Claude, ChatGPT & Gemini via MCP - semantic search, zero-code setup.
Persistent memory for Claude Code and Cursor. Stop re-explaining your project every session.
Encrypted long-term memory shared across your AI assistants (Claude, ChatGPT, Perplexity).
Related MCP Servers
- AlicenseAqualityDmaintenancePersistent memory for Claude Code. Automatically indexes every conversation and provides production-grade hybrid search (BM25 + vectors + reranker) via MCP tools. 100% local, zero config, zero API keys, zero invoice.1650 npm8MIT
- AlicenseAqualityDmaintenanceCross-surface persistent memory for Claude. Bridges context between Claude Chat, Code, and Cowork via local SQLite with full-text search.613 npm7MIT
- AlicenseAqualityDmaintenanceEnables Claude to remember conversations and learn over time by storing and recalling messages, memory abstracts, and recent history using a local SQLite database.470MIT
- FlicenseNot gradedqualityDmaintenanceA local Mem0 memory system integrated with Anthropic Claude via MCP, enabling persistent memory for AI interactions with vector and graph storage.1-