Get the FREE Ultimate OpenClaw Setup Guide →

memories-with-lessons

I enhance the existing memory mcp server from the official mcp github, so big thanks and credits for creating this

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio t1nker-1220-memories-with-lessons-mcp-server node /path/to/the/dist/index.js

How to use

This MCP server provides a persistent memory layer implemented as a knowledge graph. It stores entities, observations, and relationships, enabling Claude to remember user-specific details across chats. In addition, it includes a lesson management system to capture errors and proven solutions, helping the agent learn from past mistakes. Core tools include: creating and managing entities and relations, attaching observations to entities, and reading or querying the graph. You can also create, search, and retrieve lessons that document error patterns, environmental context, and verification steps. Use the lesson tools to add, update, and discover solutions with recommendations based on past success rates.

To interact with the server, you’ll typically use the Graph/Memory API endpoints exposed by the MCP server. The create_entities and create_relations tools let you build out the knowledge graph, while read_graph, search_nodes, and open_nodes let you inspect and retrieve data. Observations are atomic notes attached to entities, and lessons are specialized entities (entityType: lesson) that encapsulate error patterns and validated resolutions. The find_similar_errors and get_lesson_recommendations tools help surface relevant lessons when new errors occur, guiding debugging and remediation with historically successful approaches.

How to install

Prerequisites:

  • Node.js (recommended LTS) installed on your machine
  • npm or pnpm for package management
  • Basic familiarity with running Node-based MCP servers

Step-by-step installation:

  1. Clone the repository (or download the release): git clone <repository-url> cd memories-with-lessons

  2. Install dependencies (using pnpm): pnpm install

  3. Build the project (if a build step exists): pnpm build

  4. Run the MCP server:

    Ensure the dist/index.js path matches your build output

    node dist/index.js

  5. Verify the server is up by calling its API or checking logs for a listening message.

Additional notes

Notes and tips:

  • The server stores data in memory.json and lesson.json, with automatic splitting if they exceed 1000 lines for performance. Ensure proper disk space and permissions for file writes.
  • When adding lessons, provide complete errorPattern, metadata, and verificationSteps to enable effective retrieval and recommendations.
  • Use read_graph to fetch the full graph for debugging, and open_nodes to retrieve specific entities and their relations in one call.
  • Environment variables (if any) can be added under the env block in the mcp_config for server-specific configuration (e.g., database paths, memory limits).
  • If you upgrade or modify the server, re-run the build and restart the MCP server to apply changes.

Related MCP Servers

Sponsor this space

Reach thousands of developers