MemoryMesh is a knowledge graph server designed for AI models, with particular emphasis on text-based RPGs and interactive storytelling. It helps maintain consistent, structured memory across conversations by organizing information into nodes and edges, enabling richer and more dynamic interactions.
The easiest way to install MemoryMesh for Claude Desktop is via Smithery:
npx -y @smithery/cli install memorymesh --client claude
git clone https://github.com/CheMiguel23/memorymesh.git
cd memorymesh
npm install
npm run build
Open your Claude Desktop configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
Add an entry for memorymesh
to the mcpServers
section:
"mcpServers": {
"memorymesh": {
"command": "node",
"args": ["/ABSOLUTE/PATH/TO/YOUR/PROJECT/memorymesh/dist/index.js"]
}
}
Replace /ABSOLUTE/PATH/TO/YOUR/PROJECT/
with the actual path to your project directory.
add_npc
, update_npc
, etc.Nodes represent entities within the knowledge graph. Each node has:
npc
, artifact
, location
)Example node:
{
"name": "Aragorn",
"nodeType": "player_character",
"metadata": [
"Race: Human",
"Class: Ranger",
"Skills: Tracking, Swordsmanship",
"Affiliation: Fellowship of the Ring"
]
}
Edges represent relationships between nodes. Each edge has:
owns
, located_in
)Example edge:
{
"from": "Aragorn",
"to": "Andúril",
"edgeType": "owns"
}
Schemas define the structure of your data and drive the automatic generation of tools.
Place schema files (.schema.json
) in the dist/data/schemas
directory. MemoryMesh detects and processes these on startup.
File naming convention: add_[name].schema.json
(e.g., add_npc.schema.json
)
Schema file structure:
add_
)Example schema:
{
"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
}
MemoryMesh automatically generates three tools for each schema:
MemoryMesh includes a SchemaManager tool to simplify schema creation and editing. This visual interface makes it easy to define data structures without writing JSON directly.
The Memory Viewer helps visualize and inspect the knowledge graph contents with features like:
For optimal results, use Claude's "Projects" feature with custom instructions. Example prompt:
You are a helpful AI assistant managing a knowledge graph for a text-based RPG. You have access to the following tools: add_npc, update_npc, delete_npc, add_location, update_location, delete_location, and other tools for managing the game world.
When the user provides input, first process it using your available tools to update the knowledge graph. Then, respond in a way that is appropriate for a text-based RPG.
Server not appearing in Claude:
claude_desktop_config.json
dist
directory contains compiled JavaScript filesTools not showing up:
npm run build
completed without errorsdist/data/schemas
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.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
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.
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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.