1. Conduid
  2. Blockchain
  3. Brepjs
MCP server · Blockchain

Brepjs

CAD in TypeScript with exact solids (B-Rep). AI agents can write parts with it and check them on OpenCascade.

74Good

Scored 18 hours ago · breakdown

About Brepjs

Brepjs is an MCP server published by andymai in the Blockchain category: cAD in TypeScript with exact solids (B-Rep). AI agents can write parts with it and check them on OpenCascade. Conduid read 29 tools from its source: close_model, compare_models, create_issue, eval_in_session, export_cobie, export_ifc and 23 more. No package is published for it, so it installs from a source checkout.

The repository has 151 stars and 13 forks, is licensed Apache-2.0, and its last commit was on 30 Nov 2026. The latest release is brepjs-v20.28.3 (17 Nov 2026): Bug Fixes brepkit: import each body of a mesh as its own solid or shell (#2728) (26c687c). It follows brepjs-cad-v0.194.1 (17 Nov 2026), and the 5 most recent releases go back to brepjs-v20.28.1 (16 Nov 2026). It passes all 4 static checks Conduid ran on the repository. Its topics include 3d-printing, bim, boundary-representation, brep, cad and csg.

Install

From source
git clone https://github.com/andymai/brepjs

Tools (29)

close_modelClose a session: stop its worker and free its memory. The model's files are not touched.
ParameterTypeDescription
sessionId *any
compare_modelsDiff two sessions' current builds by element identity: ids only in the second are added, ids only in the first are removed, and for each id in both, its prop, pset and quantity changes and whether its geometry, volume or bounds moved. Use it on two revisions of an IFC file (GlobalIds), or two copies of a families program (key paths). Both sessions must be the same kind. Families quantities are derived the way export_ifc writes them, once per build. Lists come ${DIFF_PAGE} entries at a time; pass offset for the rest, with fromBuild and toBuild set to the buildHashes the first page returned so a rebuild between pages is caught rather than shifting them.
ParameterTypeDescription
from *stringThe earlier session.
fromBuildstringThe buildHash "from" must still be at.
limitnumberPage size (default ${DIFF_PAGE}, max ${MAX_DIFF_PAGE}).
offsetnumberPage start (default 0).
quantitiesbooleanCompare families quantity sets too (default true; IFC sessions always do).
timeoutMsnumberBudget for deriving each families session's quantities, in ms (default ${QUANTITY_TIMEOUT_MS}).
to *stringThe later session.
toBuildstringThe buildHash "to" must still be at.
create_issueRaise a BCF 3.0 issue on elements of a session and save it to a .bcf file that BCF tools open (BIMcollab, Solibri, Revit through a BCF add-in, and others). The issue gets one viewpoint: the elements as its selection (by IFC GlobalId), colored orange with the rest shown (focus "highlight") or alone (focus "isolate"), the camera of a render_view-style picture, and that picture as its snapshot, which is also returned. Elements take ids or globs; a container (a storey, a composed family) stands for the elements under it. A families session needs export_ifc first, since issues name the GlobalIds of the IFC file you share. If outPath is already a BCF file, the issue is added to it and its other topics are kept; overwrite: true starts a new file instead.
ParameterTypeDescription
assignedTostringUsually an email address.
authorstringWho raised it, usually an email address (default "brep-mcp").
commentstringA first comment on the viewpoint.
descriptionstring
dueDatestringISO 8601.
elementsarrayUp to ${MAX_ELEMENTS} ids or globs. Omit for an issue on the model as a whole.
expectBuildany
focusstringDefault highlight.
labelsarray
outPath *stringThe .bcf (or .bcfzip) file to write; relative paths resolve against the server cwd.
overwritebooleanReplace outPath with a new file holding only this issue.
prioritystring
sessionId *any
statusstringDefault "Open".
timeoutMsnumberRender budget in ms (default ${RENDER_TIMEOUT_MS}, max ${MAX_TIMEOUT_MS}).
title *string
topicTypestringDefault "Issue".
viewstringDefault iso.
eval_in_sessionRun TypeScript against a session's live build, in its worker, and return the JSON result. The code is the body of an async function that receives ctx: { kind, brep (the brepjs namespace), records, record(id), model }. For a families session model is { root (the resolved tree), byKeyPath (each element's mesh and B-rep shape) }; for an IFC session it is the imported model. Return a JSON-serializable value; console output comes back as logs. There are no imports: use ctx.brep. Use it for questions the other tools can't answer, such as a measurement between two elements. The code runs with the server's own permissions, which is why the tool is listed only when brep-mcp starts with --allow-code. A timeout stops the session's worker, so rebuild before using the session again.
ParameterTypeDescription
code *stringFunction body, e.g. "return ctx.records.filter((r) => r.category === 'wall').length;"
expectBuildany
sessionId *any
timeoutMsnumberBudget in ms (default ${EVAL_TIMEOUT_MS}, max ${MAX_TIMEOUT_MS}).
export_cobieWrite a families session's COBie 2.4 handover data, derived by brepjs-bim from the same BIM projection export_ifc writes: one CSV per sheet (Contact, Facility, Floor, Space, Zone, Type, Component, System, Attribute) in outDir, or one cobie.json. Returns the rows per sheet. Use the same project as export_ifc so names and GlobalIds match. If any file exists you are asked once before they are replaced; clients that cannot ask need overwrite: true. IFC sessions cannot be exported.
ParameterTypeDescription
contactobjectThe Contact sheet row (email is its key).
expectBuildany
formatstringDefault csv.
outDir *stringDirectory for the files; relative to the server cwd.
overwritebooleanReplace existing files without asking.
projectobjectIfcProject name and id, as for export_ifc.
sessionId *any
timeoutMsnumberBudget in ms (default ${COBIE_TIMEOUT_MS}, max ${MAX_TIMEOUT_MS}).
export_ifcWrite a families session's current build to an .ifc file through brepjs-bim's validated export (referential integrity, schema, and a write-read-write round trip). Returns the validation report with each issue mapped to a key path, the elements exported as IfcBuildingElementProxy because no IFC type matched, and the GlobalId of every exported key path (the first 500 here; after an export, get_elements reports each element's GlobalId and accepts GlobalIds as ids). GlobalIds are scoped by the project id, which defaults to the nearest package.json name, so keep it the same across exports. If outPath exists you are asked before it is replaced; clients that cannot ask need overwrite: true. IFC sessions cannot be exported.
ParameterTypeDescription
expectBuildany
outPath *stringWhere to write the file, ending in .ifc; relative paths resolve against the server cwd.
overwritebooleanReplace an existing file without asking.
projectobjectIfcProject name, id and description. projectId defaults to the name.
proxiesbooleanExport elements without an IFC route as IfcBuildingElementProxy (default true). false makes them fail the export.
sessionId *any
timeoutMsnumberExport budget in ms (default ${EXPORT_TIMEOUT_MS}, max ${MAX_TIMEOUT_MS}).
export_partBuild a brepjs part in the sandbox and export it to a directory (STEP/GLB/STL). Use this to hand off the final artifact once a part verifies.
get_diffPage through the diff from the session's last successful rebuild, the one that produced its current build. Use it when a rebuild result sets nextOffset: each page holds the same slice of the added, removed and changed lists.
ParameterTypeDescription
expectBuildany
limitnumberPage size (default ${DIFF_PAGE}, max ${MAX_DIFF_PAGE}).
offsetnumberPage start (default 0).
sessionId *any
get_elementsFull data for elements by id (key path or GlobalId; for a families session, a GlobalId from the last export_ifc works too): identity (name, type, archetype, category, storey, parent, the GlobalId an export assigned, and for families the source file and line that author the element), props, psets, quantities, material, classification, relationships (Contains, Voids, Fills), children, and geometry (hasGeometry, geometryHash, bounds in mm, volume in mm³). Pass fields to return only some groups; identity is always included.
ParameterTypeDescription
expectBuildany
fieldsarrayGroups to include (default all). Pass [] for identity only.
ids *arrayUp to ${MAX_IDS} ids.
sessionId *any
get_spacesList a session's spaces (IfcSpace, or a families Space) with name, storey, floor area, perimeter and volume measured from each space's solid (its outline cut 10 mm above its floor), the outline itself as plan points in mm, and the base quantities the IFC data records for it, so measured and recorded areas can be compared. Families quantities come from an in-memory IFC export, as export_ifc writes them. Areas in m², volumes in m³.
ParameterTypeDescription
expectBuildany
outlinesbooleanInclude each outline as points (default true).
sessionId *any
storeystringOnly the spaces of this storey (id or name).
timeoutMsnumberBudget in ms (default ${SPACES_TIMEOUT_MS}, max ${MAX_TIMEOUT_MS}).
get_viewer_selectionWhat is selected in the session's viewer: the elements the user last clicked, or the agent last selected, by id (key path or GlobalId), with when it changed.
ParameterTypeDescription
sessionId *any
list_schedulable_fieldsList the fields a selection of elements carries, for building a schedule: the built-ins (id, name, category, family, storey, predefinedType, volume), every props.<path>, psets.<Set>.<Prop> and quantities.<Set>.<Prop>, each with its type and how many of the elements have it. Families sessions get their quantities from an in-memory IFC export, so they match what export_ifc writes; pass quantities: false to skip that.
ParameterTypeDescription
expectBuildany
quantitiesbooleanInclude quantity sets (default true).
sessionId *any
whereany
list_sessionsList open sessions with their source path, buildHash and element count. A session is stale when its source files changed on disk since the last build; call rebuild to pick the edits up.
open_modelOpen a BIM model as a session: a brepjs-families program (a .tsx or .ts module whose default export is an element tree) or an .ifc file. The model is built in a sandboxed worker, like `brep preview` would, and the result gives a sessionId, a buildHash, and element counts by category, storey and family. Families elements are addressed by key path (for example ground/south/voids:entry), IFC elements by GlobalId. Type errors fail the build unless typecheck is false.
ParameterTypeDescription
path *stringPath to the program or .ifc file, absolute or relative to the server cwd.
timeoutMsany
typecheckbooleanType-check a families program before running it (default true).
plan_viewDraw one storey's plan: every element of the storey that the horizontal cut plane crosses (1200 mm above the storey's floor, or cutHeight) is drawn heavy on a CUT-<category> layer, and what lies below the cut thin on BEYOND, by hidden-line projection, so nearer elements hide farther ones. Openings and spaces are not drawn. Coordinates are model millimetres, x east and y north. Returns a PNG preview after a text digest of the elements cut and drawn, and saves the drawing as SVG, DXF or PNG when outPath is given. A DXF opens 1:1 in CAD tools.
ParameterTypeDescription
cutHeightnumberCut height above the floor, mm.
depthnumberHow far below the cut to draw, mm (default: all of the storey; 0 draws only the cut).
expectBuildany
sessionId *any
storey *stringStorey id or name.
query_elementsFind elements in a session. All filters in `where` must hold. Returns a page of matching ids plus counts by category, storey and family over every match, so a broad query can be narrowed before fetching details with get_elements.
ParameterTypeDescription
expectBuildany
limitnumberPage size (default ${DEFAULT_LIMIT}, max ${MAX_LIMIT}).
offsetnumberPage start (default 0).
sessionId *any
whereobjectFilters. Omit to match every element.
read_issuesRead the topics of a BCF 3.0 file (.bcf or .bcfzip): title, type, status, priority, labels, assignee, dates, description, comments, and each viewpoint's camera and components (selected, colored, and visibility exceptions) by IFC GlobalId. Pass a sessionId to resolve each GlobalId to the session's element id (a families session resolves the GlobalIds of its last export_ifc). A comment's viewpoint names the viewpoint it was made on. snapshots: true also returns up to ${MAX_SNAPSHOTS} viewpoint snapshots from the page as images. Topics come ${TOPIC_PAGE} at a time; pass offset for the rest. Component lists stop at ${MAX_COMPONENTS} with componentsTotal set; pass topic (a topic guid) to read that one topic with every component.
ParameterTypeDescription
limitnumberPage size (default ${TOPIC_PAGE}, max ${MAX_TOPIC_PAGE}).
offsetnumberPage start (default 0).
path *stringThe BCF file; relative to the server cwd.
sessionIdstringSession to resolve GlobalIds against.
snapshotsbooleanReturn snapshots as images.
topicstringRead only this topic (by guid), with every component listed.
rebuildRe-read a session's source after you edit it and diff the new build against the last good one: added and removed ids, and for each changed element its prop, pset and identity before/after values, whether its geometry changed, and its volume (mm³) and bounds (mm) deltas. Check that the diff touches only the elements you meant to change. Each list holds the first 100 entries; when there are more, nextOffset is set and get_diff returns the rest. A rebuild fails when the program fails to build or when an element's geometry fails that built before; a failed rebuild keeps serving the last good build (servingLastGood: true) and returns the errors.
ParameterTypeDescription
sessionId *any
timeoutMsany
render_viewRender a session's current build to 1200 x 900 PNGs, returned as images after a short text digest. highlight draws the given elements solid in orange and ghosts the rest; isolate draws only the given elements; both take ids or globs, and a container (a storey, a composed family) stands for the elements under it. colorBy colors what is drawn by category, storey or family and returns the legend. plan draws one storey from above, cut 1200 mm (or cutHeight) above its floor. After a rebuild, render with highlight set to the changed ids to check the edit by eye.
ParameterTypeDescription
colorBystring
dimsbooleanBurn the drawn elements' size into the image (default true).
expectBuildany
highlightarrayUp to ${MAX_SELECTION} ids or globs.
isolatearrayUp to ${MAX_SELECTION} ids or globs.
planobjectA storey plan: the storey id or name, and the cut height above its floor in mm.
sectionobjectA cut at "at" mm along axis; keep picks the lower (below, default) or higher side.
sessionId *any
timeoutMsnumberRender budget in ms (default ${RENDER_TIMEOUT_MS}, max ${MAX_TIMEOUT_MS}).
viewModestringDefault solid.
viewsarrayCamera views, one image each (default ["iso"]). Ignored with plan.
run_programExecute an agent-authored brepjs program in an isolated sandbox and return the verification report (validity, measurements, topology). Use this to build a part and check it in one step.
scheduleA schedule of the elements `where` selects: one row per element with the given fields, or with groupBy one row per group with its count and the sum of every other numeric field. sortBy orders the rows; totals sum each numeric field over every selected element. With outPath the full table is also written as CSV (asking before replacing a file). Get field names from list_schedulable_fields.
ParameterTypeDescription
expectBuildany
fields *arrayColumns, e.g. ["name", "storey", "quantities.Qto_WallBaseQuantities.NetVolume"].
groupByarray
limitnumberRows to return (default ${DEFAULT_ROWS}, max ${MAX_ROWS}).
outPathstringWrite the whole table here as CSV (must end in .csv).
overwritebooleanReplace an existing CSV without asking.
sessionId *any
sortByarraySort keys, first one strongest. A field name alone sorts ascending.
timeoutMsnumberBudget for deriving quantities, in ms.
whereany
search_referenceSearch the reference bundled with brepjs-cad, with no session needed: the brepjs API reference (llms-full.txt), the brepjs-families docs (families, key paths, openings, props and validation, IFC export) and the families-to-IFC guide. Returns the best-matching sections with their heading and an excerpt, ranked by how many query terms they contain. Read a whole file through its brep://reference resource.
ParameterTypeDescription
limitnumberSections to return (default ${DEFAULT_HITS}, max ${MAX_HITS}).
query *stringWords to look for, e.g. "fill role opening".
section_viewDraw a vertical section: a plane square to the x or y axis at "at" mm cuts the elements (drawn heavy, by category) and what lies beyond it, in the direction you look, is projected thin with hidden lines removed (openings and spaces are not drawn). look picks the direction: "+" looks toward +axis (a y section looking north), "-" the other way. Elements take ids or globs to limit the drawing (default: every element). Returns a PNG preview after a text digest, and saves SVG, DXF or PNG when outPath is given. Coordinates are model millimetres, with z up.
ParameterTypeDescription
at *numberWhere the plane cuts the axis, mm.
axis *string
depthnumberHow far beyond the cut to draw, mm (default: everything; 0 only the cut).
elementsarrayUp to ${MAX_ELEMENTS} ids or globs.
expectBuildany
lookstringDefault "+".
sessionId *any
select_elementsSelect elements in the open viewer (shown in yellow), replacing its selection. Takes ids or globs; a container stands for what is under it. The viewer picks the change up within a couple of seconds.
ParameterTypeDescription
ids *array
sessionId *any
show_elementsFrame the open viewer's camera on elements and select them. Takes ids or globs; a container stands for what is under it.
ParameterTypeDescription
ids *array
sessionId *any
show_modelOpen a session's current build in an interactive 3D viewer the user can orbit and click. Clients that support MCP Apps show it inline; others get a local URL to open in a browser. highlight and isolate take ids or globs (a container stands for what's under it), colorBy colors by category, storey or family. Clicking an element in the inline viewer selects it, and get_viewer_selection returns what the user picked; select_elements and show_elements change what either viewer shows, and a rebuild updates both. The browser page follows the agent but can't report clicks back.
ParameterTypeDescription
colorBystring
expectBuildany
highlightarray
isolatearray
sessionId *any
validate_modelRun brepjs-bim's checks against a session's current build and return findings with severity, code and message, each mapped to the element it names (a key path for families, a GlobalId for IFC). Checks: integrity (referential integrity of the BimDocument a families model projects to), schema (EXPRESS/STEP), roundtrip (write, read, write), gherkin (buildingSMART normative rules), geometry (each element's solid: validity, healability, volume). A families model is checked as the IFC export_ifc would write; an opened IFC file is checked as it is, and the geometry check also reports each element whose body the importer could not fully rebuild. Findings come errors first, ${FINDINGS_PAGE} at a time; pass offset for the rest. A run is kept until the session rebuilds, so later pages and other minSeverity values don't re-run the checks.
ParameterTypeDescription
checksarrayWhich checks to run (default all).
expectBuildany
limitnumberPage size (default ${FINDINGS_PAGE}, max ${MAX_FINDINGS_PAGE}).
minSeveritystringLeave out findings below this severity (default info: everything).
offsetnumberPage start (default 0).
sessionId *any
timeoutMsnumberBudget in ms (default ${VALIDATE_TIMEOUT_MS}, max ${MAX_TIMEOUT_MS}).
viewer_payloadThe viewer app's model: the session's current build as an encoded mesh payload.
ParameterTypeDescription
sessionId *any
viewer_syncThe viewer app's check-in: reports the user's selection when it changes, and returns the agent's latest selection, framing and style when rev is behind.
ParameterTypeDescription
revnumber
selectionarray
sessionId *any

Security checks

  • ✓README presentThe repository's README runs to about 2.2K words.
  • ✓License declaredThe repository declares the Apache-2.0 license.
  • ✓Tests presentA test suite exists in the repository.
  • ✓Dependencies pinnedA lockfile pins dependency versions.

2 checks have not been run yet.

Releases

brepjs-v20.28.3brepjs: v20.28.3 · 17 Nov 202620.28.3 (2026-11-17) Bug Fixes brepkit: import each body of a mesh as its own solid or shell (#2728) (26c687c)
brepjs-cad-v0.194.1brepjs-cad: v0.194.1 · 17 Nov 20260.194.1 (2026-11-17) Bug Fixes brepjs-cad: accept a part that uses using in brep verify --check (#2720) (01bb3cc)
brepjs-mesh2solid-v0.3.1brepjs-mesh2solid: v0.3.1 · 17 Nov 20260.3.1 (2026-11-17) Performance Improvements mesh2solid: cut wasted work out of the surface fits (#2725) (6befb01)
brepjs-v20.28.2brepjs: v20.28.2 · 16 Nov 202620.28.2 (2026-11-16) Performance Improvements topology: move a shape by location on a kernel that shares geometry (#2723) (21e3fe7)
brepjs-v20.28.1brepjs: v20.28.1 · 16 Nov 202620.28.1 (2026-11-16) Bug Fixes topology: report the evolution of shapes that have no metadata (#2718) (4793711)

README

The repository's README runs to about 2.2K words, fetched 12 days ago. The original in the repository is authoritative.

Read full README
Questions

About Brepjs

How do I install Brepjs?

No package has been published for this server, so install it from source: clone the repository and follow its README.

Is Brepjs safe to use with an AI agent?

Its trust score is 74 out of 100 (good). It passes all 4 static checks Conduid ran on the repository. It has no ConduID identity yet, so agent calls to it are not receipted.

Is Brepjs still maintained?

Yes — the latest release is brepjs-v20.28.3 (17 Nov 2026), and the last commit was yesterday. The repository has 151 stars.

What tools does Brepjs provide?

Conduid read 29 tools from the source: close_model, compare_models, create_issue, eval_in_session, export_cobie, export_ifc, export_part, get_diff and 21 more. 26 of them publish their parameters, listed under Tools above.

What license is Brepjs released under?

The repository declares the Apache-2.0 license. That applies to the latest release, brepjs-v20.28.3, as well.