ClaudeCodeMod

All shelves / MCP servers

MemoryMesh

chemiguel23/memorymesh · 342 stars · TypeScript · MIT

MCP server A knowledge graph server that uses the Model Context Protocol (MCP) to provide structured memory persistence for AI models.

Install

The repo has no one-line install. Follow its README.

Open the repo

Files

README.md

MemoryMesh

MemoryMesh is a knowledge graph server designed for AI models, with a focus on text-based RPGs and interactive storytelling. It helps AI maintain consistent, structured memory across conversations, enabling richer and more dynamic interactions.

The project is based on the Knowledge Graph Memory Server from the MCP servers repository and retains its core functionality.

IMPORTANT

v0.3.0 Update: The MCP SDK has been updated from v1.0.4 to v1.25.2 to comply with the current Model Context Protocol specification (2025-11-25). This is a major update that brings compatibility with the latest MCP clients including Claude Desktop, ChatGPT, Cursor, Gemini, and VS Code. After updating, run npm install to fetch the new dependencies.

Since v0.2.7 the default location of schemas was changed to dist/data/schemas. This location is not expected to change in the future, but if you are updating from a previous version, make sure to move your schema files to the new location.

Quick Links

Overview

MemoryMesh is a local knowledge graph server that empowers you to build and manage structured information for AI models. While particularly well-suited for text-based RPGs, its adaptable design makes it useful for various applications, including social network simulations, organizational planning, or any scenario involving structured data.

Key Features

  • Dynamic Schema-Based Tools: Define your data structure with schemas, and MemoryMesh automatically generates tools for adding, updating, and deleting data.
  • Intuitive Schema Design: Create schemas that guide the AI in generating and connecting nodes, using required fields, enumerated types, and relationship definitions.
  • Metadata for AI Guidance: Use metadata to provide context and structure, helping the AI understand the meaning and relationships within your data.
  • Relationship Handling: Define relationships within your schemas to encourage the AI to create connections (edges) between related data points (nodes).
  • Informative Feedback: Provides error feedback to the AI, enabling it to learn from mistakes and improve its interactions with the knowledge graph.
  • Event Support: An event system tracks operations, providing insights into how the knowledge graph is being modified.

#### Nodes

Nodes represent entities or concepts within the knowledge graph. Each node has:

  • name: A unique identifier.
  • nodeType: The type of the node (e.g., npc, artifact, location), defined by your schemas.
  • metadata: An array of strings providing descriptive details about the node.
  • weight: (Optional) A numerical value between 0 and 1 representing the strength of the relationship, defaulting to 1.

Example Node:

    {
      "name": "Aragorn",
      "nodeType": "player_character",
      "metadata": [
        "Race: Human",
        "Class: Ranger",
        "Skills: Tracking, Swordsmanship",
        "Affiliation: Fellowship of the Ring"
      ]
    }

#### Edges

Edges represent relationships between nodes. Each edge has:

  • from: The name of the source node.
  • to: The name of the target node.
  • edgeType: The type of relationship (e.g., owns, located_in).
{
  "from": "Aragorn",
  "to": "Andúril",
  "edgeType": "owns"
}

#### Schemas

Schemas are the heart of MemoryMesh. They define the structure of your data and drive the automatic generation of tools.

##### Schema File Location

Place your schema files (.schema.json) in the dist/data/schemas directory of your built MemoryMesh project. MemoryMesh will automatically detect and process these files on startup.

##### Schema Structure

File name: [name].schema.json. For example, for a schema defining an 'npc', the filename would be add_npc.schema.json.

  • name - Identifier for the schema and node type within the memory. IMPORTANT: The schema’s name must start with add_ to be recognized.
  • description - Used as the description for the add_<name> tool, providing context for the AI. (The delete and update tools have a generic description)
  • properties - Each property includes its type, description, and additional constraints.
  • property
  • type - Supported values are string or array.
  • description - Helps guide the AI on the entity’s purpose.
  • required - Boolean. If true, the AI is forced to provide this property when creating a node.
  • enum - An array of strings. If present, the AI must choose one of the given options.
  • relationship - Defines a connection to another node. If a property is required and has a relationship, the AI will always create both the node and the corresponding edge.
  • edgeType - Type of the relationship to be created.
  • description - Helps guide the AI on the relationship’s purpose.
  • additionalProperties - Boolean. If true, allows the AI to add extra attributes beyond those defined as required or optional.

##### Example Schema (add_npc.schema.json):

{
  "name": "add_npc",
  "description": "Schema for adding an NPC to the memory" ,
  "properties": {
    "name": {
      "type": "string",
      "description": "A unique identifier for the NPC",
      "required": true
    },
    "race": {
      "type": "string",
      "description": "The species or race of the NPC",
      "required": true,
      "enum": [
        "Human",
        "Elf",
        "Dwarf",
        "Orc",
        "Goblin"
      ]
    },
    "currentLocation": {
      "type": "string",
      "description": "The current location of the NPC",
      "required": true,
      "relationship": {
        "edgeType": "located_in",
        "description": "The current location of the NPC"
      }
    }
  },
  "additionalProperties": true
}

Based on this schema, MemoryMesh automatically creates:

  • add_npc: To add new NPC nodes.
  • update_npc: To modify existing NPC nodes.
  • delete_npc: To remove NPC nodes.

MemoryMesh includes 11 pre-built schemas designed for text-based RPGs, providing a ready-to-use foundation for game development.

##### SchemaManager Tool

MemoryMesh includes a SchemaManager tool to simplify schema creation and editing. It provides a visual interface, making it easy to define your data structures without writing JSON directly.

Dynamic Tools

MemoryMesh simplifies interaction with your knowledge graph through dynamic tools. These tools are not manually coded but are automatically generated directly from your schema definitions. This means that when you define the structure of your data using schemas, MemoryMesh intelligently creates a set of tools tailored to work with that specific data structure.

Think of it like this: You provide a blueprint (the schema), and MemoryMesh automatically constructs the necessary tools to build, modify, and remove elements based on that blueprint.

#### How does it work behind the scenes?

MemoryMesh has an intelligent system that reads your schema definitions. It analyzes the structure you've defined, including the properties of your entities and their relationships. Based on this analysis, it automatically creates a set of tools for each entity type:

  • add_<entity>: A tool for creating new instances of an entity.
  • update_<entity>: A tool for modifying existing entities.
  • delete_<entity>: A tool for removing entities.

These tools are then made available through a central hub within MemoryMesh, ensuring they can be easily accessed and used by any connected client or AI.

In essence, MemoryMesh's dynamic tool system provides a powerful and efficient way to manage your knowledge graph, freeing you to focus on the content and logic of your application rather than the underlying mechanics of data manipulation.

Memory file

By default, data is stored in a JSON file in dist/data/memory.json.

#### Memory Viewer

The Memory Viewer is a separate tool designed to help you visualize and inspect the contents of the knowledge graph managed by MemoryMesh. It provides a user-friendly interface for exploring nodes, edges, and their properties.

##### Key Features:

  • Graph Visualization: View the knowledge graph as an interactive node-link diagram.

Facts

Kind
MCP server
Repo
chemiguel23/memorymesh
Group
Uncategorized
Stars
342
License
MIT
Language
TypeScript
Last push
2026-03-01
Forks
49
Topics
ai, mcp

More on this shelf

  1. 1Everythingmodelcontextprotocol/serversThis MCP server attempts to exercise all the features of the MCP protocol. It is not intended to be a useful server, but rather a test server for builders of MCP clients. It implements prompts, tools, resources, sampling, and more to showcase MCP capabilities.85.8k
  2. 2Fetchmodelcontextprotocol/serversA Model Context Protocol server that provides web content fetching capabilities. This server enables LLMs to retrieve and process content from web pages, converting HTML to markdown for easier consumption.85.8k
  3. 3Gitmodelcontextprotocol/serversA Model Context Protocol server for Git repository interaction and automation. This server provides tools to read, search, and manipulate Git repositories via Large Language Models.85.8k
  4. 4Memorymodelcontextprotocol/serversA basic implementation of persistent memory using a local knowledge graph. This lets Claude remember information about the user across chats.85.8k
  5. 5Sequential Thinkingmodelcontextprotocol/serversAn MCP server implementation that provides a tool for dynamic and reflective problem-solving through a structured thinking process.85.8k
  6. 6Timemodelcontextprotocol/serversA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.85.8k