Get the FREE Ultimate OpenClaw Setup Guide →

mcp -memory-file

Attempt to replicate ChatGPT like memory (text file) for Claude (and other MCP clients)

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio g0t4-mcp-server-memory-file npx -y mcp-server-memory-file

How to use

This MCP server provides a lightweight memory store that reads and writes memories from a simple text file. Each line in the file represents one memory entry. The server exposes tooling like memory_add(memory: string), memory_search(query: string), memory_delete(query: string), memory_list(), and memory_update (an alias for memory_delete followed by memory_add). Claude or other MCP clients can use these tools to persist, retrieve, and prune memories during a chat session. For example, memory_add("Wes's daughter is 8") stores that memory, memory_search("Wes") returns matching memories, and memory_list() returns all stored memories. The model can also record tool usage outcomes (e.g., noting which Python version was used when a tool failed on the first attempt) to influence future responses. When a new chat begins, recent memories can be surfaced automatically or requested by the client to influence responses or tool usage.

How to install

Prerequisites:

  • Node.js (and npm) installed on the host machine.
  • Internet access to fetch packages.

Installation steps:

  1. Verify Node.js and npm are installed:

    • node -v
    • npm -v
  2. Install or update the MCP server package (via npx usage shown, package will be downloaded automatically):

    • Ensure network access to npm registry.
  3. Run the MCP server (example using npx with the package name):

    • npx -y mcp-server-memory-file
  4. Optional: If you prefer to pin a specific version, specify it in the command:

    • npx -y mcp-server-memory-file@1.0.0
  5. Connect an MCP client to the running server as documented by your client; the server will expose the memory tools described in the README.

Additional notes

Tips and notes:

  • This server uses a simple text file as the memory store; consider filesystem permissions and file path defaults when running in containerized or CI environments.
  • If memory_delete/query returns no results, ensure your query matches or try a broader substring. memory_update is equivalent to delete followed by add.
  • For tool usage reliability, you can prepend cue language in prompts to remind Claude when to store or retrieve memories (e.g., after a noteworthy interaction, prompt the model to store a memory).
  • If you want to customize the memory store location or format, check the package options or configuration documentation provided by the mcp-server-memory-file package.
  • Common issues: network restrictions blocking npm registry, conflicting Node versions, or file permission errors when writing the memory file.

Related MCP Servers

Sponsor this space

Reach thousands of developers