smlibpy 0.1·python 3.10 – 3.14
smlibpy is a Python library for 3D modeling on SMLib, the NURBS kernel that NVIDIA released as open source this October. It comes with an MCP server, so your agent can build parts too.
agent, look at smlibpy.classcad.ch and install the mcpYour agent finds the steps in /llms.txt. If you only want the library: pip install smlibpy.
Or add it by handClaude Code · Claude Desktop · Codex · VS Code · Cursor · OpenCode
in a terminal
claude plugin marketplace add awv-informatik/smlibpy claude plugin install smlibpy@smlibpy
reads STEPwrites STEP STL glTFMIT + Apache 2.0no account
01Python
Your script builds the model. Each line creates a shape or changes it: combine solids with + and −, round edges, cut a pocket. Hover over a line to see the part at that step.
- from smlibpy import *
- plate = Box(80, 60, 10)
- plate = plate.fillet(plate.edges().parallel_to(Z), 8)
- plate -= GridLocations(60, 40, 2, 2) * Cylinder(4, 10)
- plate -= Rectangle(30, 20).on(plate.faces().top()).extrude(-4)
- plate.export("plate.step")
builds in 22 msvolume 43 040 mm³19 faces · validSTEP with the exact geometry
02Install
There are wheels for Linux, macOS and Windows, for Python 3.10 to 3.14. The kernel is compiled in, so there is nothing else to set up.
In Python
- $ pip install smlibpy
- from smlibpy import *
- part = Box(40, 30, 10) - Cylinder(6, 20)
- print(part.volume)
- part.export("part.step")
- show(part)
show() opens the part in your browser, or inline in a notebook. render() saves a PNG instead, for scripts and CI. Getting started has more.
For your agent
- $ claude plugin marketplace add awv-informatik/smlibpy
- $ claude plugin install smlibpy@smlibpy
The plugin installs the MCP server and a skill with a guide for every function. The server runs on your machine with uvx and opens a viewer that updates after every script. Setup for other hosts is at the top of this page and in the docs.
03How it works
Parts are B-reps with exact surfaces: planes, cylinders, cones, spheres, tori and NURBS. Volumes and areas are integrated over those surfaces, so they are accurate to about seven digits.
smlibpy checks what the kernel returns. If a fillet is too large for its edges, you get an error that tells you the largest size that fits.
smlibpy reads and writes STEP itself and keeps the exact geometry. We compared the reader with OpenCASCADE on 430 files.
The MCP server runs scripts in a separate process. If a script hangs or the kernel crashes, the server restarts it and replays the session.
- Your scriptPython you write, or that an agent writes and runs through the MCP server.
- MCP serverRuns the scripts, keeps the session, shows the live viewer and renders pictures.
- smlibpyShapes, selections, features, result checks, and the STEP reader and writer.
- SMLibThe C++ kernel: topology, Booleans, fillets, offsets, sweeps and mass properties.
04Examples
Each one is a short script in the repository. The drawings and the numbers come from running those scripts.
Pipe flange
A revolved section, eight bolt holes, a fillet and a chamfer.
157 979.5 mm³ · 17 faces · 129 ms
Mounting bracket
An L-profile with rounded edges, holes and countersinks.
31 287.1 mm³ · 19 faces · 27 ms
Spur gear
Involute teeth, a bore and a keyway.
20 291.1 mm³ · 246 faces · 1532 ms
The bottle
The classic OpenCASCADE tutorial part: a filleted body with a neck, shelled to 0.6 mm.
6 946 mm³ · 56 faces · 272 ms
Enclosure
A shelled box with screw bosses, and a lid with a lip.
2 parts · 74 faces · 122 ms
Spring
A circle swept along a helix.
2 170.1 mm³ · 3 faces · 157 ms
Pipe
A bent pipe with two flanges, swept along its path.
29 205.7 mm³ · 21 faces · 180 ms
05smlibpy and ClassCAD
Both use SMLib. ClassCAD has been built on it for twenty years.
ClassCAD
A CAD system.
ClassCAD stores how a part was made. Sketches have constraints and dimensions, and features reference the faces and edges they were built on. When you change a dimension, ClassCAD recalculates only what depends on it.
It also has assemblies with mates, a PDM for versions and releases, and Buerligons, the CAD app in the browser.
history graph · references · constrained sketches · assemblies · PDM · reuse · incremental recalculation
smlibpy
A library.
In smlibpy, a part is what your script produces. Nothing is stored besides the script. To change the part, you edit the script and run it again, which takes milliseconds for most parts.
That works well for variants, batch jobs, notebooks, CI checks and agents. It is also the quickest way to try out SMLib.
scripts · exact geometry · STEP in and out · notebooks · agents
STEP works between the two: a part made with smlibpy opens in ClassCAD as a solid. An agent with both MCP servers can save a part with smlibpy and load it into Buerligons.
06SMLib and OpenCASCADE
OpenCASCADE has been the open-source B-rep kernel for more than twenty years. Now SMLib is open source too. This is how they compare.
| SMLib | OpenCASCADE | |
|---|---|---|
| Where from | A commercial NURBS kernel that has been in production use for decades; ClassCAD has used it for twenty years. NVIDIA released it as open source in usd-brep in October 2026. | Matra Datavision’s CAS.CADE, open source since 1999 and developed by Open Cascade SAS. |
| License | Apache 2.0: you can use, change and ship it, also in closed-source products. | LGPL 2.1 with an exception for linking; changes to OCCT itself stay open. |
| Scope | A modeling kernel: geometry, topology, Booleans, blends, offsets, sweeps, tessellation, healing. | A platform: the kernel plus data exchange, meshing, visualization and an application framework. |
| Geometry | NURBS throughout; planes, cylinders and the other analytic surfaces stay analytic. | Analytic surfaces, B-splines, offsets and more, each with its own algorithms. |
| Fillets | Circular, variable and curvature-continuous (G2, G3) blends. | Rolling-ball fillets, tangent-continuous, constant or variable. |
| Files | None in the kernel. smlibpy reads and writes STEP itself. | STEP, IGES and more, built in. |
| Python | smlibpy, and NVIDIA’s own low-level bindings. | pythonOCC and OCP, with CadQuery and others on top. |
| Around it | New to open source, so far with few users. | A large ecosystem: FreeCAD, KiCad, CadQuery and more. |
We use both. When we compared smlibpy's STEP reader with OpenCASCADE on 430 files, they agreed on 425. Two of the other five were OpenCASCADE errors (it built one spherical face of a CAx-IF test part from the wrong side), and three were problems in the files.
OpenCASCADE is the better choice if you need its file formats, meshing, viewers or the tools built on it. SMLib makes sense if you need a permissive license, or G2 blends in a kernel small enough to ship in your own product.
07Questions
- Is it free?
- Yes. smlibpy is MIT licensed and SMLib comes with it under Apache 2.0. Both allow commercial use.
- Do I need a GPU, a CAD system or an account?
- No. It is a Python package with the kernel compiled in. Pictures are rendered in software, and the viewer is a page in your browser.
- How exact is it?
- The geometry is exact. Triangles only come in when you export a mesh. Volumes, areas and centers are accurate to about seven digits by default, and mass_properties(accuracy=…) can go further.
- Who makes it?
- AWV Informatik in St. Gallen, the people behind ClassCAD, buerli and Buerligons. We have built CAD on SMLib for twenty years.
- Is it ready?
- It is new, version 0.1. Modeling, measuring and STEP work and are tested. Assemblies with constraints, 2D drawings and text are not there yet.