Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT and other tools is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AI Fire in da houseCheck it out free

mcp-server-memory-file

MCP.Pizza Chef: g0t4

The mcp-server-memory-file is an MCP server designed to replicate ChatGPT-style memory using a simple text file. It enables Claude and other MCP clients to manage inter-chat context by storing, searching, updating, and deleting memory entries line-by-line. This server supports memory operations such as adding new memories, searching for exact substring matches, deleting memories, and listing all stored memories. It facilitates dynamic context retention based on user or assistant interactions, improving conversational continuity and relevance. The server is lightweight and ideal for scenarios requiring persistent, editable memory accessible during chat sessions.

Use This MCP server To

Store conversational context for multi-turn chat continuity Search past memories to recall user details or preferences Update or delete outdated or incorrect memory entries List all stored memories for review or debugging Enable assistants to remember facts across sessions Support tool usage feedback by recording tool call outcomes

README

mcp-server-memory

This is an MCP server to interact with a memory text file to help Claude with inter-chat context.

Each line is a memory.

These tools allow Claude (and other MCP clients) to manage memories mid-chat:

  • memory_add(memory: string) - append the memory
  • memory_search(query: string) - return matching memories (substring exact match) - later, might allow globs/regex
  • memory_delete(query: string) - delete matching memories (substring exact match)
  • memory_list() - return all memories
  • FYI memory_update == memory_delete + memory_add

For example,

  • I mention my name => "talking to Wes"
  • metion daughter's age => "Wes's daughter is 8"
  • say working on a typescript project => "working on typescript project"
  • AND, this is critical, can be based on things Claude (assistant/LLM) says or does...
    • Notably, tool use (i.e. run_command)... say there is a failure on a first attempt to use the tool (i.e. the python command isn't present) and then a subsequent tool use succeeds (i.e. using python3 instead of python) => Claude can record "use python3, python is not present"...
  • I ask Claude to get rid of memories about X => memory_delete(query: X)
  • I correct my name => memory_search("oldname") + memory_delete(each matching record, or a common subset query) + memory_add("newname")

Then, when a new chat begins, Claude will automatically get recent memories (a subset or all) OR can ask for memories (some/more/all). And then can use those to influence responses/tools/etc.

Design

A simple memory text file, why:

  • ChatGPT's memory works well and is essentially a text file
    • Maybe it's structured behind the scenes, however if you review your memory its presented as a text file.
  • My testing of a similar reminders feature for mcp-server-commands worked great (when Claude had them).
  • Unstructured text simplifies the tooling and parameters to basically managing a list of strings.

Cueing mechanism:

  • It's also important to have a cue for the model to know when to store memories. This is a bit more unclear how best to do this but..
  • Training: OpenAI acknowledges some training of models to know when to store memories. Just like models are trained for tool use.
  • Prompt: A system prompt component likely contains a reminder to trigger storing memories.
  • Tool alone: In my testing of Claude, with a tool spec alone, and even with hints/suggestions in tool responses, I couldn't get Claude to store memories. So this alone is not sufficient. Seems like Claude's training with tools is to only use them in pursuit of the prompt/request and thus why I believe adding a reminder/cue in a prompt component will work well.

TODOs/Ideas

I have no idea if these are worth the time, just listing ideas here for the future. Perhaps in part to stop myself from working on them :)

  • Recency factor: a way to rearrange memories based on recency?
    • Order then becomes relevant for ambiguous memory queries (i.e. work on typescript project and python project then I ask to start a new project, could suggest the most recently used one?)
  • Fade out old memories?

mcp-server-memory-file FAQ

How does mcp-server-memory-file store memories?
It stores each memory as a separate line in a text file, allowing easy append, search, delete, and list operations.
Can I update an existing memory entry?
Yes, updating is done by deleting the old memory and adding the new one, effectively replacing it.
Is the memory search case-sensitive or does it support regex?
Currently, memory_search performs exact substring matches; regex or glob support may be added later.
How does this server help Claude or other MCP clients?
It provides persistent, editable memory that clients can use to maintain context across chat turns and sessions.
Can multiple clients access the memory file simultaneously?
The server is designed for single-client interaction; concurrent access handling depends on the deployment environment.
What happens if the memory file grows very large?
Performance may degrade with very large files; periodic pruning or archiving of memories is recommended.
Is this memory storage secure?
Security depends on the hosting environment; the server itself does not encrypt memory data.
Can this memory server be integrated with other LLM providers?
Yes, it is compatible with any MCP client, including Claude, OpenAI GPT, and Anthropic Claude.