Skip to main content
Glama
adeeljames

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.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description states the destructive action but lacks details on irreversibility or side effects. With no annotations, it carries the full burden; it is minimally adequate but not thorough.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence, no wasted words, front-loaded with the core action. Ideally concise for a simple tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a parameterless destructive tool, the description covers the basic action. However, it omits context like confirmation requirements or scope of memory cleared.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters exist, so the description adds no param semantics. With 100% schema coverage and zero params, a baseline of 4 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Wipe all stored memory and start fresh' uses a specific verb ('wipe') and resource ('stored memory'), clearly distinguishing it from siblings like get_context and save_turn.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool vs alternatives. The description implies a reset action but does not state conditions or contraindications.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_contextA

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

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must fully disclose behavior. It only states it's a read operation returning limited data, but omits side effects, destructive potential, or authentication needs.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences provide complete information with no redundancy: first states function and output, second gives usage instruction. Front-loaded and efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

While adequate for a simple tool with no parameters or output schema, it lacks details on error cases, return structure, and what 'compressed memory' implies, leaving some gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With zero parameters and schema coverage at 100%, the description adds value by explaining the return content, which is beyond the empty schema. Baseline 4 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function: 'Load compressed memory' and specifies output ('Returns summary + last 3 turns only'), distinguishing it from siblings like clear_memory and save_turn.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly instructs to call 'at the START of every conversation', providing clear when-to-use guidance, though it does not exclude when not to use or mention alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

save_turnA

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

ParametersJSON Schema
NameRequiredDescriptionDefault
user_msgYesWhat the user said
ai_responseYesWhat the AI replied

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description bears full responsibility for behavioral disclosure. It explains the action (save to memory) and timing, but does not clarify if it overwrites, appends, or any side effects like memory limits. This is adequate but limited.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, with the purpose front-loaded. Every word serves a purpose, with no redundancy or fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple two-parameter tool with no output schema or nested objects, the description is sufficient. It covers what the tool does, when to call it, and the required parameters. Minor gaps like memory behavior don't significantly hinder comprehension.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with both parameters described in the schema ('What the user said', 'What the AI replied'). The description adds no extra meaning beyond this, achieving baseline for high coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's action ('Save one conversation turn to memory') and specifies the resource ('conversation turn'). It distinguishes itself from siblings (clear_memory, get_context) by focusing on saving turns.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says 'Call this AFTER every response', providing clear timing for use. It does not mention when not to use it or discuss alternatives, but the sibling tools are distinct enough that confusion is unlikely.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 3 tool updatesv0.1.0
    • First observedclear_memory
    • First observedget_context
    • First observedsave_turn

TDQS

A4/5.0
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
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

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.
    18
    1
    MIT
  • F
    license
    Not graded
    quality
    A
    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
    A
    quality
    B
    maintenance
    A persistent memory MCP server for Claude Code that automatically saves conversations and retrieves relevant history across sessions to provide context.
    17
    11
    MIT
  • A
    license
    A
    quality
    C
    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
    20
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/adeeljames/claude-memory-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server