brepjs: TypeScript CAD with agent-checked parts

brepjs

Exact B-Rep geometry in TypeScript with brep verify, an MCP server and a Claude Code plugin: an agent writes and checks a part

  • 142 ★ on the repository
  • Last commit
  • Apache-2.0
Plugin

Minimal access

Why this level

  • The plugin and packages write TypeScript part files and run the check, with no access to the network or system resources beyond the project
  • An agent can derive part dimensions and tolerances wrongly, so check them against the drawing before manufacturing
All reasons and checks

andymai/brepjs

Install

In your terminal, with SkillFoxx CLI

npx skillfoxx add plugins/brepjs

Detects the agents on your machine, shows the access level and pins the version.

Other ways to install

Access and checks

How we review

Minimal accessThe tool runs nothing and makes no network calls.

  • The plugin and packages write TypeScript part files and run the check, with no access to the network or system resources beyond the project
  • An agent can derive part dimensions and tolerances wrongly, so check them against the drawing before manufacturing

This is third-party code. Review the repository files before installing.

What it does

brepjs is an exact solid geometry (B-Rep) library in TypeScript on top of OpenCascade, built so that an agent writes a part as an ordinary TypeScript file and verifies it itself. Shapes are exact boundaries with no triangle meshes, so booleans are precise, measurements are real and export goes to STEP. Verification is `npx brep verify part.brep.ts`: the error returns to the agent, which fixes the part. In the demo session Claude Code reads the official Raspberry Pi 5 drawing, writes the case as a brepjs part, gets an error back, fixes it and adds a fan mount on request. The STEP output opens in FreeCAD. The listed routes are the `brepjs`, `brepjs-cad` and `occt-wasm` npm packages, the `brep-mcp` MCP server and the `brepjs@brepjs` Claude Code plugin with part-authoring skills. An agent rebuilt all 46 parts in the example gallery from descriptions, and all 46 passed verify. Types and `Result<T,E>` prove geometry validity at compile time.

Who it is for. Designers, makers and developers who design enclosures, brackets and fixtures in code and let an agent draw the parts.

Good fit when

  • An enclosure for a board has to be described in code from an official drawing and exported to STEP
  • A part with holes, fillets and chamfers should be built parametrically
  • An agent should receive verification errors and fix the geometry itself
  • A checkable result is needed: real volumes, areas and clearances in place of a mesh
  • You want to attach CAD verification to any MCP client

Not a fit when

  • You need organic sculpting or dense lattices: the library suits exact parts, and such geometry needs field-based methods
  • You need to work without Node.js: the packages target TypeScript and ESM
  • You want a visual editor: a part is described in code
  • You need a mesh model for a game: STEP and B-Rep are not meant for that

Example request

Draw a case for a Raspberry Pi 5 as a brepjs part, check it with brep verify, fix the errors and export to STEP.

Limitations

The library is strong at exact manufacturable geometry: booleans, fillets, chamfers, shells, STEP. It does not suit organic shapes or dense lattices. The `brepjs/quick` module works as ESM and initialises WASM through top-level await.

The geometry kernel is sizeable and loads as WebAssembly. The `brep verify` check confirms that the solid is valid and cannot confirm it matches your intent, so check part dimensions against the drawing. The agent measurement on a 46-part gallery is the author's own and does not replace your checks.

How to disable. Remove the plugin with `/plugin uninstall brepjs` in Claude Code and the packages from the project with `npm uninstall brepjs brepjs-cad occt-wasm`.

FAQ

How do I install brepjs in Claude Code?

Run `/plugin marketplace add andymai/brepjs`, then `/plugin install brepjs@brepjs`. Project packages install with `npm i -D brepjs brepjs-cad occt-wasm`.

What does brep verify check?

`npx brep verify part.brep.ts` builds the part and returns an error if the geometry is invalid. The agent reads the error, edits the file and repeats until it passes.

Does brepjs work without Claude Code?

Yes. Parts are plain TypeScript files and the checker is a CLI, so any agent will do. MCP clients use the `brep-mcp` server.

What format do parts export to?

STEP, which FreeCAD and other CAD programs open. Solids come out watertight and round-trip through STEP.

What can I design?

Enclosures, brackets, fixtures, Gridfinity bins, machined and molded parts, from a single part to an assembly. The library is not built for organic sculpting or dense lattices.

Discussion

No questions or reviews yet.

Plugins
Official

Hosted MCP server for the PartMode browser CAD that lets an agent edit parametric parts, assemblies and drawings

MCP serverExtended access453Repository stars
Official

Bitbybit MCP servers: exact signatures of 2205 CAD functions for an agent and cloud geometry runs on CAD Cloud

MCP serverMinimal access211Repository stars

PartCAD keeps mechanical parts as text, so an agent writes the CAD script, renders the model and checks it against the brief.

PluginExtended access530Repository stars
Official

ClassCAD CAD MCP server: an agent builds parts and assemblies with scripts, views snapshots and saves STEP and STL

MCP serverExtended access185Repository stars

agentcad gives an AI agent 3D design: build123d scripts, STEP export, renders, geometry checks and a live browser preview

CLIExtended access214Repository stars

An MCP server for OpenSCAD: the agent renders parts at a known scale, measures geometry and finds collisions in assemblies

MCP serverExtended access170Repository stars

Comparison with similar tools

Cards that share the main search query, and how they differ.

ToolOfficialAuthenticationRepository starsMain difference
brepjs: TypeScript CAD with agent-checked parts (this card)no142
text-to-cadno26,233turns text into CAD without a type-safe library or verification
FreeCAD MCPnonot required3,310drives the FreeCAD application over MCP, while brepjs has no external application

README in short

The README shows an agent session with a Raspberry Pi 5 case, explains why the library was written and how it builds type-safe geometry. Then come package installation, kernel initialisation, a quick start and an example part with a hole and fillets. A live playground and reference are on the project site.

README badge

Report a problem