Drive FreeCAD through the structured MCP tools. Use native CAD knowledge to choose the model strategy. Use this skill for tool order, server-specific payloads, and validation.
Load only the required references
Follow this graph. Read each selected file directly from this page.
START
├─ Need exact tool arguments or failure rules? → references/mcp-tools.md
├─ Need parameters, expressions, or spreadsheet cells? → references/fundamentals.md
├─ Need connection, auth, tasks, consent, or limits? → references/protocol-security.md
├─ Need a common call sequence or payload? → references/recipes.md
├─ Need to choose the model representation? → references/modeling.md
│ ├─ Sketch profile or constraints? → references/sketcher.md
│ ├─ Scripted Part or booleans? → references/part-topsolids.md
│ └─ Placement, attachment, or links? → references/placement-attachment.md
├─ Need document, property, unit, or identity rules? → references/fundamentals.md
├─ Need fit, bounds, topology, or final proof? → references/validation.md
├─ Need STL, STEP, 3MF, mesh import, or repair?
│ ├─ Standard export, mesh details, or repair? → references/export-print.md
│ └─ Python escape hatch? → references/python-export.md
├─ Need an FFF-printable design? → references/printability.md
├─ Need an electronic component or enclosure? → references/electronic-components.md
├─ Need FEM? → references/fem.md
├─ Did a call fail or time out? → references/troubleshooting.md
└─ Need external issue, release, or community evidence? → references/community-support.md
Read references/mcp-tools.md only when the active tool schema or a server edge case matters. Read references/recipes.md before composing a common multi-call workflow.
Execute this loop
- Call
discover_capabilities. - If
gui.stateis busy, wait before dependent GUI calls. - If
gui.stateis stuck, stop GUI calls. - Call
inspect_documentsbefore you select an existing document. - Call
inspect_objectsbefore you edit an existing model. - Resolve only missing inputs that change geometry or authorization.
- Choose the smallest correct model strategy.
- Build one dependency stage.
- Inspect returned names, states, bounds, and solid counts.
- Re-read each changed property, cell, link, or file effect.
- Validate the stage before you add dependent features.
- Save the editable source before expensive or destructive work.
- Validate geometry, fit, placement, and visual form; run the
overviewreview after large modifications and document opens, and early in existing-model inspection after you locate the relevant objects. - Export only the intended final objects.
- Report tool results as evidence, not as inferred success.
Reuse each returned internal name. Do not use a display label as an object reference. Use millimetres unless the live property or source specifies another unit.
Choose the model strategy
Use existing FreeCAD and CAD knowledge first. Do not discover standard CAD operations by trial and error.
| Goal | Preferred strategy | Use instead when |
|---|---|---|
| One editable mechanical component | PartDesign::Body plus create_feature |
Use scripted Part for compact deterministic CSG without feature-history requirements. |
| Simple primitive or supported object | create_object |
Use create_feature(kind="primitive") when it must live inside a Body. |
| Several independent objects | create_objects |
Use sequential calls when one object depends on a returned name. |
| Constrained feature profile | create_feature(kind="sketch"), then edit_sketch |
Use scripted geometry only for unsupported sketch operations. |
| Native PartDesign feature | create_feature or edit_feature |
Use edit_object only when the typed feature API does not cover the property. |
| Existing native property change | edit_object or edit_objects |
Use edit_parameters for dynamic properties and expressions. |
| Independent scalar parameters | Supported App::VarSet plus edit_parameters |
Use Spreadsheet::Sheet when formulas, aliases, or a parameter table matter. |
| Stable exact CSG | create_object with Part::Cut (Base/Tool links) or Part::MultiFuse (Shapes), gated by expected_solids/expected_bounds, then validate_geometry |
Use run_script only for other Part shape operations; query targets are refused in Base/Tool. |
| Imported STEP or STL | import_model |
Use run_script only for unsupported formats or mesh repair. |
| Fit or interference decision | measure plus validate_geometry |
Use inspect_topology first when a specific face or edge matters. |
| Manufacturing output | export |
Do not use ad hoc writer code for STL, STEP, 3MF, or FCStd. |
Prefer origin planes, datum geometry, named parameters, and master sketches. Avoid generated face and edge references when an upstream edit can change topology.
Use the tools in canonical order
Use the phases below as the default call order. Use tools/list for the live enabled tool surface and schemas.
- Discover:
discover_capabilities. - Resolve documents:
inspect_documents,new_document,open_document,import_model,save_document,close_document,reload_document. - Resolve objects:
inspect_objects,inspect_user_context. - Mutate objects:
create_object,create_objects,edit_object,edit_objects,delete_object. - Prove geometry:
validate_geometry,measure,inspect_topology. - Control parameters:
edit_parameters. - Control sketches:
inspect_sketch,edit_sketch. - Control PartDesign:
create_feature,edit_feature. - Deliver or analyze:
export,capture_view,run_fem. - Escape only when required:
run_script.
This list covers every registered tool. Read the exact tool matrix before the first unfamiliar group call.
The protocol also provides server/discover, tools/list, tasks/get, tasks/update, tasks/cancel, resources/list, resources/read, and subscriptions/listen. Use tools/list for the live schemas. Poll detached measure, export, run_fem, or run_script calls with tasks/get until terminal. Treat cancellation as cooperative.
Apply tool-use rules
- Use structured tools before
run_script. - Use
run_scriptonly for a named unsupported operation. - Keep each script short, deterministic, and idempotent when possible.
- Never send unverified native
Sketcher.Constraintconstructor forms. - Use
create_objectsonly for independent entries. - Read
nameMappingbefore you create links between batch-created objects. - Use
edit_objectsfor one atomic multi-object change. - Write spreadsheet cells only through
properties.cellswith address or alias keys. - Require
cellContentsPersisted: trueafter a spreadsheet write. - Pass
expected_generationon object, sketch, or feature edits after an earlier inspection. - Pass
expected_solidsandexpected_boundswhen the design determines them. - Read bounds as feature results: a PartDesign pad or pocket reports the cumulative Body result, not only the material it added or removed. Establish orientation from geometry and explicit axes, never from object labels. Verify wall thickness with
measure(faces or section) orinspect_topologybefore attributing a parameter value to a specific wall. After locating the relevant objects in an existing model, capture onecapture_viewoverview before reasoning about placement, and narrow further reads to those objects withobjectsplusdetail: "full"andproperty_filter. - Address topology with the shared targets: whole object
{"object":"Name"}, signed reference{"object":"Name","subelement":"<token>"}taken frominspect_topologyorinspect_user_contextrows, or declarative query{"object":"Name","query":[{"role":"face","selector":">Z"}]}. - Reuse one query descriptor across
measuretargets,create_featuresubelement lists, link properties such as FEMReferences, andcapture_viewfocus. A consumer that needs exactly one shape refusesselection_emptyorselection_ambiguous; a set consumer expands the matches and reportsresolvedSelectionsreceipts carrying the selection-time generation. - Selectors use the bounded CadQuery grammar. Named views keep CadQuery meanings, not FreeCAD camera names: front=>Z, back=<Z, left=<X, right=>X, top=>Y, bottom=<Y. Never send a raw
FaceN/EdgeNlabel as durable input; sign it throughinspect_topologyfirst. - Omit
response_detailanddetailfor compact results; pass"full"explicitly when before/after deltas matter. edit_featureedits nine kinds:pad,pocket,hole,gear_profile,fillet,chamfer,linear_pattern,polar_pattern,revolve.- Use document-space bounds:
[xmin,ymin,zmin,xmax,ymax,zmax]. - Use plain numbers for mapped quantity properties.
- Use quantity strings only where the schema requires strings, such as sketch datums or FEM material maps.
- Treat
close_documentas discard, never save. - Re-read persistence-sensitive changes after recompute or save.
- Do not delete objects with unresolved dependents.
- Do not issue more GUI calls after
GUI_DISPATCH_STUCK. - Before you interpret "this", "these", selected entities, or a screen-relative reference, call
inspect_user_contextand read its reported selection and view. Pass its returned targets explicitly into the next tool; a selection report is not authorization. - Request the context image (
include_image: true) when you must interpret what the user currently sees.capture_viewreframes the scene, so it does not show the user's viewport.inspect_user_contextreports state at call time, not at message time; re-inspect after a relevant generation change or when the user asks you to change the selection. - Read
inspect_user_contextunavailablemarkers as missing evidence, not negative answers; a null without a marker is genuine empty state. Entries cap at 64 rows; readcountandtruncatedbefore you assume the whole selection is reported. - Native
FaceN/EdgeNnames in a context report are diagnostics, not durable targets. When the observation stays ambiguous, ask one specific clarification question instead of guessing.
Build with checkpoints
Build in this dependency order:
- Create the document and base form.
- Create stable references and profiles.
- Add additive features.
- Add subtractive features.
- Add patterns and transforms.
- Add thickness, fillets, and chamfers late.
- Set final placement and visibility.
- Validate and save the stage.
Use one transaction-sized tool call per coherent stage. Do not place the whole design in one long script. Save the last valid FCStd state before high-cost features.
Prefer sketch arcs for stable corner radii. Generated-edge fillets and chamfers can break after topology-changing upstream edits.
Validate before delivery
Require all applicable evidence:
- The final object has no
Invalid,Error, orTouchedstate. validate_geometryreports a valid shape.- The solid count matches the design.
- The volume is positive when a solid is required.
- The bounds match the design within a stated tolerance.
measure(mode="difference")reports the added or removed material when a change must be quantified (difference_volumeis the material ofathatbdoes not cover; an empty result reportsdifference_volume0 with null bounds).measure(mode="distance")confirms clearance magnitude andmeasure(mode="interference")confirms no volumetric overlap, or record both decisions in onevalidate_geometrycall withchecks:clearance_minpasses only when distance >= min AND the common volume is zero;interference_maxpasses when the common volume <= max.capture_viewinoverviewmode confirms the requested form and placement;interior/fitsupplement where internal features matter.- The export readback matches the source bounds and solid intent.
A positive distance alone does not prove separation. A zero common volume does not prove clearance; it is contact evidence only. Use both measure modes, or validate_geometry with clearance_min plus interference_max, for mating parts.
For FFF output, read references/printability.md before final geometry. Choose the build orientation before overhang-sensitive features. Mark unsourced fit values and uncalibrated clearances as assumptions.
Handle failures
Read details.reason first. If details.nextTool exists, call that tool. Never call a details.nextAction value as a tool.
After an uncertain timeout, inspect state before retrying. A timed-out GUI operation can still complete and duplicate a repeated mutation. After GUI_DISPATCH_STUCK, call only GUI-independent discover_capabilities until health returns.
run_script is opt-in arbitrary Python with the FreeCAD user’s privileges. Never place credentials or untrusted code in it. Never print the bearer token.
Finish with a compact report
Report:
- The document and final internal object names.
- The chosen representation and important named parameters.
- The validation result, solid count, volume, and bounds.
- The fit measurements and tolerance when applicable.
- The saved FCStd path and export readback.
- The print orientation and assumptions when applicable.
- Any unverified behavior or blocked operation.