Server · #107 trending MCP repo · ↗ +63 stars this week

Mesh Repair MCP

alphadl/mesh-repair-mcp

Local MCP server for 3D mesh repair. Inspect Blender, STL and OBJ meshes, preview fixes, and undo edits.

Stars
51
This week
+63
Forks
0
Open issues
0
Last push
7d ago
Star trend · last 2 days+18 ★
Dec 3, 2026: 33 starsDec 4, 2026: 41 starsDec 5, 2026: 51 stars

Get started

Add it to your agent

claude mcp add mesh-repair -- uvx mesh-repair-mcp

Run in your terminal. Add --scope project to share it with your team through .mcp.json.

Documentation

README

View on GitHub ↗

Mesh Repair MCP

Inspect a triangle mesh, try a repair on a copy, then compare it with the original. Run it locally from the command line, from Python, or through a client that supports the Model Context Protocol (MCP). The base installation handles OBJ and STL geometry. Connect Blender to work with scene objects, UV maps and materials.

Run the demo · Connect your MCP client · See the repairs · Browse the tools

Two views of a textured avocado. A strip of the cut surface disappears when back faces are hidden. Correcting the triangle winding restores the strip.

A winding error on a textured mesh. We reversed 88 triangles on Microsoft's Avocado model and rendered it with back-face culling. Correcting their winding brought the conflicting edges from 29 to 0. Writing the corrected indices back into this particular GLB reproduced the original file byte for byte. Reproduce the case and see the model credit

Run your first repair

From a terminal with Python 3.10 or newer, install from source and run the included demo. It needs only Python and NumPy.

git clone https://github.com/alphadl/mesh-repair-mcp.git
cd mesh-repair-mcp
python3 -m venv .venv
source .venv/bin/activate
python -m pip install .
mesh-repair demo --out-dir first-repair

On Windows PowerShell, use py -m venv .venv and .\.venv\Scripts\Activate.ps1 for the environment steps.

Open first-repair/candidate.obj. The tetrahedron looks much the same, but a duplicate triangle and an unused vertex are gone, and its four faces now point outward. In first-repair/report.json, non-manifold edges drop from 3 to 0. The verdict is needs_review because this workflow leaves self-intersection unchecked. Annotated before and after

To try your own STL or geometry-only triangle OBJ, give the run a fresh output directory. The input file stays in place.

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

Connect an MCP client

Run this in the same environment as the demo. It prints the server command, arguments and absolute workspace path. For clients that use mcpServers JSON, copy the entry into your existing settings. For a client with a stdio setup form, enter the printed command and arguments there.

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

Reconnect your client and substitute the session_id from first-repair/report.json in this request.

Inspect session <session_id>. Which defect counts changed? What still needs checking?

For a saved Blender scene, include the path to your Blender executable.

mesh-repair mcp-config --workspace mesh-work --blender /absolute/path/to/blender

If your client uses a setup form, copy the printed Blender environment setting as well. To repair one opening, select the object, inspect its boundary loops, patch the intended loop on a branch and compare with the original. The walkthrough includes the permissions and arguments for each call. Cap one opening · Runnable MCP example

Before and after

These three Blender fixtures isolate common repair decisions. Select an image for a closer look. The gallery includes the input and output OBJs, measurements and commands to reproduce them.

Before / after What changed
A missing band splits a hollow collar. Both walls are bridged and the bore stays open. Bridge two walls. On a hollow collar, joining the outer rim alone would leave the bore unfinished. Bridging both rims took the open-edge count from 96 to 0 and kept the through-hole. Mesh pair
Three small fragments sit beside a mounting tab. After repair only the tab remains. Remove loose pieces. Dropping three known fragments left 1 of 4 components. The mounting tab kept all 192 triangles, including its screw hole. Mesh pair
A dented rectangular panel returns to the flat reference surface. Flatten a dent against a reference. Projecting 47 vertices onto the undamaged panel reduced the deepest dent from 0.42 to 0 model units and kept the triangle layout. Mesh pair

Reproduce the gallery · Choose a runnable example

Repair coverage

For a geometry-only STL or triangle OBJ with duplicate faces, unused vertices or inconsistent winding, start with the CLI demo workflow. For a cap, seam, boolean or local surface edit, use a Blender session and select the affected region. For textured assets, start from the scene object so you can inspect its materials, UV seams and the repaired copy together. Operation guide · Blender attribute guide

A closed mesh can still have the wrong shape. Set the checks you know, such as a target component count, and inspect design features such as through-holes separately. Inspect the result and the coverage of each check before exporting. The Blender benchmark recorded the expected behavior on all 17 synthetic fixtures. Its actual geometry verdicts were 14 needs_review and 3 failed. Success rates on real asset collections are unmeasured. Fixture definitions · Evaluate your own assets

Project guide

MCP tools

The server exposes 43 tools by default. A 44th, mesh_build_from_code, runs trusted Blender Python when explicitly enabled. Each row gives a worked example and the resulting mesh, measurement, file or session record.

Use mesh-repair tools --list to find a tool in the terminal, or mesh-repair tools for the full JSON schemas. A tool can accept several geometry operations. For example, mesh_apply can run fill_patch on Blender. The advanced backends register 28 distinct operations in total. Tool arguments · Geometry operations by backend

Preview an edit · Repair a mesh · Compare versions · Verify and export · Blender scenes

Preview, accept and undo an edit

The mesh examples use the duplicate-face fixture. The Blender example uses a saved part with UVs and two materials. Reproduce the fixtures

Tool Before After
mesh_open A local OBJ contains 5 vertices and 5 triangles. The returned session ID opens the baseline at revision 0.
mesh_inspect The mesh looks like a closed tetrahedron. The report identifies 1 duplicate triangle and 3 non-manifold edges.
mesh_propose The committed mesh has 5 triangles. Preview clean. The candidate has 4 vertices and 4 triangles. Revision 0 still has all 5 triangles. See the edit
mesh_reject A cleanup proposal is pending. The rejection is recorded. Revision 0 retains its original geometry fingerprint.
mesh_accept A fresh cleanup proposal is pending on revision 0. Revision 1 contains 4 triangles and 0 duplicates.
mesh_export The accepted revision is in the workspace. Approve a review copy. Reopening the new OBJ yields the same geometry fingerprint as revision 1.
mesh_undo Revision 1 contains the cleaned mesh. Revision 2 restores all 5 original triangles and their original fingerprint.
mesh_trace A second client opens the session after undo. The history shows open → propose → reject → propose → accept → undo.
blender_open A saved scene contains a mesh named Inspection part. The selected object has a preview session at revision 0. Inspection finds 1 inward-facing shell.
blender_copy The original part faces inward. Its reviewed candidate faces outward. The new .blend contains both objects, with 1 and 0 inward-facing shells respectively. The copy keeps the UV layer and both material slots.

Inspect a file or repair a mesh in a session

The one-shot examples use a mesh with a duplicate face. The session examples follow a three-sided tetrahedral shell through branching, patching and review.

Tool Before After
mesh_file_inspect A NumPy input has 5 triangle rows, including one repeated row. The file report identifies 1 duplicate face and 3 non-manifold edges.
mesh_capabilities An agent needs to know which edits NumPy can run. The catalog gives parameter definitions for its three edits, clean, orient and remove_loose_geometry.
mesh_repair A geometry file has 5 faces including a duplicate. Request cleanup. The output file contains 4 faces and 0 duplicates. Its status is needs_review.
mesh_session_open An NPZ file holds a tetrahedron with one face missing. A new session starts at revision 0 with 3 faces and 3 open boundary edges.
mesh_session_inspect The agent has the parent session ID and needs an edit budget. The report shows revision 0, 3 open boundary edges and 8 attempts remaining.
mesh_elements The opening is visible, but the agent needs its vertex indices. The boundary query returns one complete loop, ordered [0, 2, 3] for this fixture.
mesh_apply The Blender branch has 3 faces and 3 open edges. Run fill_holes. The candidate has 4 faces and 0 open edges. Run the MCP example
mesh_apply_batch The restored shell is open at revision 4. Submit fill_holes and orient together. Both edits commit in one revision (4 → 5). The open-edge count drops from 3 to 0. See another batch on a hollow collar
mesh_explore The shell has been patched. Give the planner two decisions, verify and request_review. The recorded run stops after 2 iterations with reason request_review.

Branch, compare and recover work

Tool Before After
mesh_branch Only the parent holds the open shell at revision 0. A child starts at revision 0 with the same geometry and a shared action budget. The parent remains available.
mesh_compare The parent and the patched branch each have their own inspection. One comparison shows 3 open edges on the parent and 0 on the branch. Its geometric ranking favors the branch.
mesh_restore The child is closed at revision 2. Select its open revision 0. Revision 3 restores the opening. The history retains the intervening repair.
mesh_set_backend The child uses NumPy at revision 0. Select Blender. Blender reinspects the mesh at revision 1. The shared edit budget carries over.
mesh_sessions_list A new client connects to the workspace after the fork. Two entries identify the parent and child, their relationship and their current revisions.
mesh_operation_status Lookup of a fresh operation ID returns unknown. Submit a keyed edit. Looking up the same ID now returns completed and the stored revision-2 response. Recovery example

Render, verify and export a candidate

Tool Before After
mesh_observe The open shell has 3 boundary edges. A three-quarter view highlights 3 polygons.
Open shell with three polygons highlighted
After patching, the same camera and overlay highlight 0 polygons.
Patched shell with no highlighted polygons
mesh_verify Closure is required. The parent is open and the patched branch looks closed. The independent closure check fails on the parent (3 boundary edges) and passes on the branch (0).
mesh_review Revision 2 has no recorded reviewer judgment. Submit approval with a note. The decision is attached to revision 2. The geometry verdict keeps its previous value.
mesh_finalize The fixed task requires a closed shell with 1 component. Finalize the patched branch. Geometric verification passes. The delivery evidence still says needs_review because shape preservation was sampled. How to read the verdict
mesh_session_export The 4-face candidate is at revision 2. Approve a review export. The new NPZ reopens with the same fingerprint. The export is marked candidate_only.
mesh_export_trajectory The parent, branch, edits and observation exist inside the workspace. The ZIP contains 2 sessions, 10 events, 2 geometry snapshots and the observation PNG.
mesh_benchmark Run the healthy_tetra fixture on NumPy to check that valid geometry is preserved. The fixture meets its expected behavior (1/1). The geometry verdict is needs_review.

Work with Blender scenes, attributes and builds

These examples use Blender 4.3.2 with a small test assembly, a pair of objects for attribute transfer and a temporary live bridge.

Tool Before After
blender_import_asset The repaired hollow collar is a stand-alone OBJ. A new .blend contains one mesh with 576 polygons. Inspect the source OBJ
blender_scene_info An assembly file is available, but the agent needs to identify its objects. The report lists 5 mesh objects, including ClosedCube and Cutter.
blender_open_object In the assembly, select ClosedCube, a Blender mesh with 6 quad faces. Its advanced session starts at revision 0 with 8 vertices and 12 triangles.
blender_apply_candidate The assembly has 5 mesh objects. Write back a reviewed cube snapshot. The new scene has 6 mesh objects, including both ClosedCube and ClosedCube_Repaired.
blender_inspect_interactions Two cube objects appear to overlap. Check the selected pair. The report flags 1 object pair and 15 candidate triangle pairs for inspection. The intersections remain unverified.
blender_combine_objects Select the overlapping cubes as operands for a geometry-only boolean difference. A new scene contains the cut mesh Notched with 9 polygons, alongside the original objects.
blender_audit_attributes Check the UV and material layout of AttributeSource. The audit counts 6 UV charts on SourceUV, 12 UV-discontinuous manifold edges and 2 material slots.
blender_transfer_attributes The target has 0 UV layers and 0 material slots. Transfer them from the source. The copy gains SourceUV and 2 material slots. All 96 corners map, the geometry is preserved and the result requests review. Attribute guide
blender_live_result The client has the request ID of a scene query submitted to a live bridge. Looking up that ID recovers the original five-object scene result.
mesh_build_from_code (opt-in) Enable --allow-code-execution and submit a trusted script that creates an assembly. The build completes with a five-mesh .blend, a build ID and a source-code hash.
mesh_builds_list A fresh workspace lists 0 builds. Run the assembly build. Listing again shows 1 completed build and its ID.
mesh_read_build Retrieve the script for a known assembly build ID. The returned source matches all 1,886 characters of the submitted script.