
MCP Server Memory File
An MCP server that allows Claude and other LLMs to manage persistent memories across conversations through text file storage, enabling commands to add, search, delete and list memory entries.
g0t4
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 memorymemory_search(query: string)
- return matching memories (substring exact match) - later, might allow globs/regexmemory_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. thepython
command isn't present) and then a subsequent tool use succeeds (i.e. usingpython3
instead ofpython
) => Claude can record "use python3, python is not present"...
- Notably, tool use (i.e.
- 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?
Recommended Servers
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.
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.
Excel MCP Server
A Model Context Protocol server that enables AI assistants to read from and write to Microsoft Excel files, supporting formats like xlsx, xlsm, xltx, and xltm.
Playwright MCP Server
Provides a server utilizing Model Context Protocol to enable human-like browser automation with Playwright, allowing control over browser actions such as navigation, element interaction, and scrolling.
Claude Code MCP
An implementation of Claude Code as a Model Context Protocol server that enables using Claude's software engineering capabilities (code generation, editing, reviewing, and file operations) through the standardized MCP interface.
Apple MCP Server
Enables interaction with Apple apps like Messages, Notes, and Contacts through the MCP protocol to send messages, search, and open app content using natural language.
contentful-mcp
Update, create, delete content, content-models and assets in your Contentful Space
serper-search-scrape-mcp-server
This Serper MCP Server supports search and webpage scraping, and all the most recent parameters introduced by the Serper API, like location.
The Verge News MCP Server
Provides tools to fetch and search news from The Verge's RSS feed, allowing users to get today's news, retrieve random articles from the past week, and search for specific keywords in recent Verge content.
MCP Server Trello
Facilitates interaction with Trello boards via the Trello API, offering features like rate limiting, type safety, input validation, and error handling for seamless management of cards, lists, and board activities.