Memory Custom MCP server

Provides a knowledge graph-based memory system for creating, managing, and querying structured information with features like custom file paths, timestamping, and advanced search capabilities.
Back to servers
Setup instructions
Provider
Siddhartha Varma
Release date
Mar 03, 2025
Language
TypeScript
Stats
4 stars

This MCP server enhances the standard Memory server with custom memory paths and timestamping capabilities, allowing you to create and manage knowledge graphs that capture interactions via a language model.

Installation

Prerequisites

  • Node.js (version 16 or higher)

Installing via Smithery

The easiest way to install the Knowledge Graph Memory Server is automatically via Smithery:

npx -y @smithery/cli install @BRO3886/mcp-memory-custom --client claude

Manual Installation

If you prefer to install manually:

  1. Clone the repository:

    git clone [email protected]:BRO3886/mcp-memory-custom.git
    cd mcp-memory-custom
    
  2. Install the dependencies:

    npm install
    
  3. Build the project:

    npm run build
    

Configuration

Setting Up the Server

To configure Claude Desktop to use this memory server, update your claude_desktop_config.json or .cursor/mcp.json file:

{
  "mcpServers": {
    "memory": {
      "command": "node",
      "args": ["/path/to/mcp-memory-custom/dist/index.js"]
    }
  }
}

Memory File Path

You can specify different memory file paths for various projects. If not set, the server defaults to using memory.json in the same directory as the script.

System Prompt Configuration

Add these instructions to your system prompt to properly utilize the custom memory features:

Follow these steps for each interaction:
1. The memoryFilePath for this project is /path/to/memory/project_name.json - always pass this path to the memory file operations (when creating entities, relations, or retrieving memory etc.)
2. User Identification:
   - You should assume that you are interacting with default_user
   - If you have not identified default_user, proactively try to do so.

3. Memory Retrieval:
   - Always begin your chat by saying only "Remembering..." and retrieve all relevant information from your knowledge graph
   - Always refer to your knowledge graph as your "memory"

4. Memory
   - While conversing with the user, be attentive to any new information that falls into these categories:
     a) Basic Identity (age, gender, location, job title, education level, etc.)
     b) Behaviors (interests, habits, etc.)
     c) Preferences (communication style, preferred language, etc.)
     d) Goals (goals, targets, aspirations, etc.)
     e) Relationships (personal and professional relationships up to 3 degrees of separation)

5. Memory Update:
   - If any new information was gathered during the interaction, update your memory as follows:
     a) Create entities for recurring organizations, people, and significant events, add timestamps to wherever required. You can get current timestamp via get_current_time
     b) Connect them to the current entities using relations
     c) Store facts about them as observations, add timestamps to observations via get_current_time

Usage

Starting the Server

Run the server with:

node dist/index.js

The server communicates via standard input/output.

Available Tools

The memory server provides several tools that can be called with specific parameters:

Get Current Time

Retrieves the current timestamp for use with memory entries.

Set Memory File Path

Specifies a custom path for storing memory data:

/path/to/memory/project_name.json

Create Entities

Adds new nodes to the knowledge graph.

Create Relations

Establishes connections between entities in the graph.

Add Observations

Attaches properties or facts to entities.

Delete Entities

Removes nodes from the knowledge graph.

Delete Observations

Removes specific properties from entities.

Delete Relations

Removes connections between entities.

Read Graph

Retrieves the entire knowledge graph or specific portions.

Search Nodes

Finds entities matching specific criteria.

Open Nodes

Provides detailed information about specific nodes.

Key Features

Custom Memory Paths

Different projects can have their own dedicated memory files, improving organization and separation of contexts.

Timestamping

All interactions are automatically timestamped, providing chronological context to the knowledge graph.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "memory" '{"command":"node","args":["/path/to/mcp-memory-custom/dist/index.js"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "memory": {
            "command": "node",
            "args": [
                "/path/to/mcp-memory-custom/dist/index.js"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "memory": {
            "command": "node",
            "args": [
                "/path/to/mcp-memory-custom/dist/index.js"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later