Skip to main content
Glama
Mesh Repair MCP

Mesh Repair MCP

by alphadl

Mesh Repair MCP

Mesh Repair MCP is a local Model Context Protocol server for repairing 3D triangle meshes. Give an AI agent a Blender object, STL or OBJ file and it can find duplicate faces, remove unused vertices and correct face winding. Each proposed edit has a before-and-after inspection. Accept or reject the proposal; undo an accepted edit to restore the previous geometry.

The same mesh before and after cleanup. A duplicate triangle is hatched and an unused vertex is circled. Both disappear from the candidate.

One extra triangle made three edges look non-manifold. In the pictured example, cleanup removed the duplicate and exposed a closed, inside-out shell. A second edit turned the shell outward. The exported OBJ reopened with four triangles, zero non-manifold edges and the same geometry digest as the accepted revision. Its report still says needs_review: the kernel did not check for self-intersection.

Run your first repair

In the project folder (the directory containing pyproject.toml), use Python 3.10 or newer. On macOS or Linux:

python -m venv .venv
source .venv/bin/activate
python -m pip install .
mesh-repair demo --out-dir first-repair

On Windows PowerShell, create the environment with py -m venv .venv, install with .\.venv\Scripts\python.exe -m pip install ., then run .\.venv\Scripts\mesh-repair.exe demo --out-dir first-repair.

A successful demo creates revision 2 with 4 vertices and 4 triangles. Open first-repair/candidate.obj in a mesh viewer. Read first-repair/report.json for the original diagnostics, accepted edits and outstanding checks. The demo runs without Blender or a model API key.

To try your own STL or geometry-only OBJ, use a new output directory:

mesh-repair run part.stl --out-dir part-review --save-candidate

This command writes part-review/candidate.obj and part-review/report.json. Without --save-candidate, the geometry stays in the session for review. An existing output directory is refused. Choose a new name for a second run, or omit --out-dir to create one automatically.

Your input

How to open it

Available output

STL, plain indexed triangle OBJ, geometry NPZ or mesh JSON

CLI or mesh_open

run --save-candidate writes OBJ. The mesh_export tool also writes NPZ and mesh JSON. STL is input-only.

Saved Blender scene with UVs, materials or multiple objects

blender_open with a local .blend path and a mesh object name

blender_copy writes a new .blend. For a textured OBJ or GLB, first import it into Blender and save the scene.

Related MCP server: bl-mcp

Connect a Blender or mesh agent

Generate an MCP stdio configuration pointing at the demo’s existing session:

mesh-repair mcp-config --workspace first-repair/workspace

Copy the generated server entry into your MCP client's configuration and reconnect. Give the client the session ID from the report and ask:

Inspect this mesh and tell me which defects were fixed. Show the before-and-after counts and explain why it still needs review.

For a saved Blender scene, add --blender /absolute/path/to/blender when generating the configuration. Then try:

Open the object “Housing” in my local housing.blend file. Check its face winding. If an edit is needed, propose it and show me what it changes before accepting it.

Replace the object name and file path with your own. The agent can read a named object, preview the edit and write a new scene containing both the original and the candidate. Blender writeback checks the source file fingerprint before saving. Operate on trusted local assets and use the Blender path when materials, UVs or object structure matter.

Three reproducible cases

Case

What happened

What was checked

Inside-out tetrahedron with a duplicate face

Two accepted edits reduced 5 vertices and 5 triangle rows to 4 of each. Non-manifold edges fell from 3 to 0.

The reopened OBJ matched the accepted geometry digest.

Nested shells around a cavity

The bounds of two shells overlapped. The agent’s orientation proposal was refused because turning both shells outward could change the inner wall’s meaning.

All 8 triangles, the original digest and revision 0 were preserved. The conservative bounds check can also flag disjoint shells.

Blender part with UVs and two materials

In Blender 4.3.2, the repaired copy had 0 inward shells, down from 1. It kept the UV layer Print layout and both material slots.

Per-corner UVs and per-face material assignments were checked during writeback. Both objects were reopened; the source file’s SHA-256 was unchanged.

Run the first two cases with python examples/cases.py case-results. To run all three:

AGENTIC_MESH_BLENDER=/path/to/blender python examples/cases.py case-results-blender --blender

Each command expects a new directory. The case generator and measured results describe synthetic fixtures. Real-asset success rates and model-specific planning quality have not been measured.

What an agent can do

Task

MCP tools

Inspect a file or Blender object

mesh_open, blender_open, mesh_inspect

Preview and decide on an edit

mesh_propose, mesh_accept, mesh_reject

Review history or restore geometry

mesh_trace, mesh_undo

Write a reviewed result

mesh_export, blender_copy

The server exposes 10 tools and 3 geometry operations: compact removes unused vertices, clean also removes degenerate or duplicate indexed faces, and orient fixes winding where the kernel can establish a consistent orientation. Direct file input supports plain triangle OBJ, STL, geometry NPZ and mesh JSON. Hole filling, remeshing and self-intersection certification are outside this release’s scope.

Run mesh-repair tools for machine-readable schemas. See the tool reference, Python API, architecture, migration guide and release checks.

MIT licensed. License · Project lineage.

Tool Schema Changelog

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

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to review 3D models through a browser workbench, letting users mark surfaces with pins and paint and hand the marks back to the agent as precise positions on the mesh.
      9
      Apache 2.0
    • A
      license
      A
      quality
      B
      maintenance
      Enables an AI agent to drive a live Blender session, building, sculpting, measuring, checking, rigging, lighting, rendering and exporting 3D models through safe operations in world units. Every geometry-changing call reports achieved dimensions, open edges and failures as numbers and review images, so modelling mistakes become visible instead of silent.
      113
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Lets an AI assistant check and repair STL/3MF meshes stored on your own computer, reporting holes, flipped faces, inside-out shells, non-manifold edges and duplicate triangles and writing a fixed copy beside the original. Everything runs locally, so the files are never uploaded and the original is never overwritten.
      21 npm
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables LLM agents to inspect, repair, decimate, rescale, and export 3D triangle meshes through MCP tools, returning before/after statistics to guide preparation for real-time scenes.
      MIT