Memory MCP
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., "@Memory MCPremember we use Postgres for the production database"
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.
Memory MCP — Cross-Tool Project Context & Memory Server
A persistent, shared, selective memory layer for LLM clients (Claude, Cursor, ChatGPT, IDEs), built on the Model Context Protocol.
LLMs forget everything between sessions and across tools, so developers keep re-explaining their stack, project architecture, workflows, and decisions. Pasting old chats does not scale — it overflows the context window, replays past mistakes, leaks secrets, and goes stale the moment a decision changes.
Memory MCP is the brain on top of storage: it extracts durable facts from noisy conversations (like architecture, module responsibilities, workflows, decisions, and stack choices), deduplicates them, resolves conflicts as beliefs change, and surfaces only the handful of relevant facts for the current task — to every connected tool, automatically.
Storing text is the easy 10%. Memory MCP does the hard 90%: extract → dedupe → index → retrieve-the-right-bit → resolve conflicts → expire.
Why Not Just Paste Chats / Read a Flat File?
Problem with paste / flat file | What Memory MCP does |
Doesn't scale — which of hundreds of chats has the context? | Semantic retrieval surfaces the relevant slice, not the whole history |
Long pastes overflow the context window ("lost in the middle") | Token-budgeted packing returns the top few facts, not 50 pages |
Raw chat ≠ knowledge (dead ends, corrections) | Fact extraction & distillation into clean, self-contained facts |
One flat file cross-contaminates projects/tools | Project/tool scoping with a readable-ancestor hierarchy |
Contradictions pile up ("React" then "Vue", "AWS" then "GCP") | Conflict detection supersedes stale beliefs by canonical key |
Facts rot; nothing expires | TTL / staleness handling keeps memory current |
Blind pastes leak secrets/PII | PII-aware filtering + append-only audit log |
Related MCP server: CCCMemory MCP
Architecture
flowchart LR
subgraph Clients["MCP Clients"]
C1[Claude Desktop]
C2[Cursor]
C3[ChatGPT / IDEs]
end
C1 & C2 & C3 -->|MCP Protocol / stdio / SSE| SRV[FastMCP Server<br/>remember · recall · ingest]
SRV --> MM[MemoryManager<br/>orchestrator]
subgraph Write["Write path"]
EX[Fact Extractor] --> PII[PII Filter] --> EMB[Embedder] --> DIS[Distiller<br/>dedup · conflict]
end
subgraph Read["Read path"]
Q[Embed query] --> VS[(Vector Store)] --> RK[Ranker<br/>relevance+recency+importance] --> PK[Token-budget pack]
end
MM --> Write --> VS
MM --> Read
MM --> AUD[(Audit Log)]Every component is designed with a pluggable interface and clean offline defaults, so the entire system runs out-of-the-box with zero configuration and zero API keys — then seamlessly upgrades in place when advanced backends are installed.
Layer | Offline Default | Production Upgrade |
Embeddings |
|
|
Vector store |
| ChromaDB |
Fact extraction | Rule-based patterns + taxonomy | OpenAI / Anthropic LLM |
Quick Start
1. Installation
Clone the repository and install dependencies:
git clone https://github.com/mrunmayeekokitkar/Memory-MCP.git
cd Memory-MCP
# Install core dependencies (lightweight, zero cloud dependencies required)
pip install -r requirements.txt
pip install -e .2. Run the Verification Demo
Walk through the entire 6-stage memory pipeline in your terminal:
python examples/demo.pyThis demonstrates:
Conversation Ingestion & Distillation: Parsing multi-turn dialogue into structured facts.
Conflict Resolution: Changing a belief (e.g., Postgres → MySQL) supersedes old facts automatically.
Hybrid Ranked Recall: Fetching facts scored by relevance, recency, and importance.
PII Masking: Automatic redacting of phone numbers, emails, and credentials.
Scope & Project Isolation: Enforcing boundary checks across different projects.
Immutable Audit Trail: Chronological event logs for enterprise governance.
3. Run the Test Suite
Ensure full test coverage passes locally:
pytest -qConnecting to MCP Clients
Running the Server
Standard I/O (Default for desktop clients like Claude and Cursor):
python -m memmcp.server # or via the console script: memmcpSSE Transport (Network / Remote HTTP transport):
python -m memmcp.server --transport sse --host 127.0.0.1 --port 8000
Claude Desktop Configuration
Add the following to your claude_desktop_config.json:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"memory-mcp": {
"command": "python",
"args": ["-m", "memmcp.server"],
"env": {
"MEMMCP_DATA_DIR": "./.memmcp_data",
"MEMMCP_EMBEDDING_PROVIDER": "hash",
"MEMMCP_VECTOR_BACKEND": "numpy",
"MEMMCP_EXTRACTION_PROVIDER": "rule",
"MEMMCP_PII_POLICY": "redact"
}
}
}
}Restart Claude Desktop, and Memory MCP will appear under the hammer / tools icon.
MCP Tools Exposed to LLMs
Tool | Purpose |
| Store one durable fact (with project scope, importance, conflict key, TTL) |
| Distill a raw dialogue into clean, deduplicated facts |
| Bootstrap memory from a high-level codebase or architecture description |
| Retrieve a structured snapshot of the whole project (grouped by category) |
| Retrieve top relevant facts for a query, constrained to a token budget |
| List active (or superseded/expired) memories in a project scope |
| Edit a memory in place (re-computes embeddings if content changed) |
| Soft-delete a memory by unique ID |
| Cluster and merge near-duplicate facts in a project scope |
Resources exposed:
memmcp://stats: Real-time system statistics and vector index sizes.memmcp://audit: Tail of the security and mutation audit log.
Semantic Project Knowledge Engine
When configured with an LLM backend (openai or anthropic), Memory MCP categorizes and indexes project facts into 8 structured categories:
Identity: User, team, and contributor preferences.
Stack: Technology choices (frameworks, runtime versions, databases).
Project: High-level purpose, architecture, and deployment targets.
Modules: Module boundaries, component interfaces, and responsibilities.
Workflows: CI/CD processes, deployment pipelines, testing routines.
Decisions: Architectural Decision Records (ADRs) and design rationales.
Domain: Project-specific vocabulary and business terminology.
Status: Current milestones, active bugs, and technical debt.
Core Engineering & Algorithms
Hybrid Ranking: Blends vector cosine similarity, half-life recency decay ($e^{-\lambda \Delta t}$), and user-assigned importance into a composite score, dynamically packed to fit token budgets.
Fact Distillation & Conflict Detection: Automatically canonicalizes keys (
user:database,stack:framework). When a contradicting assertion arrives, the engine supersedes prior facts while preserving historical audit records.Privacy & Security: Built-in regex engine with Luhn algorithm validation masks API keys, JWTs, emails, phone numbers, and payment details before data reaches the vector store.
Hierarchical Scoping: Strict project and workspace partitioning prevents context leaks between unrelated projects.
Configuration Reference
Override any setting via .env or system environment variables:
Variable | Default | Description |
|
| Directory where index and audit logs reside |
|
|
|
|
|
|
|
|
|
|
|
|
|
| Weight for semantic similarity |
|
| Weight for freshness |
|
| Weight for caller-assigned importance |
|
| Days until recency score decreases by 50% |
Project Structure
Memory-MCP/
├── src/memmcp/
│ ├── server.py # FastMCP server & tool endpoints
│ ├── memory_manager.py # Core pipeline orchestrator
│ ├── config.py # Environment-driven configuration
│ ├── models.py # Pydantic models & data contracts
│ ├── scoping.py # Project namespace & isolation logic
│ ├── embeddings/ # Pluggable embeddings (Hash, Local, OpenAI)
│ ├── store/ # Vector stores (Numpy, Chroma)
│ ├── retrieval/ # Ranking & token-budget packing
│ ├── extraction/ # Fact extraction, distillation & conflict judge
│ └── privacy/ # PII detection & append-only audit trail
├── tests/ # Pytest test suite (87 tests)
├── examples/ # End-to-end demo and client configurations
├── pyproject.toml # Build system and package metadata
├── requirements.txt # Core dependencies
└── README.md # Project documentationLicense
This project is licensed under the MIT License.
This server cannot be deployed
Maintenance
Related MCP Connectors
- OneLoreOAuthai.onelore
Shared project context for AI agents and teams: docs, tasks, and messages that stay current.
Shared, permission-aware company context for AI agents, with provenance, approvals and audit.
Shared project memory that keeps teammates and AI agents aligned across sessions.
Persistent context for Claude. Your AI always knows your projects and next actions across sessions.
Related MCP Servers
- AlicenseBqualityAmaintenanceProvides a persistent "second brain" for Claude featuring zero-latency hot caching, semantic cold storage, and automatic pattern mining from activity logs. It enables users to store, search, and automatically extract project facts and code patterns for enhanced contextual recall.56128 PyPI14MIT
- AlicenseNot gradedqualityFmaintenanceProvides Claude with long-term memory by indexing conversation history, enabling semantic search, decision tracking, and cross-project search.18 npm29MIT
- AlicenseNot gradedqualityAmaintenanceEnables Claude and other AI agents to store decisions, patterns, and knowledge once and retrieve relevant context automatically across sessions, surviving context limits, restarts, and compaction.6 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables Claude and other AI agents to persistently store, retrieve, and organize decisions, patterns, and knowledge across sessions, so context survives restarts and compaction.6 npmMIT