Get the FREE Ultimate OpenClaw Setup Guide →

optimized-memory

MCP server from AgentWong/optimized-memory-mcp-server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio agentwong-optimized-memory-mcp-server python -m memory_server

How to use

The optimized-memory MCP server provides a persistent knowledge-graph memory system for Claude-style interactions. It exposes a set of API tools that let you create and manage entities, define relationships between them, and store observations about each entity. Core operations include creating entities, creating relations, adding or deleting observations, and reading or searching the knowledge graph. This enables Claude to remember user-specific details across chats, such as names, preferences, and important events, and to reason about them when responding. Typical workflows involve building a small graph of entities (people, organizations, events), linking them with meaningful relations, and augmenting them with observations over time. The server is designed to be accessed via the provided API endpoints or function calls within an integration layer (e.g., Claude Desktop) that uses the MCP protocol.

How to install

Prerequisites:

  • Python 3.8+ installed on your system
  • Access to the repository with the optimized-memory MCP server
  • Optional: Docker if you prefer containerized deployment

Install and run (direct Python) :

  1. Clone the repository git clone https://github.com/agentwong/optimized-memory-mcp-server.git cd optimized-memory-mcp-server

  2. Install dependencies python -m pip install --upgrade pip if a requirements.txt exists: pip install -r requirements.txt (If no requirements file is provided, install any needed packages per project documentation.)

  3. Run the server python -m memory_server

Containerized option (Docker):

  1. If you prefer Docker, build and run the image (adjust Dockerfile path if needed): docker build -t mcp/memory -f src/memory/Dockerfile . docker run -i --rm mcp/memory

  2. Alternatively, use a prebuilt image via the NPX style if supported by your environment (see README for example usage in Claude Desktop integration).

Additional notes

Tips and tips:

  • The memory graph uses SQLite as a backend; ensure the hosting environment has adequate disk space for growth.
  • When deleting entities, related relations are cascadingly removed – be mindful of data integrity.
  • Use read_graph to verify the current state of memory before performing bulk updates.
  • If you see missing entities during open_nodes, non-existent nodes are silently skipped; always validate IDs before operations.
  • Environment variables (if exposed by your deployment) may include paths to the database, memory size limits, or toggles for persistence modes. Check the project docs for any available options.
  • For Claude Desktop integration, you may expose the server under an mcpServers section with appropriate command/args; you can also use the NPX container pattern if a npm-based runner is preferred.

Related MCP Servers

Sponsor this space

Reach thousands of developers