memory-mesh-mcp is an LM Studio Plugin that wraps the upstream MemoryMesh MCP server behind a lightweight @lmstudio/sdk adapter, exposing MemoryMesh's knowledgeβgraph tools to models running inside LM Studio.
It lets an LM Studio model call MemoryMesh's knowledgeβgraph tools (add_ / update_ / delete_ β¦) while never modifying or copying the upstream source β the original code stays in the MemoryMesh/ subdirectory and can still be updated with git pull.
LM Studio Plugins and MCP servers are two different integration styles:
@lmstudio/sdk, exposes tools the model can call, provides a custom settings UI, and so on.memory-mesh-mcp is the former β an LM Studio Plugin. Because its core is a full set of MCP tools, it's named -mcp. Internally it launches and connects to the upstream MemoryMesh MCP server using StdioClientTransport, then dynamically registers those tools as LM Studio tools (each prefixed with mm_).
Upstream MemoryMesh (CheMiguel23/MemoryMesh) is a knowledgeβgraph server for AI models, focused on textβbased RPGs and interactive storytelling. It keeps an AI's memory consistent and structured across conversations, enabling richer, more coherent interactions. It builds on the Knowledge Graph Memory Server from the MCP servers repo and keeps its core functionality. The latest release is v0.3.0 (compliant with MCP specification 2025β11β25).
This project, memory-mesh-mcp, acts as a thin adapter so that MemoryMesh's MCP tools can be used directly inside LM Studio, without changing or copying the upstream source.
Data defaults to dist/data/memory.json; schemas live in dist/data/schemas/.
Environment: Plugins run on LM Studio's builtβin Node.js
v22.21.1; no separate Node.js install is needed.
The plugin exposes two setting groups β configSchematics (perβchat) and globalConfigSchematics (global) β adjustable from the LM Studio Plugin settings UI.
Perβchat config (configSchematics)
| Field | Type | Default | Description |
|---|---|---|---|
memoryFile | string | ./MemoryMesh/dist/data/memory.json | Path to the memory (JSON) file |
schemasDir | string | ./MemoryMesh/dist/data/schemas | Directory holding .schema.json files |
enabled | boolean | true | Enable/disable all MemoryMesh tools |
Global config (globalConfigSchematics)
| Field | Type | Default | Description |
|---|---|---|---|
mcpServerPath | string | `` (empty) | Absolute path to the MemoryMesh dist/index.js (optional; uses the default location when empty) |
These are adapterβlevel parameters. MemoryMesh's internal settings remain in its own
/config/config.ts(MEMORY_FILE,SCHEMAS_DIR).
After install and enable, every callable tool is exposed with an mm_ prefix (e.g. mm_add_npc, mm_update_npc, mm_delete_location) β a namespace to keep them distinct from other tools in LM Studio. Tool parameters are generated dynamically from the matching schema. Common operations:
add)Call mm_add_npc, supplying fields per add_npc.schema.json:
(If a field is an enum, pick one of the options; required fields are mandatory; a required field with a relationship creates both the node and its edge.)
update)Call mm_update_npc to modify an existing node's attributes or relationships.
delete)Call mm_delete_npc to remove a node.
Error during tool execution [<name>]: <message>).text content into a string for the model; if the result isn't a text array, it's returned as serialized JSON.metadata to record provenance and reliability (e.g. "Source: Tavern gossip", `"Reliability: Low") to handle conflicting information (MemoryMesh uses "last write wins").memory-mesh-mcp itself is an LM Studio Plugin, not a standalone MCP server β it connects to upstream MemoryMesh over the MCP protocol inside LM Studio. If you want to use upstream MemoryMesh as a standalone MCP server (e.g. for Claude Desktop, Cursor, or VS Code), use the upstream project directly:
Then point your MCP client at MemoryMesh/dist/index.js. See MemoryMesh/README.md for the full upstream docs.
Upstream MemoryMesh is a TypeScript MCP server whose architecture is not compatible with the LM Studio Plugin SDK (@lmstudio/sdk). To make MemoryMesh's tools usable in LM Studio while keeping the source updatable via git pull, this project uses a "lightweight adapter" strategy: it does not modify or copy the upstream code. Instead, a thin wrapper built on @lmstudio/sdk calls the upstream MemoryMesh MCP tools.
Data flow: main() registers toolsProvider via withToolsProvider. On the first call, the provider launches node <MemoryMesh>/dist/index.js with StdioClientTransport, connects (Client.connect), calls listTools() to get every tool, then converts each into an LM Studio tool() with an mm_ prefix and a JSONβSchemaβzod parameter mapping. Each tool's implementation calls cachedClient.callTool(...) and formats the return value.
| Path | Role |
|---|---|
manifest.json | Declares the plugin (type: plugin, runner: node), name memory-mesh-mcp |
package.json | Package info; main β dist/index.js; postinstall β node scripts/setup.cjs |
.lmstudio/entry.ts | Compiled entry point: import("../src/index.ts").then(m => m.main(pluginContext)) |
src/index.ts | Named exports toolsProvider, configSchematics, globalConfigSchematics; main() registers each via PluginContext |
src/toolsProvider.ts | Adapter core: connects to MemoryMesh, dynamic tool registration, JSON Schema β Zod mapping, error handling |
src/config.ts | Settings UI (memoryFile, schemasDir, enabled; global ) |
Before publishing, confirm
npm run typecheck,npm run lint,npm run build, andlms devall pass.
For those editing the adapter (not upstream MemoryMesh):
Q: After install, I don't see mm_βprefixed tools.
A: Confirm MemoryMesh/dist/index.js exists and is compiled (scripts/setup.cjs runs automatically); reopen LM Studio and a new chat.
Q: MemoryMesh/ is missing or dist/ is absent.
A: postinstall may have failed due to network/git issues. Check your connection and that git is available, or run manually:
Q: I want to support LM Studio and other MCP clients.
A: memory-mesh-mcp is built for the LM Studio Plugin. For other MCP clients, use upstream MemoryMesh directly (see As a standalone MCP server); both can share the same upstream source.
Q: Will updating upstream lose my memory data?
A: Possibly. Back up MemoryMesh/dist/data before updating.
This adapter project is released under the MIT license (see LICENSE. Its upstream, MemoryMesh, is also MITβlicensed (CheMiguel23/MemoryMesh).
memory-mesh-mcp is an LM Studio Plugin that wraps the upstream MemoryMesh MCP server behind a lightweight @lmstudio/sdk adapter, exposing MemoryMesh's knowledgeβgraph tools to models running inside LM Studio.
It lets an LM Studio model call MemoryMesh's knowledgeβgraph tools (add_ / update_ / delete_ β¦) while never modifying or copying the upstream source β the original code stays in the MemoryMesh/ subdirectory and can still be updated with git pull.
LM Studio Plugins and MCP servers are two different integration styles:
@lmstudio/sdk, exposes tools the model can call, provides a custom settings UI, and so on.memory-mesh-mcp is the former β an LM Studio Plugin. Because its core is a full set of MCP tools, it's named -mcp. Internally it launches and connects to the upstream MemoryMesh MCP server using StdioClientTransport, then dynamically registers those tools as LM Studio tools (each prefixed with mm_).
Upstream MemoryMesh (CheMiguel23/MemoryMesh) is a knowledgeβgraph server for AI models, focused on textβbased RPGs and interactive storytelling. It keeps an AI's memory consistent and structured across conversations, enabling richer, more coherent interactions. It builds on the Knowledge Graph Memory Server from the MCP servers repo and keeps its core functionality. The latest release is v0.3.0 (compliant with MCP specification 2025β11β25).
This project, memory-mesh-mcp, acts as a thin adapter so that MemoryMesh's MCP tools can be used directly inside LM Studio, without changing or copying the upstream source.
Data defaults to dist/data/memory.json; schemas live in dist/data/schemas/.
Environment: Plugins run on LM Studio's builtβin Node.js
v22.21.1; no separate Node.js install is needed.
The plugin exposes two setting groups β configSchematics (perβchat) and globalConfigSchematics (global) β adjustable from the LM Studio Plugin settings UI.
Perβchat config (configSchematics)
| Field | Type | Default | Description |
|---|---|---|---|
memoryFile | string | ./MemoryMesh/dist/data/memory.json | Path to the memory (JSON) file |
schemasDir | string | ./MemoryMesh/dist/data/schemas | Directory holding .schema.json files |
enabled | boolean | true | Enable/disable all MemoryMesh tools |
Global config (globalConfigSchematics)
| Field | Type | Default | Description |
|---|---|---|---|
mcpServerPath | string | `` (empty) | Absolute path to the MemoryMesh dist/index.js (optional; uses the default location when empty) |
These are adapterβlevel parameters. MemoryMesh's internal settings remain in its own
/config/config.ts(MEMORY_FILE,SCHEMAS_DIR).
After install and enable, every callable tool is exposed with an mm_ prefix (e.g. mm_add_npc, mm_update_npc, mm_delete_location) β a namespace to keep them distinct from other tools in LM Studio. Tool parameters are generated dynamically from the matching schema. Common operations:
add)Call mm_add_npc, supplying fields per add_npc.schema.json:
(If a field is an enum, pick one of the options; required fields are mandatory; a required field with a relationship creates both the node and its edge.)
update)Call mm_update_npc to modify an existing node's attributes or relationships.
delete)Call mm_delete_npc to remove a node.
Error during tool execution [<name>]: <message>).text content into a string for the model; if the result isn't a text array, it's returned as serialized JSON.metadata to record provenance and reliability (e.g. "Source: Tavern gossip", `"Reliability: Low") to handle conflicting information (MemoryMesh uses "last write wins").memory-mesh-mcp itself is an LM Studio Plugin, not a standalone MCP server β it connects to upstream MemoryMesh over the MCP protocol inside LM Studio. If you want to use upstream MemoryMesh as a standalone MCP server (e.g. for Claude Desktop, Cursor, or VS Code), use the upstream project directly:
Then point your MCP client at MemoryMesh/dist/index.js. See MemoryMesh/README.md for the full upstream docs.
Upstream MemoryMesh is a TypeScript MCP server whose architecture is not compatible with the LM Studio Plugin SDK (@lmstudio/sdk). To make MemoryMesh's tools usable in LM Studio while keeping the source updatable via git pull, this project uses a "lightweight adapter" strategy: it does not modify or copy the upstream code. Instead, a thin wrapper built on @lmstudio/sdk calls the upstream MemoryMesh MCP tools.
Data flow: main() registers toolsProvider via withToolsProvider. On the first call, the provider launches node <MemoryMesh>/dist/index.js with StdioClientTransport, connects (Client.connect), calls listTools() to get every tool, then converts each into an LM Studio tool() with an mm_ prefix and a JSONβSchemaβzod parameter mapping. Each tool's implementation calls cachedClient.callTool(...) and formats the return value.
| Path | Role |
|---|---|
manifest.json | Declares the plugin (type: plugin, runner: node), name memory-mesh-mcp |
package.json | Package info; main β dist/index.js; postinstall β node scripts/setup.cjs |
.lmstudio/entry.ts | Compiled entry point: import("../src/index.ts").then(m => m.main(pluginContext)) |
src/index.ts | Named exports toolsProvider, configSchematics, globalConfigSchematics; main() registers each via PluginContext |
src/toolsProvider.ts | Adapter core: connects to MemoryMesh, dynamic tool registration, JSON Schema β Zod mapping, error handling |
src/config.ts | Settings UI (memoryFile, schemasDir, enabled; global ) |
Before publishing, confirm
npm run typecheck,npm run lint,npm run build, andlms devall pass.
For those editing the adapter (not upstream MemoryMesh):
Q: After install, I don't see mm_βprefixed tools.
A: Confirm MemoryMesh/dist/index.js exists and is compiled (scripts/setup.cjs runs automatically); reopen LM Studio and a new chat.
Q: MemoryMesh/ is missing or dist/ is absent.
A: postinstall may have failed due to network/git issues. Check your connection and that git is available, or run manually:
Q: I want to support LM Studio and other MCP clients.
A: memory-mesh-mcp is built for the LM Studio Plugin. For other MCP clients, use upstream MemoryMesh directly (see As a standalone MCP server); both can share the same upstream source.
Q: Will updating upstream lose my memory data?
A: Possibly. Back up MemoryMesh/dist/data before updating.
This adapter project is released under the MIT license (see LICENSE. Its upstream, MemoryMesh, is also MITβlicensed (CheMiguel23/MemoryMesh).
name, nodeType, metadata (a string array), and an optional weight (0β1 relationship strength).from, to, and edgeType (e.g. owns, located_in)..schema.json file defines a data structure and drives automatic tool generation. The filename is [name].schema.json, and name must start with add_ (e.g. add_npc).add_<entity>, update_<entity}, and delete_<entity> tools for each entity type. It ships 11 prebuilt schemas for RPGs.@lmstudio/sdk adapter calls the original MemoryMesh; it does not modify or copy MemoryMesh/, preserving git pull updates.listTools() and converts each into an LM Studio tool (with the mm_ prefix).zod parameter schemas that LM Studio can read and validate.postinstall, which clones and builds upstream MemoryMesh automatically β no manual path setup.Open LM Studio, go to the Hub (or use the CLI), and search for **`memory-mesh-mcp``.
Click Install / Add. Via CLI:
Automated install flow: installation triggers the postinstall script in package.json:
scripts/setup.cjs performs (see Porting & development log) the following:
MemoryMesh/ does not exist yet: git clone https://github.com/CheMiguel23/MemoryMesh.git pull to update instead.npm install --ignore-scripts, tsc, tsc-alias, copy schema and data files), placing MemoryMesh/dist/ and MemoryMesh/dist/data/schemas/.After install, confirm the settings in LM Studio's Plugin Settings (below).
Open a new chat; if the model's callable tool list shows mm_βprefixed tools, it worked.
mcpServerPathscripts/setup.cjs | postinstall entry: git clone/git pull + builds upstream MemoryMesh |
dist/ | tsc output (index.js, toolsProvider.js, config.js, β¦) |
MemoryMesh/ | Upstream source (unchanged), updateable via git pull |
toolsProvider.ts does not import @modelcontextprotocol/sdk at the top level; it uses dynamic import() inside the async function to load Client and StdioClientTransport, matching the CJS build output.mapJsonSchemaToZod converts MemoryMesh's JSON Schema (enum, string, number/integer, boolean, array, object, β¦) into zod validators; fields not listed as required are marked optional().cachedClient/cachedTransport are created on the first call and reused, avoiding a child process per tool call.toolsProvider and each tool's implementation are wrapped in try/catch, returning a clear error instead of crashing; debug messages go to console (readable via lms dev / the Hub).postinstall): scripts/setup.cjs runs on plugin install, cloning and building upstream MemoryMesh so dist/ and schemas are in place.This project does not modify or copy upstream MemoryMesh's code. The upstream source lives in the MemoryMesh/ subdirectory:
To update upstream later, enter MemoryMesh/ and run git pull (back up dist/data first to keep your memory data).
The adapter only depends on the built dist/index.js and dist/data/schemas/ of upstream MemoryMesh, so upstream version upgrades won't break this adapter's interface.
{
"name": "Aragorn",
"nodeType": "player_character",
"race": "Human",
"currentLocation": "Rivendell"
}
git clone https://github.com/CheMiguel23/MemoryMesh
cd MemoryMesh
npm install
npm run build
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β LM Studio (Node.js v22.21.1) β
β β
β .lmstudio/entry.ts βββΊ src/index.ts β
β β withToolsProvider β
β βΌ β
β src/toolsProvider.ts β
β β dynamic registration (mm_ prefix)β
β βΌ β
β @lmstudio/sdk (Tool / zod / settings UI) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β StdioClientTransport (spawn node)
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β MemoryMesh (upstream MCP server, unchanged) β
β git clone β installed at /home/sensei/.../MemoryMesh β
β dist/index.js βββΊ listTools / callTool β
β dist/data/schemas/*.schema.json β
β dist/data/memory.json β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# 1. Create / enter the project (scaffolded with `lms create`)
cd /home/sensei/.../memory-mesh-mcp
# 2. Install (triggers postinstall: clone + build upstream MemoryMesh)
npm install
# 3. Typecheck / lint / build
npm run typecheck
npm run lint
npm run build
# 4. Run in LM Studio dev mode
lms dev
# 5. Confirm tools are readable and callable (mm_ prefix)
# 6. Publish to the Hub
lms push
npm install # triggers postinstall: clone + build upstream MemoryMesh
npm run build # tsc β dist/
npm run typecheck # type check
npm run lint # ESLint (eslint src --ext .ts)
lms dev # LM Studio dev mode, live
lms push # package and upload to the LM Studio Hub (use `lms push --private` for private publish)
cd MemoryMesh && npm install --ignore-scripts && npm run build
name, nodeType, metadata (a string array), and an optional weight (0β1 relationship strength).from, to, and edgeType (e.g. owns, located_in)..schema.json file defines a data structure and drives automatic tool generation. The filename is [name].schema.json, and name must start with add_ (e.g. add_npc).add_<entity>, update_<entity}, and delete_<entity> tools for each entity type. It ships 11 prebuilt schemas for RPGs.@lmstudio/sdk adapter calls the original MemoryMesh; it does not modify or copy MemoryMesh/, preserving git pull updates.listTools() and converts each into an LM Studio tool (with the mm_ prefix).zod parameter schemas that LM Studio can read and validate.postinstall, which clones and builds upstream MemoryMesh automatically β no manual path setup.Open LM Studio, go to the Hub (or use the CLI), and search for **`memory-mesh-mcp``.
Click Install / Add. Via CLI:
Automated install flow: installation triggers the postinstall script in package.json:
scripts/setup.cjs performs (see Porting & development log) the following:
MemoryMesh/ does not exist yet: git clone https://github.com/CheMiguel23/MemoryMesh.git pull to update instead.npm install --ignore-scripts, tsc, tsc-alias, copy schema and data files), placing MemoryMesh/dist/ and MemoryMesh/dist/data/schemas/.After install, confirm the settings in LM Studio's Plugin Settings (below).
Open a new chat; if the model's callable tool list shows mm_βprefixed tools, it worked.
mcpServerPathscripts/setup.cjs | postinstall entry: git clone/git pull + builds upstream MemoryMesh |
dist/ | tsc output (index.js, toolsProvider.js, config.js, β¦) |
MemoryMesh/ | Upstream source (unchanged), updateable via git pull |
toolsProvider.ts does not import @modelcontextprotocol/sdk at the top level; it uses dynamic import() inside the async function to load Client and StdioClientTransport, matching the CJS build output.mapJsonSchemaToZod converts MemoryMesh's JSON Schema (enum, string, number/integer, boolean, array, object, β¦) into zod validators; fields not listed as required are marked optional().cachedClient/cachedTransport are created on the first call and reused, avoiding a child process per tool call.toolsProvider and each tool's implementation are wrapped in try/catch, returning a clear error instead of crashing; debug messages go to console (readable via lms dev / the Hub).postinstall): scripts/setup.cjs runs on plugin install, cloning and building upstream MemoryMesh so dist/ and schemas are in place.This project does not modify or copy upstream MemoryMesh's code. The upstream source lives in the MemoryMesh/ subdirectory:
To update upstream later, enter MemoryMesh/ and run git pull (back up dist/data first to keep your memory data).
The adapter only depends on the built dist/index.js and dist/data/schemas/ of upstream MemoryMesh, so upstream version upgrades won't break this adapter's interface.
{
"name": "Aragorn",
"nodeType": "player_character",
"race": "Human",
"currentLocation": "Rivendell"
}
git clone https://github.com/CheMiguel23/MemoryMesh
cd MemoryMesh
npm install
npm run build
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β LM Studio (Node.js v22.21.1) β
β β
β .lmstudio/entry.ts βββΊ src/index.ts β
β β withToolsProvider β
β βΌ β
β src/toolsProvider.ts β
β β dynamic registration (mm_ prefix)β
β βΌ β
β @lmstudio/sdk (Tool / zod / settings UI) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β StdioClientTransport (spawn node)
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β MemoryMesh (upstream MCP server, unchanged) β
β git clone β installed at /home/sensei/.../MemoryMesh β
β dist/index.js βββΊ listTools / callTool β
β dist/data/schemas/*.schema.json β
β dist/data/memory.json β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# 1. Create / enter the project (scaffolded with `lms create`)
cd /home/sensei/.../memory-mesh-mcp
# 2. Install (triggers postinstall: clone + build upstream MemoryMesh)
npm install
# 3. Typecheck / lint / build
npm run typecheck
npm run lint
npm run build
# 4. Run in LM Studio dev mode
lms dev
# 5. Confirm tools are readable and callable (mm_ prefix)
# 6. Publish to the Hub
lms push
npm install # triggers postinstall: clone + build upstream MemoryMesh
npm run build # tsc β dist/
npm run typecheck # type check
npm run lint # ESLint (eslint src --ext .ts)
lms dev # LM Studio dev mode, live
lms push # package and upload to the LM Studio Hub (use `lms push --private` for private publish)
cd MemoryMesh && npm install --ignore-scripts && npm run build
lms add memory-mesh-mcp
"scripts": {
"postinstall": "node scripts/setup.cjs"
}
git clone https://github.com/CheMiguel23/MemoryMesh # run automatically by scripts/setup.cjs on install
lms add memory-mesh-mcp
"scripts": {
"postinstall": "node scripts/setup.cjs"
}
git clone https://github.com/CheMiguel23/MemoryMesh # run automatically by scripts/setup.cjs on install