Claude Memory MCP
A lightweight MCP server that provides Claude Desktop with persistent memory across conversations by storing, summarizing, and retrieving conversation history.
README
π§ Claude Memory MCP
A lightweight Model Context Protocol (MCP) server that gives Claude Desktop persistent memory across conversations. It stores, summarizes, and retrieves conversation history so Claude always remembers your context.
β¨ Features
| Feature | Description |
|---|---|
| Persistent Memory | Saves every conversation turn to a local memory.json file |
| Auto-Summarization | Automatically compresses history after 10 turns to keep context lean |
| Fast Context Loading | Returns summary + last 3 turns on demand β no bloat |
| One-command Setup | Powered by uv β no virtualenv juggling needed |
| Zero Latency | Runs locally over stdio β no network calls |
π οΈ Tools Exposed
| Tool | Description |
|---|---|
get_context |
Load compressed memory (summary + last 3 turns). Call at the start of every conversation. |
save_turn |
Save one conversation turn. Call after every AI response. |
clear_memory |
Wipe all stored memory and start fresh. |
π Quick Start
Prerequisites
- Python 3.13+
uvinstalled
1. Clone & Install
git clone https://github.com/adeeljames/claude-memory-mcp.git
cd claude-memory-mcp
uv sync
2. Run the MCP Server (for testing)
uv run python server.py
3. Add to Claude Desktop
Open your Claude Desktop config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
Add the following under mcpServers:
{
"mcpServers": {
"memory-mcp": {
"command": "uv",
"args": [
"run",
"--directory",
"/absolute/path/to/claude-mcp-optimize",
"python",
"server.py"
]
}
}
}
Replace
/absolute/path/to/claude-mcp-optimizewith the actual path on your machine.
Restart Claude Desktop β the memory-mcp server will appear in your tools list.
π Project Structure
claude-memory-mcp/
βββ server.py # MCP server β all tools defined here
βββ memory.json # Runtime memory file (auto-created, gitignored)
βββ pyproject.toml # uv project config & dependencies
βββ uv.lock # Locked dependency graph
βββ README.md # You are here
βοΈ How It Works
Claude Desktop ββstdioβββΊ server.py βββΊ memory.json
β
ββββββββββββββββββ
β
get_context() β returns summary + last 3 turns
save_turn() β appends to history, triggers summary at 10 turns
clear_memory() β resets everything
π§ Dependencies
| Package | Purpose |
|---|---|
mcp>=1.26.0 |
Model Context Protocol SDK |
All dependencies are managed by uv and pinned in uv.lock.
π License
MIT β free to use, modify, and share.
Made with love by @muhammadadeelai
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.