I built a self-updating memory system for Claude using a custom MCP server — no more manual context files

Been running a custom MCP server connected to Claude.ai for a few months. The setup works great for structured data queries, but the one weak point was session memory — I had a flat markdown file that stored project context, and I had to update it manually after every working session. It kept drifting.

So I added a single append-only tool to the MCP server called update_context. It takes one argument: a plain text summary of what happened in the session. The tool auto-injects the date and appends a dated entry to the Session History section of the context file. That's it.

Now at the end of every Claude session I just say "log this session" and Claude calls the tool directly. No copy-pasting, no opening files, no forgetting.

The context file loads at the start of every session via a get_context tool, so Claude always has full project history, open TODOs, and doctrine — without RAG, without a vector database, without any additional infrastructure.

The whole thing is about 30 lines of Python on a FastMCP server.

Sometimes the boring solution is the right one. Flat file + append tool beats RAG for 90% of single-project use cases.

Happy to share the implementation if anyone's interested.

Posted Apr 3, 2026, 4:45 PM UTC

10
Loading comments…