Skip to main content
Glama
Claude Memory MCP

Claude Memory MCP

by adeeljames

🧠 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


Related MCP server: mcp-assist-memory

πŸ› οΈ 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+

  • uv installed

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-optimize with 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

Available Tools

3 tools
clear_memoryA

Wipe all stored memory and start fresh.

Inputs: no named parameters.

get_contextA

Load compressed memory. Returns summary + last 3 turns only. Call this at the START of every conversation.

Inputs: no named parameters.

save_turnA

Save one conversation turn to memory. Call this AFTER every response.

Inputs: user_msg (required), ai_response (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool has a distinct, non-overlapping purpose: clearing all memory, retrieving context, and saving a turn. No ambiguity.

    Naming Consistency5/5

    All tool names follow a clear verb_noun pattern with underscores: clear_memory, get_context, save_turn. Fully consistent.

    Tool Count4/5

    With 3 tools, the set is minimal but appropriate for a focused memory management server, covering essential operations. Slightly thin but not problematic.

    Completeness3/5

    Covers basic lifecycle: create (save_turn), read (get_context), delete all (clear_memory). Missing update or selective delete functionality, which may be needed for finer control.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that gives Claude persistent memory by storing conversation context, entities, and enabling semantic search across sessions.
      34 npm
      1
      MIT
    • F
      license
      Not graded
      quality
      C
      maintenance
      An MCP server that provides a shared memory layer for Claude across claude.ai, Claude Code CLI, and Desktop, storing revisioned memory entries, session timelines, handoffs, and uploaded artifacts in SQLite.
      -
    • A
      license
      B
      quality
      C
      maintenance
      A persistent memory MCP server for Claude Code that automatically saves conversations and retrieves relevant history across sessions to provide context.
      17
      67 PyPI
      10
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      A zero-dependency MCP server for cross-session memory recall in Claude Code. Provides lexical search, listing, and retrieval of past session memories to avoid re-explaining context.
      3
      10 npm
      MIT