Skip to content

feat(mcp): Add MCP servers for Babylon.js graph editors#18344

Draft
RaananW wants to merge 15 commits intoBabylonJS:masterfrom
RaananW:mcp/graph-servers
Draft

feat(mcp): Add MCP servers for Babylon.js graph editors#18344
RaananW wants to merge 15 commits intoBabylonJS:masterfrom
RaananW:mcp/graph-servers

Conversation

@RaananW
Copy link
Copy Markdown
Member

@RaananW RaananW commented Apr 20, 2026

Summary

Add Model Context Protocol (MCP) servers that expose Babylon.js authoring workflows to MCP-compatible clients (VS Code Copilot, Claude, etc.). Each server manages one Babylon.js subsystem in memory, allowing AI assistants to create, edit, validate, and export graphs through structured tool calls.

Servers

Package Purpose
mcp-server-core Shared helpers — validation, response shaping, schemas
nme-mcp-server Node Material Editor graph authoring with live NME session bridge
nge-mcp-server Node Geometry Editor graph authoring
npe-mcp-server Node Particle Editor graph authoring
nrge-mcp-server Node Render Graph Editor graph authoring
flow-graph-mcp-server Flow Graph visual scripting
gui-mcp-server Babylon.js GUI layout authoring
gltf-mcp-server glTF/glb asset authoring and validation
smart-filters-mcp-server Smart Filters post-processing chains

Architecture

  • All servers are private @tools/* workspace packages under packages/tools/
  • Built with Rollup via shared rollup.config.mcp.mjs, producing standalone dist/index.js with shebang
  • Uses @modelcontextprotocol/sdk and zod/v4 for schema validation
  • Shared helpers extracted into mcp-server-core
  • Each server includes README, unit tests, and example JSON outputs

Also included

  • MCP session UI components added to the Node Editor and Playground
  • .vscode/mcp.json workspace configuration for local testing
  • vitest.config.mts alias path fix for test resolution

Testing

All MCP-specific tests pass (600+ tests across 31 test files). One pre-existing failure in nmeParse.test.ts is caused by a new core shader import (gaussianSplattingVoxel) on master that breaks the deep import chain in vitest — not related to this PR.

Future work

A Scene MCP server (orchestration layer that consumes exported JSON from these servers to produce runnable scenes) will follow in a separate PR once this lands.

Add Model Context Protocol (MCP) servers that expose Babylon.js authoring
workflows to MCP-compatible clients (VS Code Copilot, Claude, etc.).

Servers included:
- mcp-server-core: shared helpers for validation, response shaping, schemas
- nme-mcp-server: Node Material Editor graph authoring with live session bridge
- nge-mcp-server: Node Geometry Editor graph authoring
- npe-mcp-server: Node Particle Editor graph authoring
- nrge-mcp-server: Node Render Graph Editor graph authoring
- flow-graph-mcp-server: Flow Graph visual scripting
- gui-mcp-server: Babylon.js GUI layout authoring
- gltf-mcp-server: glTF/glb asset authoring and validation
- smart-filters-mcp-server: Smart Filters post-processing chains

Each server includes README, unit tests, and example outputs.
Also adds MCP session UI components to the Node Editor and Playground.
@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Apr 20, 2026

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Apr 20, 2026

Reviewer - this PR has made changes to one or more package.json files.

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Apr 20, 2026

Building or testing the playground has failed.

If the tests failed, results can be found here:
https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/18344/merge/testResults/

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Apr 20, 2026

Snapshot stored with reference name:
refs/pull/18344/merge

Test environment:
https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/18344/merge/index.html

To test a playground add it to the URL, for example:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/18344/merge/index.html#WGZLGJ#4600

Links to test your changes to core in the published versions of the Babylon tools (does not contain changes you made to the tools themselves):

https://playground.babylonjs.com/?snapshot=refs/pull/18344/merge
https://sandbox.babylonjs.com/?snapshot=refs/pull/18344/merge
https://gui.babylonjs.com/?snapshot=refs/pull/18344/merge
https://nme.babylonjs.com/?snapshot=refs/pull/18344/merge

To test the snapshot in the playground with a playground ID add it after the snapshot query string:

https://playground.babylonjs.com/?snapshot=refs/pull/18344/merge#BCU1XR#0

If you made changes to the sandbox or playground in this PR, additional comments will be generated soon containing links to the dev versions of those tools.

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Apr 20, 2026

Smart Filters Editor is available to test at:
https://sfe.babylonjs.com/?snapshot=refs/pull/18344/merge

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Apr 20, 2026

You have changed file(s) that made possible changes to the sandbox.
You can test the sandbox snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/SANDBOX/refs/pull/18344/merge/

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Apr 20, 2026

RaananW added 4 commits April 20, 2026 15:26
- Change mcp-server-core imports from dist/index.js to src/index.js so
  vitest can resolve TypeScript source directly without a build step
- Add babylonjs-gltf2interface stub alias to vitest.config.mts (matching
  master) so glTF loader tests can resolve the types-only package
- Replace 20 barrel (directory) imports with direct file imports
- Rename type params to StrictPascalCase (TSchema→Schema, etc.)
- Rename IJsonObject→JsonObject, _parseJsonObject→ParseJsonObject
- Add Async suffix: resolveExternalBuffers→resolveExternalBuffersAsync
- Rename _getNumComponents→_GetNumComponents (static private)
- Add missing JSDoc @param/@returns annotations
- Replace Promise.then with async IIFE in signal handlers
- Merge duplicate core/Misc/gradients imports
@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Apr 20, 2026

Reviewer - this PR has made changes to one or more package.json files.

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Apr 20, 2026

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Apr 20, 2026

Reviewer - this PR has made changes to one or more package.json files.

- Fix className casing to match engine RegisterClass names:
  Csm→Cascaded, Fxaa→FXAA, Ssao2→SSAO2, Ssr→SSR, Taa→TAA
- Add missing blocks: ComputeShaderBlock, IblShadowsRendererBlock,
  PassCubePostProcessBlock
- Update documentation strings with corrected block names
@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Apr 20, 2026

Building or testing the playground has failed.

If the tests failed, results can be found here:
https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/18344/merge/testResults/

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Apr 20, 2026

Snapshot stored with reference name:
refs/pull/18344/merge

Test environment:
https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/18344/merge/index.html

To test a playground add it to the URL, for example:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/18344/merge/index.html#WGZLGJ#4600

Links to test your changes to core in the published versions of the Babylon tools (does not contain changes you made to the tools themselves):

https://playground.babylonjs.com/?snapshot=refs/pull/18344/merge
https://sandbox.babylonjs.com/?snapshot=refs/pull/18344/merge
https://gui.babylonjs.com/?snapshot=refs/pull/18344/merge
https://nme.babylonjs.com/?snapshot=refs/pull/18344/merge

To test the snapshot in the playground with a playground ID add it after the snapshot query string:

https://playground.babylonjs.com/?snapshot=refs/pull/18344/merge#BCU1XR#0

If you made changes to the sandbox or playground in this PR, additional comments will be generated soon containing links to the dev versions of those tools.

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Apr 20, 2026

Smart Filters Editor is available to test at:
https://sfe.babylonjs.com/?snapshot=refs/pull/18344/merge

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Apr 20, 2026

You have changed file(s) that made possible changes to the sandbox.
You can test the sandbox snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/SANDBOX/refs/pull/18344/merge/

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Apr 20, 2026

Flow Graph: add pointer events (Down/Up/Move), physics collision event,
audio sound ended event, physics execution blocks (ApplyForce,
ApplyImpulse, SetLinearVelocity, SetAngularVelocity, SetMotionType),
physics data blocks (GetLinearVelocity, GetAngularVelocity,
GetMassProperties), audio execution blocks (PlaySound, StopSound,
PauseSound, SetVolume), audio data blocks (GetVolume, IsSoundPlaying),
matrix combine/extract blocks (Matrix2D, Matrix3D), and DebugBlock.
Remove stale 'NOT yet implemented' comments for blocks now in core.

NGE: add ExtrudeGeometryBlock to registry.
@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Apr 20, 2026

Reviewer - this PR has made changes to one or more package.json files.

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Apr 20, 2026

Building or testing the playground has failed.

If the tests failed, results can be found here:
https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/18344/merge/testResults/

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Apr 20, 2026

Smart Filters Editor is available to test at:
https://sfe.babylonjs.com/?snapshot=refs/pull/18344/merge

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Apr 20, 2026

You have changed file(s) that made possible changes to the sandbox.
You can test the sandbox snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/SANDBOX/refs/pull/18344/merge/

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Apr 20, 2026

Reviewer - this PR has made changes to one or more package.json files.

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Apr 20, 2026

Smart Filters Editor is available to test at:
https://sfe.babylonjs.com/?snapshot=refs/pull/18344/merge

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Apr 20, 2026

You have changed file(s) that made possible changes to the sandbox.
You can test the sandbox snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/SANDBOX/refs/pull/18344/merge/

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Apr 20, 2026

Building or testing the playground has failed.

If the tests failed, results can be found here:
https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/18344/merge/testResults/

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Apr 20, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Apr 20, 2026

Building or testing the playground has failed.

If the tests failed, results can be found here:
https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/18344/merge/testResults/

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Apr 20, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Apr 20, 2026

RaananW added 3 commits April 20, 2026 20:28
…oaders

These files were inadvertently touched by the workspace-wide lint fix.
Revert them to master to keep the PR scoped to MCP server changes only.
Keep MCP config local — don't impose it on all contributors.
@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Apr 20, 2026

Reviewer - this PR has made changes to one or more package.json files.

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Apr 20, 2026

Smart Filters Editor is available to test at:
https://sfe.babylonjs.com/?snapshot=refs/pull/18344/merge

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Apr 20, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Apr 20, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Apr 20, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Apr 29, 2026

Reviewer - this PR has made changes to one or more package.json files.

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Apr 29, 2026

Smart Filters Editor is available to test at:
https://sfe.babylonjs.com/?snapshot=refs/pull/18344/merge

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Apr 29, 2026

You have changed file(s) that made possible changes to the sandbox.
You can test the sandbox snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/SANDBOX/refs/pull/18344/merge/

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Apr 29, 2026

Building or testing the playground has failed.

If the tests failed, results can be found here:
https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/18344/merge/testResults/

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Apr 29, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Apr 29, 2026

Reviewer - this PR has made changes to one or more package.json files.

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Apr 29, 2026

Smart Filters Editor is available to test at:
https://sfe.babylonjs.com/?snapshot=refs/pull/18344/merge

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Apr 29, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants