nain-mcp-validator
Model Context Protocol · Python 3.11+ · MIT

Let an AI agent check a 3D model, not guess at it.

An agent that generates CAD geometry can read its own output and call it fine. This server gives it measurements instead: deterministic checks on the mesh, a hash to prove the file is the one that was checked, and a verdict that fails closed.

  • MCP 2024-11-05
  • JSON-RPC over stdio
  • Checks C1 to C10
  • No network access

Three tools, each with a strict schema

A client discovers them with tools/list. Every input and output is described by a JSON Schema, so an agent cannot call them loosely.

validate_mesh_invariants

Measure the mesh

Runs checks C1 to C10 on the geometry: closed, manifold, consistently oriented, no degenerate faces. Returns the result of each check, not a summary opinion.

verify_content_digest

Prove it is the same file

Computes the SHA-256 of the data and compares it with the expected hash. A mismatch fails closed, so a report always refers to exact bytes.

generate_conformance_report

Get a verdict you can file

Formats the check results as a standard Markdown audit with an explicit pass or fail gate, ready to attach to a review.

What the checks assert

An asset is rejected if any gate from C1 to C10 fails. These are the ones the requirements document names.

CheckAsserts
C1Buffer integrity: no NaN or infinite coordinates, no orphan vertices.
C2Degenerate faces, counted against a quantum threshold of 10-12 m².
C32-manifold topology: every edge is shared by at most two faces.
C4Watertight closure: zero boundary edges for a closed solid.
C5Outward normals and consistent winding.
C10The Euler-Poincaré invariant: χ = 2 · (bodies − genus).

Why deterministic: the same mesh gives the same verdict every time, on any machine. There is no model in the loop to be persuaded.

Connect it in two minutes

Add the server to the configuration of Claude Desktop, Cursor or any MCP client that launches servers over stdio.

  1. Get the codeClone the repository. It needs Python 3.11 or newer.
  2. Add the serverPaste the snippet into your client's MCP configuration.
  3. Ask for a checkThe agent can now validate a mesh and cite the digest and the verdict.
{
  "mcpServers": {
    "nain-validator": {
      "command": "python",
      "args": ["-m", "nain_mcp_validator.server"],
      "cwd": "/path/to/nain-mcp-validator"
    }
  }
}
# verify the server itself
pytest -v