Skip to main content
Glama

Goxel-MCP

A Model Context Protocol (MCP) server for the Goxel voxel editor. It lets any MCP client (Claude Code, Claude Desktop, Gemini CLI, Codex CLI, and others) create and edit voxel models with tools such as "draw a box", "recolor these voxels", "add a layer", "save" and "export". You can work on files, or edit the scene that is open in Goxel and watch the model change in the editor as you go.

Supercar built with Goxel-MCP, rendered by Goxel

  • 17 tools: scenes, voxels, primitives, regions, colors, layers, preview, save, export, validation, live editing and undo.

  • Reads and writes Goxel's native .gox format, and MagicaVoxel's .vox. Exports .obj/.mtl, .txt and .png natively, plus .gltf, .glb, .ply, .qb, .kv6, .kvx, .vxl and .pov through Goxel's own exporters.

  • Built-in preview renderer: tools return PNG images, so the client can look at the model it is building.

  • Every file written is validated with Goxel's own parser, voxel by voxel, when Goxel is available.

  • Safe by default: all paths stay inside a workspace folder, nothing is overwritten without asking, and backups are made before anything is replaced.

  • Local only: stdio transport, no network services, no accounts.


Contents

  1. How it works

  2. Requirements

  3. Step-by-step setup

  4. Using it

  5. Tools

  6. Conventions

  7. Examples

  8. Safety

  9. Troubleshooting

  10. Development

  11. Limitations

  12. License


Related MCP server: VoxelForge

How it works

 MCP client ──stdio──> goxel-mcp ──┬── file mode: scene in memory, read / written as .gox, .vox, ...
 (Claude Code,                     │
  Gemini CLI, ...)                 └── live mode: Unix socket ──> Goxel editor (command bridge)

File mode works everywhere and needs only Node.js. The scene is kept in memory, and the tools read and write voxel files directly. The server has its own readers and writers for .gox and .vox, written from Goxel's source code.

Live mode edits the scene open in the Goxel editor. It uses the Goxel command bridge: a small local server built into Goxel that listens on a Unix socket (see docs/BRIDGE.md). Before each operation the server reads the scene from Goxel, so edits you make by hand in the editor are kept. It then sends only the changes back, as a single undo step.

The bridge is not part of the official Goxel release yet. scripts/build-goxel.sh builds Goxel from the official sources and adds the bridge from bridge/goxel-mcp-bridge.patch.


Requirements

File mode

Live mode and Goxel exporters

Node.js 20 or newer

required

required

Goxel built with the bridge

–

required (step 3)

macOS

✓

✓

Linux / BSD

✓

✓ (needs scons, pkg-config, GLFW and GTK 3 development packages)

Windows

✓

– (the bridge uses Unix sockets)


Step-by-step setup

1. Get the code

git clone https://github.com/yberudev/Goxel-MCP.git
cd Goxel-MCP

2. Install and build the server

npm install
npm run build

This creates dist/index.js, the MCP server. You can check it with:

npm test

3. Build Goxel with the command bridge (for live mode)

Skip this step if you only want to work with files.

npm run build:goxel

The script:

  1. clones the official Goxel repository into goxel-src/ (or uses GOXEL_SRC=/path/to/goxel if you already have the sources);

  2. copies the sources to goxel-build/ and applies the bridge patch if needed;

  3. builds goxel-build/goxel in release mode.

Nothing is installed globally and sudo is never used. On macOS, missing build tools (SCons, CMake, GLFW) are installed locally in .tools/. On Debian / Ubuntu, install the dependencies first:

sudo apt install scons pkg-config libglfw3-dev libgtk-3-dev

On macOS you can also make a double-clickable application that starts Goxel with the bridge for a given workspace:

sh scripts/make-app.sh /path/to/your/workspace

This creates Goxel MCP.app in the repository folder. The first time you open it, macOS may ask you to confirm that you want to run it.

4. Choose a workspace

The workspace is the only folder the server reads and writes. Your models, exports and previews go there, and the server keeps its backups and the bridge socket in <workspace>/.goxel-mcp/. Set it with the GOXEL_MCP_WORKSPACE environment variable; when the variable is not set, the current directory is used.

5. Register the server with your MCP client

Replace /path/to/Goxel-MCP and /path/to/workspace with your own folders.

Claude Code, for the current project:

claude mcp add --scope project goxel -e GOXEL_MCP_WORKSPACE=/path/to/workspace -- node /path/to/Goxel-MCP/dist/index.js

or add this to .mcp.json at the root of the project:

{
  "mcpServers": {
    "goxel": {
      "type": "stdio",
      "command": "node",
      "args": ["/path/to/Goxel-MCP/dist/index.js"],
      "env": { "GOXEL_MCP_WORKSPACE": "/path/to/workspace" }
    }
  }
}

Claude Desktop: add the same "goxel" entry under "mcpServers" in claude_desktop_config.json.

Gemini CLI: add it to .gemini/settings.json:

{
  "mcpServers": {
    "goxel": {
      "command": "node",
      "args": ["/path/to/Goxel-MCP/dist/index.js"],
      "env": { "GOXEL_MCP_WORKSPACE": "/path/to/workspace" },
      "timeout": 120000
    }
  }
}

Codex CLI:

codex mcp add goxel --env GOXEL_MCP_WORKSPACE=/path/to/workspace -- node /path/to/Goxel-MCP/dist/index.js

or in ~/.codex/config.toml:

[mcp_servers.goxel]
command = "node"
args = ["/path/to/Goxel-MCP/dist/index.js"]
env = { GOXEL_MCP_WORKSPACE = "/path/to/workspace" }
tool_timeout_sec = 180

Any other client: start node /path/to/Goxel-MCP/dist/index.js with the stdio transport.

6. Check the connection

Start a new session of your client. Approve the goxel server if the client asks, then ask:

Call goxel_info.

The answer lists the server version, the Goxel build found, the current mode (file or live) and the supported formats.


Using it

Just describe what you want. For example:

Create a red voxel race car with four black wheels, dark windows and a big rear wing. Put each part on its own layer.

Show me the car from the front and from the side.

Make the rims black.

Save the project as output/car/car.gox and export it for Blender.

Live editing in Goxel

Open output/car/car.gox in Goxel, live.

goxel_open_in_app starts the Goxel build with the bridge and connects to it. If Goxel MCP.app (or goxel --mcp-socket <workspace>/.goxel-mcp/goxel.sock) is already running, the server connects to it automatically when it starts, or when asked with goxel_live {action: "connect"}.

From then on:

  • every editing tool changes the scene open in the editor, and you see the result right away;

  • each tool call is one undo step in Goxel, so Ctrl+Z (⌘Z) reverts it;

  • what you change by hand in the editor is kept, because the server reads the scene before each operation;

  • goxel_save_scene is done by Goxel itself;

  • goxel_render_preview {engine: "goxel"} returns an image rendered by Goxel, with its lighting and shadows.

goxel_live {action: "disconnect"} goes back to file mode and keeps the current scene in memory.

Exporting for Blender

  • OBJ: goxel_export {path: "output/car.obj", scale: 0.1} writes car.obj and car.mtl, one material per color, with hidden faces removed. Blender imports it with File › Import › Wavefront (.obj).

  • glTF: goxel_export {path: "output/car.gltf"} uses Goxel's own glTF exporter, and needs the Goxel build.


Tools

Tool

What it does

goxel_info

Versions, mode, supported formats and capabilities, scene summary

goxel_new_scene

Start an empty scene (the previous one is auto-saved if it had unsaved changes)

goxel_open_scene

Open a .gox, .vox or .txt file (in live mode, in the editor)

goxel_add_voxels

Set up to 200,000 voxels in one call; best for geometry computed by a script

goxel_draw_primitive

Up to 500 shape operations per call: box, sphere / ellipsoid, cylinder (with inner radius), cone, line, points; modes add / remove / paint; clip planes; mirror copies; one layer per operation

goxel_erase_region

Erase by box / shape and / or by color

goxel_recolor_region

Recolor by box / shape and / or by source color, with a tolerance

goxel_transform

Move the voxels of a layer or region

goxel_layers

list, create, delete, rename, set_visible, set_active, duplicate, clear, merge_into

goxel_get_voxels

Scene summary (bounding boxes, colors per layer) and voxel lists

goxel_render_preview

PNG preview: iso, iso_back, front, back, left, right, top; built-in renderer or Goxel's

goxel_save_scene

Save as .gox, with backup and validation

goxel_export

Export to gox, vox, obj, txt, png, and with Goxel to gltf, glb, ply, qubicle, kv6, kvx, vxl, povray

goxel_validate_scene

Check a file and compare it, voxel by voxel, with what Goxel's own parser reads

goxel_open_in_app

Start Goxel with the bridge and switch to live mode (or open the file in the official app)

goxel_live

status, connect, disconnect

goxel_undo

Undo / redo (Goxel's own history in live mode)

All the arguments are described in docs/TOOLS.md. Tips for building detailed models are in docs/MODELING.md.


Conventions

  • Integer coordinates; voxel (x, y, z) fills the cube [x, x+1] × [y, y+1] × [z, z+1].

  • Z is up, like in Goxel. For vehicles and buildings it helps to use +X as the front, Y as the width, and z = 0 as the ground.

  • Colors: "#rrggbb", "#rrggbbaa", [r, g, b], [r, g, b, a], or names such as red, black, silver, glass.

  • Symmetric models: draw one half (y ≥ 0) and add mirror: [{axis: "y", center: -0.5}] (y → −1 − y).

  • Clip planes {point, normal} remove the voxels on the side the normal points to, for slopes, windshields and bevels.


Examples

The examples/ folder has three scripts that build complete models through the MCP tools, with the official MCP client: the same calls an MCP client makes.

node examples/red-sports-car.mjs   # GT sports car built with primitives
node examples/stilt-house.mjs      # stilt house on the water, voxel by voxel
node examples/supercar.mjs         # supercar sculpted from height profiles

They write to output/ inside the current directory, or inside GOXEL_MCP_WORKSPACE when it is set. If Goxel is running with the bridge, the model is drawn live in the editor.

Red sports car

Stilt house


Safety

  • Every path is resolved inside the workspace. .. and symbolic links that point outside of it are refused.

  • Writing into the server's own folders (src/, dist/, goxel-src/, goxel-build/, …) and into .git/ or the clients' configuration folders is refused.

  • Existing files are never replaced without overwrite: true, except the scene's own file when you save it. The previous version is copied to .goxel-mcp/backups/ first. Writes are atomic (temporary file + rename).

  • goxel_new_scene and goxel_open_scene auto-save an unsaved scene before replacing it. Destructive tools can be undone with goxel_undo.

  • Logs go to stderr (GOXEL_MCP_LOG_LEVEL=debug|info|warn|error). Stdout is only used by the MCP protocol.

  • The bridge socket is only accessible by the current user (mode 0600). Goxel opens it only when it is started with --mcp-socket or GOXEL_MCP_SOCKET.


Troubleshooting

Problem

Solution

The goxel tools do not show up

Start a new session of the client after registering the server, and approve it if asked. Check that node /path/to/Goxel-MCP/dist/index.js exists (run npm run build).

goxel_open_in_app times out the first time

macOS may be showing a security prompt for the new Goxel build. Accept it and try again.

A live call times out

A dialog is probably open in Goxel, or another client is connected to the bridge (only one client is served at a time). Close the dialog, or disconnect the other client.

A script cannot connect to the bridge while your client is connected

Same reason: call goxel_live {action: "disconnect"} first, and connect again afterwards.

The official Goxel app does not open the file

The official macOS build ignores files sent by Finder or open. Use File › Open, or the live mode.

glTF / PLY export is not available

Build Goxel with npm run build:goxel, or set GOXEL_MCP_GOXEL_BIN to a Goxel build with the bridge.

Where are the logs?

The server's stderr (your client's MCP log), and <workspace>/.goxel-mcp/goxel-live.log for Goxel.

Environment variables

Variable

Default

Meaning

GOXEL_MCP_WORKSPACE

current directory

Folder for every file operation

GOXEL_MCP_GOXEL_BIN

goxel-build/goxel

Goxel build with the bridge

GOXEL_APP

/Applications/goxel.app, …

Official Goxel app (used with live: false)

GOXEL_MCP_LOG_LEVEL

info

debug, info, warn or error

GOXEL_SRC, GOXEL_REPO, GOXEL_REF

Used by scripts/build-goxel.sh


Development

npm run build                 # compile TypeScript into dist/
npm test                      # unit tests + end-to-end MCP test over stdio
GOXEL_LIVE_TEST=1 npm test    # + live test (opens a Goxel window)

The tests that use the Goxel build (validation, glTF export, live editing) open a Goxel window for a moment. Set GOXEL_MCP_SKIP_GOXEL=1 to skip them.

Path

Content

src/index.ts

MCP server and tool definitions

src/session.ts

File / live modes (pull, edit, push the changes)

src/bridge.ts

Client of the Goxel command bridge

src/operations.ts, src/shapes.ts

Editing operations and shape rasterization

src/formats/

.gox, .vox, .obj and PNG readers / writers

src/render.ts

Software preview renderer

src/workspace.ts

Path sandbox, overwrite protection and backups

bridge/

The command bridge for Goxel (mcp_bridge.c, mcp_bridge.h) and the patch that adds it to Goxel

scripts/

Goxel build and macOS app packaging


Limitations

  • When the server writes a .gox file itself (file mode), it keeps the layers, names, visibility and voxels. Per-layer materials, cameras and lights are not kept. In live mode Goxel saves the file itself, so everything is kept.

  • Clone layers, shape layers and image layers are read as empty layers, with a warning.

  • .vox: node rotations are ignored when reading. Models larger than 256³ are split automatically, and palettes are limited to 255 colors (quantized automatically).

  • The bridge serves one client at a time and is not available on Windows.

  • When Goxel exports through its command line (validation, glTF, …), a window opens for a moment.


License

GPL-3.0-or-later, like Goxel. See LICENSE.

Goxel is developed by Guillaume Chereau: https://github.com/guillaumechereau/goxel

Available Tools

17 tools
goxel_add_voxelsAdd voxelsA

Add (or replace) many individual voxels in a single operation. Best for geometry computed by a script. For shapes use goxel_draw_primitive.

Inputs: voxels (required), color, layer.

goxel_draw_primitiveDraw primitivesA

Apply a list of up to 500 shape operations: box, sphere (or ellipsoid), cylinder (inner_radius for tires and tubes), cone, line (with a thickness) and points. Each operation has a mode: add (create / overwrite), remove (erase) or paint (recolor existing voxels only), an optional layer (created if missing), clip planes (for slopes and bevels) and mirror copies. Operations are applied in order; everything is validated before the scene is modified.

Inputs: operations (required), preview, default_color.

goxel_erase_regionErase regionA
Destructive

Remove the voxels in a region (min/max box and/or shape), optionally only the ones of a given color. Can be undone with goxel_undo.

Inputs: layer, region, tolerance, all_layers, +1 more.

goxel_exportExportA

Export the scene. Native formats: gox, vox, obj, txt, png (obj + mtl is the simplest choice for Blender; vox for MagicaVoxel). With Goxel's own exporters (needs the Goxel build with the bridge): gltf, glb, ply, qubicle, kv6, kvx, vxl, povray (gltf / glb also open in Blender). The format is deduced from the file extension when omitted.

Inputs: path (required), scale, format, validate, +2 more.

goxel_get_voxelsRead voxels / summaryA
Read-only

Scene summary (layers, bounding boxes, most used colors) and, optionally, the list of voxels of a region.

Inputs: list, layer, limit, region.

goxel_infoGoxel / server informationA
Read-only

Server version, Goxel versions (sources, app, bridge binary), mode (file / live), supported formats and a summary of the current scene.

Inputs: no named parameters.

goxel_layersLayersB

Manage layers: list, create, delete, rename, set_visible, set_active, duplicate, clear, merge_into (copy the voxels of the layer into 'target' and delete it).

Inputs: action (required), name, layer, target, +1 more.

goxel_liveLive connectionA

Status of the connection to a running Goxel: status, connect (to a Goxel already started with the bridge), disconnect (back to file mode, keeping the current scene in memory).

Inputs: action (required).

goxel_new_sceneNew sceneA

Create an empty voxel scene. If the current scene has unsaved changes, an autosave is written to .goxel-mcp/backups/ first.

Inputs: layer_name.

goxel_open_in_appOpen in GoxelA

Open the scene in the Goxel editor. live=true (the default when the Goxel build with the bridge is available) starts Goxel with the bridge and switches to live editing: the following tool calls modify the scene open in the editor. live=false tries to open the file in the official Goxel app (no control; that app may need File > Open).

Inputs: live, path, timeout_s.

goxel_open_sceneOpen sceneB

Open an existing voxel file (.gox, .vox, .txt) from the workspace. In live mode the file is opened in the Goxel editor.

Inputs: path (required).

goxel_recolor_regionRecolorA

Change the color of existing voxels in a region and/or of a given color (for example: gray rims -> black).

Inputs: to_color (required), layer, region, tolerance, +2 more.

goxel_render_previewPreviewB
Read-only

Render a PNG image of the scene to check the model visually, and optionally save it. The internal renderer is orthographic and needs no OpenGL; engine='goxel' asks the running Goxel editor (live mode) to render its current view.

Inputs: size, view, engine, save_to, +1 more.

goxel_save_sceneSave project (.gox)A

Save the scene in Goxel's native format (.gox). Without 'path', the current file of the scene is used. Existing files are not replaced without overwrite=true (except the scene's own file); the previous version is always copied to .goxel-mcp/backups/. In live mode Goxel itself writes the file.

Inputs: path, validate, overwrite.

goxel_transformMove voxelsB

Translate the voxels of a layer (or of a region of it) by an integer offset.

Inputs: offset (required), layer, region.

goxel_undoUndo / redoB

Undo (or redo) the last operations. In live mode Goxel's own history is used.

Inputs: redo, steps.

goxel_validate_sceneValidate file / sceneA
Read-only

Check the integrity of a .gox / .vox / .txt file (structure, voxels, colors). When the Goxel build is available, the file is also loaded with Goxel's own parser and compared voxel by voxel. Without 'path', the scene in memory is validated (through a temporary copy).

Inputs: path, use_goxel.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 17 tools

    Disambiguation4/5

    Most tools target clear, distinct operations, and the descriptions actively disambiguate the risky pairs (add_voxels vs draw_primitive, save_scene vs export, erase_region vs draw_primitive remove mode). The main residual overlaps are goxel_open_scene vs goxel_open_in_app and the recolor/erase vs draw_primitive paint/remove modes, which an agent could still mix up.

    Naming Consistency4/5

    All names are snake_case with a uniform goxel_ prefix and mostly follow verb_noun (draw_primitive, save_scene, erase_region). A few are noun-only namespace multiplexers (goxel_layers, goxel_live, goxel_info, goxel_undo), which is a minor deviation but still readable and predictable.

    Tool Count4/5

    17 tools is slightly above the comfortable range but each covers a real facet of voxel editing (scene lifecycle, geometry, layers, render, export, live bridge). A couple of entries (open_scene vs open_in_app, save_scene vs export) could be consolidated, but nothing is obviously filler.

    Completeness4/5

    The surface covers the full lifecycle: create/open, edit (add, draw, erase, recolor), inspect, layers, undo/redo, preview, validate, save and export across many formats. Remaining gaps are notable but workaroundable: goxel_transform only translates (no rotate/scale/mirror as a standalone op), and there is no explicit palette or region copy/paste management.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      C
      quality
      D
      maintenance
      A voxel editor with MCP bridge enabling AI agents to create and edit 3D models, supporting .vox/.obj formats, layers, and a web editor.
      27
      MIT
    • F
      license
      Not graded
      quality
      C
      maintenance
      Enables MCP clients to create and edit pixel art and animations through a local-first editor, sharing the same project, editing commands, and undo history with the GUI.
      -
    • F
      license
      Not graded
      quality
      B
      maintenance
      Enables MCP clients to drive Blockbench Desktop locally for Minecraft model, UV, texture, animation, and export workflows. It provides typed operations, high-level task workflows, native controls, and inspection/verification tools over an authenticated loopback connection.
      3
      -