kernelCAD MCP server
Endpoint: https://mcp.kernelcad.com/mcp · Authentication: Sign in with OAuth
Create and edit CAD models with kernelCAD's hosted MCP server. Anonymous discovery is available, and the hosted tool set depends on authentication and the selected profile.
How do I authenticate?
Add the endpoint in your client, start Connect or Sign in, approve the requested scopes, and return to the client. OAuth discovery finds the authorization server; client registration requirements vary by provider. Follow the provider guidance and client setup below.
Authentication and connection guideConnection specification
- Remote endpoint
https://mcp.kernelcad.com/mcp- Browser access
- Not yet measured
- Declared MCP transport
- Streamable HTTP
- Live-validated MCP transport
- Not yet verified — Latest validation did not verify a transport
- Declared authentication
- No authentication
- Detected authentication
- OAuth 2.1 detected or retained from publisher evidence
- Alternative authentication
- OAuth 2.1
- Protocol lifecycle
- Not yet negotiated
- Authorization server
https://mcp.kernelcad.com- Category
- Design
Official listing documentation · ChatGPT app directory listing
Provider guidance
- The endpoint accepts anonymous initialization and tool listing. Sign in with OAuth for account features such as saved projects, then list tools again to see what the selected hosted profile exposes.
More Design MCP servers · Browse all MCP servers · Test this endpoint in the MCP Playground
Connect it
Canonical catalog endpoint: https://mcp.kernelcad.com/mcp · Streamable HTTP. Registration requirements not verified: The OAuth authorization and app-registration requirements for this exact endpoint have not been verified. A compatible client will request authorization, but follow the publisher documentation and do not guess client credentials or callbacks.
Agent prompt for Claude Code or Codex
Add the kernelCAD MCP server to my MCP client configuration and verify that it works. What it is: Create and edit CAD models with kernelCAD's hosted MCP server. Anonymous discovery is available, and the hosted tool set depends on authentication and the selected profile. Server URL: https://mcp.kernelcad.com/mcp Transport: Streamable HTTP (remote MCP server, no local install). Authentication: OAuth 2.1. The client opens a browser sign-in on first connect; do not create or store tokens yourself. Registration requirements not verified: The OAuth authorization and app-registration requirements for this exact endpoint have not been verified. A compatible client will request authorization, but follow the publisher documentation and do not guess client credentials or callbacks. Tools (14, as last observed by mcptest): add_connector, add_constraint, add_curve, add_feature, add_mate, add_part, add_path_segment, add_pattern_feature, add_surface, add_text, add_variable_sweep, add_workspace_target, apply_surface_blend, blockout_assembly. Reference: https://mcptest.io/servers/kernelcad/ Steps: 1. Work out which MCP client I use (Claude Code, Codex, Cursor, VS Code or another) and add the server under the name "kernelcad" in that client's MCP configuration, user scope unless I ask otherwise. Claude Code: claude mcp add --transport http --scope user 'kernelcad' 'https://mcp.kernelcad.com/mcp' Other clients: use the setup for that client on the reference page. 2. Never write a credential value into a file that could be committed; reference an environment variable or the client's secret store, and ask me for any value you need. 3. Verify: connect to the server and call tools/list. Confirm the tools above are listed, and report any sign-in step I still have to complete.
Claude Code setup
Run in a terminal. This user-scoped entry is available across projects.
claude mcp add --transport http --scope user 'kernelcad' 'https://mcp.kernelcad.com/mcp'- After adding the server, open Claude Code, run /mcp, select the server, and follow the browser flow to authenticate.
Codex CLI setup
Run in a terminal; Codex stores the entry in ~/.codex/config.toml.
codex mcp add 'kernelcad' --url 'https://mcp.kernelcad.com/mcp'
codex mcp login 'kernelcad'Cursor setup
Add to .cursor/mcp.json for this project, or ~/.cursor/mcp.json for all projects.
{
"mcpServers": {
"kernelcad": {
"url": "https://mcp.kernelcad.com/mcp"
}
}
}VS Code setup
Add to .vscode/mcp.json, or run “MCP: Open User Configuration” for a private user-level entry.
{
"servers": {
"kernelcad": {
"type": "http",
"url": "https://mcp.kernelcad.com/mcp"
}
}
}Claude setup
Add the endpoint above in Claude:
- Customize > Connectors > Add custom connector
- Team/Enterprise: Organization settings > Connectors > Add > Custom > Web
Claude Desktop setup
Add the endpoint above in Claude Desktop:
- Remote: Customize > Connectors (same as claude.ai)
- Local: Settings > Developer > Edit Config, or Settings > Extensions for .mcpb files
~/Library/Application Support/Claude/claude_desktop_config.json(macOS) or%APPDATA%\Claude\claude_desktop_config.json(Windows), local servers only
ChatGPT setup
Add the endpoint above in ChatGPT:
- ChatGPT web: Plugins > Add custom MCP server, then configure authentication and accept the risk warning
Windsurf setup
Add the endpoint above in Windsurf:
~/.config/devin/mcp_config.json(%APPDATA%\devin\mcp_config.jsonon Windows),serverUrlorurl- Cascade panel > ... > MCPs > Open MCP config file
Gemini CLI setup
Add the endpoint above in Gemini CLI:
gemini mcp add --transport http <name> <url>~/.gemini/settings.json(user) or.gemini/settings.json(project),mcpServers
MCP SDK setup
Add the endpoint above in MCP SDK:
- Programmatic:
new Client(...).connect(new StreamableHTTPClientTransport(url))
Notes for every client
- Provider guidance: The endpoint accepts anonymous initialization and tool listing. Sign in with OAuth for account features such as saved projects, then list tools again to see what the selected hosted profile exposes.
Client compatibility
| Client | Status | Why |
|---|---|---|
| Claude Code | Supported | Claude Code supports Streamable HTTP servers and OAuth sign-in. |
| Codex | Partial | Codex CLI ignores resources: The server can still connect, but Codex CLI does not consume the advertised resources capability. |
| Cursor | Supported | Cursor supports Streamable HTTP servers and OAuth sign-in. |
| VS Code | Supported | VS Code supports Streamable HTTP servers and OAuth sign-in. |
| Claude | Supported | Claude supports Streamable HTTP servers and OAuth sign-in. |
| Claude Desktop | Supported | Claude Desktop supports Streamable HTTP servers and OAuth sign-in. |
| ChatGPT | Partial | ChatGPT ignores resources: The server can still connect, but ChatGPT does not consume the advertised resources capability. |
| Windsurf | Partial | Windsurf's documentation does not state support for OAuth sign-in. |
| Gemini CLI | Supported | Gemini CLI supports Streamable HTTP servers and OAuth sign-in. |
| MCP SDK | Supported | MCP SDK supports Streamable HTTP servers and OAuth sign-in. |
Computed from this server's validated transport, protocol and authentication against documented client support. Checks the catalog has not observed are not counted.
Latest validation evidence
- Validation status
- Latest validation was inconclusive
- Validation checked at
- Nov 23, 2026 at 7:17 PM
- Validation detail
- Capability inventory contains unsafe or non-canonical fields.; endpoint was reachable but did not complete an MCP probe
Tool inventory
What the catalog validator observed on at https://mcp.kernelcad.com/mcp without credentials. The live server may have changed since; connect in the Playground for the current list.
Tools provided by kernelCAD 78
14 of 78 shown; 64 omitted to keep the page bounded.
add_connectoroutputSchema declaredUse this when you need to add a mate connector to a part. Durably insert `<partBinding>.connector(name, { type, origin, axis?, normal? })` before the final top-level return. Use the part binding returned by add_part. Returns modified source plus diagnostics from re-evaluation. Side-effect-free.
Input
axis?: array, code: string, name: string, normal?: array, origin: any, part_binding: string, type: stringaxis?: arrayoptionalOptional [x, y, z] axis.
code: stringrequiredThe .kcad.ts source code.
name: stringrequiredConnector name unique within the part.
normal?: arrayoptionalOptional [x, y, z] normal.
origin: anyrequiredOrigin as [x, y, z] shorthand, or a structured ConnectorOrigin.
part_binding: stringrequiredJS identifier bound to an AssemblyPartRef, e.g. "basePart".
type: stringrequired
add_constraintoutputSchema declaredUse this when you need to add a sketch constraint to a list. Append one validated sketch constraint to a constraint list. Side-effect-free: pass { constraints, constraint } and receive the updated list.
Input
constraint: object, constraints?: arrayconstraint: objectrequiredThe constraint to append.
constraints?: arrayoptionalExisting constraint list to append to (omit for an empty list).
add_curveoutputSchema declaredUse this when you need a freeform/organic 3D curve — a body feature line, brow, spine rail, or curve bridge between panel boundaries — authored as a Curve3D into the user's .kcad.ts immediately before the last top-level return. One authoring path, selected by `kind`: - 'nurbs' — insert a `nurbsCurve(controlPoints, opts?)` declaration. Pass `controlPoints` as a Vec3[] (mm, at least 2 points). Optional NURBS knobs: `degree` (default 3), rational `weights`, explicit `knots`, `closed`. - 'hermite' — insert a `hermiteG2(a, b)` declaration: a quintic Hermite curve interpolating two endpoints with ma
Input
a?: object, b?: object, binding_name?: string, closed?: boolean, code: string, controlPoints?: array, degree?: integer, kind: string, knots?: array, weights?: arraya?: objectoptionalkind:'hermite' — start endpoint.
b?: objectoptionalkind:'hermite' — end endpoint.
binding_name?: stringoptionalJS const name for the new Curve3D binding (default: _curve_<N>).
closed?: booleanoptionalkind:'nurbs' — optional periodic/closed-curve flag.
code: stringrequiredThe .kcad.ts source code.
controlPoints?: arrayoptionalkind:'nurbs' — control points as Vec3 triples in mm; at least 2 entries.
degree?: integeroptionalkind:'nurbs' — curve degree; default 3 (cubic).
kind: stringrequiredWhich curve-construction path to use.
knots?: arrayoptionalkind:'nurbs' — optional explicit knot vector; missing => clamped-uniform inferred.
weights?: arrayoptionalkind:'nurbs' — optional rational weights, one per control point (same length as controlPoints).
add_featureoutputSchema declaredUse this when you need to insert a new feature line into a script. Insert a new feature line into a kernelCAD script before the last top-level return statement. Returns the modified code as text plus diagnostics from re-evaluating the result. Direct editing is authored here too: use `body.deleteFace(faces)` to heal a removed-face opening, or `body.replaceFace(faces, { origin, normal })` for a parallel planar replacement; the runtime refuses any result that does not pass its single-solid BRepCheck gate. Primitives that accept faceLabels (box, cylinder, extrudeRect, extrudeCircle, extrudePolygon
Input
code: string, feature_code: stringcode: stringrequiredThe .kcad.ts source code.
feature_code: stringrequiredSingle-statement source line to insert. A narrow analytic G4 certificate is available only for a terminal, unlabeled 360-degree revolve followed only by finite translations, finite rotations about an axis of finite positive squared length, uniform scales by one finite positive factor, and reflections across a cardinal plane with a finite optional offset, with no downstream consumers, using a move + 2–128 three-point arcs + close profile. Exact dyadic checks require the move point and a later endpoint to be antipodal, every endpoint and midpoint on the same exactly representable circle, and exa
add_mateoutputSchema declaredUse this when you need to author a mate-graph relationship into the source, selected by `relation` (default 'mate'): - 'mate' — a typed mate between two connectors ({ name, a, b, type, pose?, limitsDeg?, limitsMm? }). - 'coupling' — couple a driven mate to a source mate by ratio ({ driven, source, ratio, offset? }). - 'transmission' — a physical drive path across mates ({ name, kind, sourceMate, drivenMates, path, ... }). All durably edit source and need { code, assembly_binding }. Params other than `relation` are forwarded verbatim; each relation fails closed on its own missing required param
Input
a?: string, actuator?: string, adhesive?: object, assembly_binding: string, b?: string, code: string, driven?: string, drivenMates?: array, input?: string, kind?: string, limitsDeg?: array, limitsMm?: array, name?: string, notes?: string, offset?: number, output?: string, path?: array, pose?: object, ratio?: number, relation?: string, source?: string, sourceMate?: string, type?: stringa?: stringoptionalrelation:'mate' — connector ref "<partName>.<connectorName>".
actuator?: stringoptionalrelation:'transmission' — optional actuator.
adhesive?: objectoptionalOptional planar adhesive interface for a fastened mate. Select one canonical face on each part.
assembly_binding: stringrequiredJS identifier bound to assembly(...).
b?: stringoptionalrelation:'mate' — connector ref "<partName>.<connectorName>".
code: stringrequiredThe .kcad.ts source code.
driven?: stringoptionalrelation:'coupling' — driven mate name.
drivenMates?: arrayoptionalrelation:'transmission' — driven mate names.
input?: stringoptionalrelation:'transmission' — optional input.
kind?: stringoptionalrelation:'transmission' — transmission kind.
limitsDeg?: arrayoptionalrelation:'mate' — optional [minDeg, maxDeg].
limitsMm?: arrayoptionalrelation:'mate' — optional [minMm, maxMm].
name?: stringoptionalrelation:'mate'|'transmission' — name unique within the assembly.
notes?: stringoptionalrelation:'transmission' — optional notes.
offset?: numberoptionalrelation:'coupling' — optional pose offset.
output?: stringoptionalrelation:'transmission' — optional output.
path?: arrayoptionalrelation:'transmission' — drive path.
pose?: objectoptionalrelation:'mate' — optional mate pose.
ratio?: numberoptionalrelation:'coupling' — driven pose = source pose * ratio + offset.
relation?: stringoptionalWhich relationship to author (default 'mate').
source?: stringoptionalrelation:'coupling' — source mate name.
sourceMate?: stringoptionalrelation:'transmission' — source mate name.
type?: stringoptionalrelation:'mate' — mate type.
add_partoutputSchema declaredUse this when you need to add a part to an assembly. Durably insert `const <binding> = <assembly>.part(partName, shapeExpression, opts?)` before the final top-level return in a kernelCAD source string. Returns modified source plus diagnostics from re-evaluating it. Side-effect-free: caller persists the returned source.
Input
assembly_binding: string, at?: array, binding_name?: string, code: string, part_name: string, shape_expression: stringassembly_binding: stringrequiredJS identifier bound to assembly(...), e.g. "arm".
at?: arrayoptionalOptional [x, y, z] assembly placement.
binding_name?: stringoptionalOptional JS const name for the returned AssemblyPartRef. Defaults to a part-name-derived identifier.
code: stringrequiredThe .kcad.ts source code.
part_name: stringrequiredAssembly-unique part name.
shape_expression: stringrequiredJS expression for the Shape to pass to assembly.part, inserted verbatim.
add_path_segmentoutputSchema declaredUse this when you need a freeform/organic 2D outline — an eyewear brow, ergonomic grip, sneaker midsole, or body silhouette — by appending a curved segment to an existing PathBuilder chain on the named `chain_anchor` variable. The call is injected at the END of the chain, immediately before any `.close()`. One segment kind, selected by `kind`: - 'spline' — `.spline(points, opts?)`: interpolates through every `points` waypoint (Vec2[] mm, >= 2 entries; points[0] must match current pen position). Optional `tension`, and `startTangent`/`endTangent` 2D direction vectors that constrain the first-de
Input
a?: object, b?: object, binding_name?: string, chain_anchor: string, code: string, controlPoints?: array, degree?: integer, endTangent?: array, kind: string, knots?: array, points?: array, startTangent?: array, tension?: number, weights?: arraya?: objectoptionalkind:'hermite' — start endpoint; point must match current pen position within 1e-6 mm.
b?: objectoptionalkind:'hermite' — end endpoint; pen ends at b.point.
binding_name?: stringoptionalReserved for future use; the segment injection mutates the chain anchor in place.
chain_anchor: stringrequiredJS identifier of an existing PathBuilder binding (e.g. `const brow = path().moveTo(0,0)`).
code: stringrequiredThe .kcad.ts source code.
controlPoints?: arrayoptionalkind:'nurbs' — control-net vertices as Vec2 pairs in mm; at least degree+1 entries.
degree?: integeroptionalkind:'nurbs' — B-spline degree (default 3).
endTangent?: arrayoptionalkind:'spline' — optional [x, y] direction vector at points[N-1]. Magnitude is normalised internally; direction matters.
kind: stringrequiredWhich path-segment kind to append.
knots?: arrayoptionalkind:'nurbs' — optional explicit knot vector; length must equal controlPoints.length + degree + 1.
points?: arrayoptionalkind:'spline' — waypoints as Vec2 pairs in mm; at least 2 entries; first must match current pen position.
startTangent?: arrayoptionalkind:'spline' — optional [x, y] direction vector at points[0]. Magnitude is normalised internally; direction matters.
tension?: numberoptionalkind:'spline' — optional Catmull-Rom-style stiffness; forwarded to the underlying B-spline approximation.
weights?: arrayoptionalkind:'nurbs' — optional rational weights (one per control point; strictly positive).
add_pattern_featureoutputSchema declaredUse this when you need to repeat a feature in a pattern. Insert a Shape.patternLinear / .patternCircular / .patternGrid / .patternCurve call into a kernelCAD script before the last top-level return. Pass structured args (kind + the matching spec object). Curve patterns use equal arc-length intervals along a 3D polyline; instances keep the seed orientation. Returns the modified code plus diagnostics from re-evaluating. Side-effect-free. The pattern feature is a single editable unit; pattern-instance face refs resolve via `<sourceId>_pattern_<i>` on the pattern feature's lineage. Geometric note:
Input
assign_to?: string, circular?: object, code: string, curve?: object, grid?: object, kind: string, linear?: object, target: stringassign_to?: stringoptionalOptional const-binding name; emits `const <assign_to> = <target>.patternX(...);`. Omit for statement form.
circular?: objectoptionalRequired when kind=circular.
code: stringrequiredThe .kcad.ts source code.
curve?: objectoptionalRequired when kind=curve. A fixed-orientation pattern at equal arc-length intervals along a polyline. Points are offsets in mm from the seed; the first point must be [0, 0, 0].
grid?: objectoptionalRequired when kind=grid.
kind: stringrequiredlinear?: objectoptionalRequired when kind=linear.
target: stringrequiredVariable name of the Shape to pattern (inserted verbatim as the LHS receiver).
add_surfaceoutputSchema declaredUse this when you need an organic, freeform, or swept shape — a body shell, panel, fairing, ergonomic curve, lens, or sculpted form — authored as a NURBS Surface into the user's .kcad.ts, OR when you need to finish surfaces into a watertight solid or taper faces for moldability. One authoring/finishing path, selected by `kind`: - 'nurbs' — insert a nurbsSurface(...) / surfaceFromCurves(...) call. Pass either { controls, degree, weights?, knots?, periodic? } for direct construction, OR { section_sketch_ids } for skinning. Weights are honored: supply rational weights to build exact circles/cylin
Input
angle_deg?: number, binding_name?: string, by_binding?: string, code: string, continuity?: any, controls?: array, curve_bindings?: array, degree?: object, extrusion?: array, face?: string, face_tolerance?: number, handle_length_mm?: number, kind: string, knots?: object, neutral_plane?: string, normal_a?: array, normal_b?: array, op?: string, periodic?: object, pull_dir?: array, rail_a_binding?: string, rail_b_binding?: string, require_closed?: boolean, sampling?: integer, section_sketch_ids?: array, shape_binding?: string, split_direction?: string, split_knot?: number, surface_binding?: string, surface_bindings?: array, tolerance?: number, weights?: arrayangle_deg?: numberoptionalkind:'draft' — draft angle in degrees [0, 90]. The face is tapered outward by this angle relative to the pull direction.
binding_name?: stringoptionalJS const name for the new binding (kind:'nurbs' default surface_<N>; kind:'patchFamily' default patch_family_<N>; kind:'planeBlend' default plane_blend_<N>; kind:'boundary' default _surface_<N>; kind:'trim' default _trimmed_<N>; kind:'sew' default _sewn_<N>; kind:'draft' default _drafted_<N>).
by_binding?: stringoptionalkind:'trim' — JS variable name of the cutter Surface (must be declared in source). Shape/Curve3D cutters are deferred.
code: stringrequiredCurrent .kcad.ts source.
continuity?: anyoptionalkind:'boundary' — C0 only; C1/C2 fail because no neighboring support surfaces are supplied. kind:'sew' — minimum sampled continuity for every topology-enumerated shared seam ('G0' | 'G1' | 'G2' | 'G3' | 'G4'); G3/G4 use common-UV NURBS samples and are explicitly uncertified, not exact or seam-wide proofs.
controls?: arrayoptionalkind:'nurbs' or 'patchFamily' — control-point grid (controls[u][v] = [x, y, z], mm). patchFamily uses degree-5+ caps and an interior split knot with multiplicity <= split-direction degree - 4.
curve_bindings?: arrayoptionalkind:'boundary' — tuple of 4 existing Curve3D variable names (bottom, right, top, left) declared earlier in the source.
degree?: objectoptionalkind:'nurbs' or 'patchFamily' — degrees in U and V; patchFamily requires split-direction degree >= 5 and enough controls for an interior knot with multiplicity <= degree - 4.
extrusion?: arrayoptionalkind:'patchFamily' — finite non-zero translation [x, y, z] in mm from the first NURBS cap to the opposite cap.
face?: stringoptionalkind:'draft' — face selector for the face(s) to taper. Accepts a canonical name (top/bottom/front/back/left/right), a user label declared via faceLabels, or a FaceQuery descriptor string.
face_tolerance?: numberoptionalkind:'patchFamily' — positive OCCT face-construction tolerance in mm (default 1e-6).
handle_length_mm?: numberoptionalkind:'planeBlend' — positive quintic control-handle length in mm; default is one tenth of the rail gap.
kind: stringrequiredWhich surface-construction or surface-finishing path to use: 'nurbs' | 'patchFamily' | 'planeBlend' | 'boundary' | 'trim' | 'sew' | 'draft'.
knots?: objectoptionalkind:'nurbs' or 'patchFamily' — optional explicit knot vectors; missing => clamped uniform inferred. patchFamily split_knot must select an interior knot with multiplicity <= split-direction degree - 4.
neutral_plane?: stringoptionalkind:'draft' — parting-line face (the plane where drafted faces remain fixed). Defaults to `face` if omitted.
normal_a?: arrayoptionalkind:'planeBlend' — unit normal of the first planar support face.
normal_b?: arrayoptionalkind:'planeBlend' — unit normal of the second planar support face.
op?: stringoptionalkind:'trim' — 'trim' discards the smaller half (calls .trimTo()); 'split' retains both halves (calls .split()).
periodic?: objectoptionalkind:'nurbs' — optional periodic flags per parametric direction.
pull_dir?: arrayoptionalkind:'draft' — demoulding direction as [x, y, z]. Defaults to the face normal at lower time.
rail_a_binding?: stringoptionalkind:'planeBlend' — existing Curve3D variable name for the first straight support rail.
rail_b_binding?: stringoptionalkind:'planeBlend' — existing Curve3D variable name for the second corresponding, parallel support rail.
require_closed?: booleanoptionalkind:'sew' — when true the lowerer emits feature.surface-sew.open-shell if the stitched result is not a watertight solid.
sampling?: integeroptionalkind:'boundary' — points sampled along each boundary (default 15).
section_sketch_ids?: arrayoptionalkind:'nurbs' — existing sketch FeatureIds (2 or more) to skin a surface through, in order.
shape_binding?: stringoptionalkind:'draft' — JS variable name of the Shape to taper (must be declared in source).
split_direction?: stringoptionalkind:'patchFamily' — parameter direction for the shared interior knot with multiplicity <= degree - 4 and measured target seam.
split_knot?: numberoptionalkind:'patchFamily' — optional knot value to split at; defaults to the first interior knot whose multiplicity gives C4 or better.
surface_binding?: stringoptionalkind:'trim' — JS variable name of the Surface to trim/split (must be declared in source).
surface_bindings?: arrayoptionalkind:'sew' — JS variable names of the surfaces to stitch into a solid (each must be declared in source).
tolerance?: numberoptionalkind:'sew' — edge-merging tolerance in mm (default 1e-6). Edges within this distance are merged.
weights?: arrayoptionalkind:'nurbs' or 'patchFamily' — optional positive rational weights, same grid shape as controls. Rational weights are outside the restricted patchFamily analytic certificate class.
add_textoutputSchema declaredUse this when you need to author text into a kernelCAD script before the last top-level return. One authoring path, selected by `mode`: - 'sketch' — insert a sketch.text(...) call. The emitted sketch is chainable: pair with subsequent .extrude(...) / cut(...) edits to land an engraved or raised text feature. - 'emboss' — insert a `<shape>.embossText({...})` chained call onto an existing Shape `target`. Use for engraved brand text on faces (Ray-Ban temple, CE mark, model number). `depth > 0` raises text out of the face; `depth < 0` engraves text into the face. Lowers via replicad drawText → ske
Input
align?: string, anchorU?: number, anchorV?: number, bindAs?: string, code: string, content?: string, depth?: number, face?: string, font?: string, fontFamily?: string, mode: string, position?: array, rotation?: number, scaleMode?: string, size?: number, target?: string, textContent?: stringalign?: stringoptionalmode:'sketch' — horizontal alignment relative to position (default left); mode:'emboss' — relative to the UV anchor (default center).
anchorU?: numberoptionalmode:'emboss' — U anchor in [0, 1] face-local (0=umin, 0.5=centre, 1=umax). Default 0.5.
anchorV?: numberoptionalmode:'emboss' — V anchor in [0, 1] face-local. Default 0.5.
bindAs?: stringoptionalmode:'sketch' — emits `const <bindAs> = sketch.text(...)`; mode:'emboss' — emits `const <bindAs> = <target>.embossText(...);`.
code: stringrequiredThe .kcad.ts source code.
content?: stringoptionalmode:'sketch' — text content (UTF-8, non-empty, non-whitespace).
depth?: numberoptionalmode:'emboss' — signed extrusion depth in mm: positive emboss out, negative engrave in. Must be non-zero.
face?: stringoptionalmode:'emboss' — target face — canonical name ('top'/'bottom'/'left'/'right'/'front'/'back') or label.
font?: stringoptionalmode:'sketch' — optional logical font name or .ttf file path; defaults to bundled Liberation Sans.
fontFamily?: stringoptionalmode:'emboss' — optional logical font name or .ttf file path; defaults to bundled Liberation Sans.
mode: stringrequiredWhich text-authoring path to use.
position?: arrayoptionalmode:'sketch' — [x, y] anchor in mm. Default [0, 0].
rotation?: numberoptionalmode:'sketch' — CCW rotation in degrees around position (default 0); mode:'emboss' — CCW rotation in the face tangent plane (default 0).
scaleMode?: stringoptionalmode:'emboss' — Drawing.sketchOnFace scaling mode. Default original.
size?: numberoptionalmode:'sketch'|'emboss' — glyph cap height in mm (positive finite).
target?: stringoptionalmode:'emboss' — variable name of the Shape to chain onto (inserted verbatim).
textContent?: stringoptionalmode:'emboss' — text content (UTF-8, non-empty, non-whitespace).
add_variable_sweepoutputSchema declaredUse this when you need an organic swept solid whose cross-section changes along its length — a tapering body, horn, bottle, handle, ring band, fairing, or duct — authored as a variable-section sweep along a spine. Inserts `variableSweep(spine, sections, opts?)` into the .kcad.ts `code` immediately before the last top-level return (an empty `code` starts a new script that returns the sweep). Spine: EITHER `spine_points` ([[x,y,z], ...] in mm, interpolated with spline3d; `spine_closed: true` closes the loop for a ring) OR `spine_binding` (an existing Curve3D / Sketch / Vec3[] variable). Each sec
Input
binding_name?: string, closed?: boolean, code: string, continuity?: string, sections: array, spine_binding?: string, spine_closed?: boolean, spine_points?: arraybinding_name?: stringoptionalJS const name for the new Shape binding (default: _sweep_<N>).
closed?: booleanoptionalOptional closed-sweep flag.
code: stringrequiredThe .kcad.ts source code ("" for a new script).
continuity?: stringoptionalInter-section continuity request; default 'C1'. C2 targets measured G2 at NURBS station seams; output diagnostics report the achieved class.
sections: arrayrequiredVarying cross-sections along the spine; at least 2 entries, strictly increasing in `t`, first t=0, last t=1.
spine_binding?: stringoptionalExisting variable name for a Curve3D / Sketch / Vec3[] declared earlier in the source. Use this OR spine_points.
spine_closed?: booleanoptionalWith spine_points: close the spline into a loop (ring band, loop handle).
spine_points?: arrayoptionalInline spine: at least 2 [x, y, z] points in mm, interpolated with spline3d. Use this OR spine_binding.
add_workspace_targetoutputSchema declaredUse this when you need to declare a reachability target for a connector. Durably insert `<assembly>.workspace(connectorRef, { reachable, toleranceMm? })` before the final top-level return. Workspace targets are checked by solvedModel validation/review pose-envelope gates. Returns modified source plus diagnostics from re-evaluation.
Input
assembly_binding: string, code: string, connector_ref: string, reachable: array, toleranceMm?: numberassembly_binding: stringrequiredJS identifier bound to assembly(...).
code: stringrequiredThe .kcad.ts source code.
connector_ref: stringrequiredConnector ref "<partName>.<connectorName>".
reachable: arrayrequiredWorld-frame Vec3 targets the connector must be able to reach.
toleranceMm?: numberoptionalOptional non-negative tolerance in mm.
apply_surface_blendoutputSchema declaredUse this to author and evaluate a fillet or chamfer on a kernelCAD Shape. It inserts Shape.fillet(radius, selector, { continuity: G1 }), Shape.fillet({ start, end }, selector, { continuity }), or Shape.chamfer(distance, selector), then returns the patched source and evaluation diagnostics. Constant-radius OCCT fillets expose measured G1 only; G2, G3, and G4 are refused because their support seams remained G1 in the tested mode/tolerance sweep. A linear two-station radius_profile uses the NURBS constrained route on one selected edge and reports its measured result; the planar fixture measured G
Input
code: string, continuity?: string, distance?: number, operation?: string, radius?: number, radius_profile?: object, selector?: any, shape_binding: stringcode: stringrequiredInline .kcad.ts source.
continuity?: stringoptionalRequested fillet continuity; defaults to G1. Constant-radius fillets accept G1 only. With radius_profile, the achieved class is measured and any downgrade is reported. Chamfer rejects this field.
distance?: numberoptionalChamfer distance in mm; required for operation:'chamfer'.
operation?: stringoptionalOperation; defaults to 'fillet'.
radius?: numberoptionalFillet radius in mm; required for operation:'fillet'.
radius_profile?: objectoptionalOptional linear start/end radius profile along one selected fillet edge. When supplied, radius is not required.
selector?: anyoptionalOptional EdgeSelector: a canonical @kc[...] edge ref/query string, an EdgeQuery object such as { parallel: "X", atY: 10 }, or { face: canonical face name, face label, or FaceQuery descriptor }. Higher-order blend requests require one selected edge.
shape_binding: stringrequiredExisting Shape variable name to blend.
blockout_assemblyoutputSchema declaredUse this when you have a list of parts with bounding boxes and positions (from a layout, spreadsheet, another tool or a sketch) and need an evaluable placeholder assembly script. Pass parts as { name, bboxMm:[x,y,z], positionMm:[x,y,z], rotationDeg?, anchors? } in mm; positionMm locates the bbox lower corner and anchors are named points in assembly coordinates. Optional connections [{ from, to }] reference anchors as "part.anchor" (including built-ins origin, bbox_center, bbox_x_min..bbox_z_max) and become fastened mates that express connectivity intent only; no wire or route geometry is gener
Input
connections?: array, name?: string, parts: arrayconnections?: arrayoptionalname?: stringoptionalAssembly name, default "blockout".
parts: arrayrequired
Resources 2
Some details were sanitized for public display.
kernelcad-authoringtext/markdownAuthoring guide for kernelCAD .kcad.ts — read before generating CAD.
kernelcad-studio-viewerkernelCAD Studio Viewer — Embeddable kernelCAD Studio viewer for generated or fetched models.