CAD to Print MCP
Allows inspecting FreeCAD .FCStd documents and exporting named solids to STL for downstream slicing and printing workflows.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@CAD to Print MCPexport the bracket from my FreeCAD doc, slice it, then upload the G-code"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
CAD to Print MCP
A local MCP server that lets Codex and other MCP clients move a design through FreeCAD → STL → OrcaSlicer configuration → G-code → Moonraker printer. It uses stock OrcaSlicer's command-line interface and keeps every exported STL, derived preset, slice manifest, and G-code in a separate output location.
What it does
Inspect a FreeCAD
.FCStddocument and export a named solid to STL.Find, inspect, and derive OrcaSlicer machine, process, and filament presets. Derived presets are copies; originals stay untouched.
Preview and run a slice with specified presets and settings. Each run records input hashes, command arguments, effective settings, logs, and output artifacts.
Read G-code metadata, query a Moonraker printer, upload G-code, and start an uploaded print as a distinct step.
It does not edit the open OrcaSlicer GUI, paint supports, create CAD geometry from a text description, or control printers other than Moonraker yet. Agents can use their own CAD tools to create .FCStd files before using this server. OrcaSlicer itself is not bundled.
Related MCP server: FreeCAD Robust MCP Server
Requirements
Python 3.10 or newer
FreeCAD with
FreeCADCmdfor.FCStdinspection/exportOrcaSlicer with command-line mode
Optional: a printer running Moonraker for status, upload, and print start
The server runs locally over MCP stdio. It does not open a listening port.
Install
git clone https://github.com/Kayrim/cad-to-print-mcp.git
cd cad-to-print-mcp
py -3 -m venv .venv
.\.venv\Scripts\python.exe -m pip install -e .On macOS/Linux, use python3 -m venv .venv and .venv/bin/python -m pip install -e ..
Set these environment variables in your MCP client or shell:
Variable | Purpose |
| Path to |
| Path to |
| Optional user profile directory override |
| Optional output directory; defaults to |
| Moonraker URL, such as |
| Optional Moonraker API key; never put it in a repository |
Connect Codex
Use the Python executable from your new virtual environment. On Windows:
codex mcp add cad-to-print -- "C:\absolute\path\to\cad-to-print-mcp\.venv\Scripts\python.exe" -m cad_to_print_mcp.server
codex mcp listFor other MCP clients, configure a local stdio server with the same executable and -m cad_to_print_mcp.server arguments. Restart the client after adding it.
Example agent workflow
check_setupandinspect_freecad_documentto choose the printable solid.export_freecad_stlto create a mesh from the chosen FreeCAD object.find_profilesfor compatible machine, process, and filament presets.read_profileandderive_profilecan make a variant with support, infill, speed, or other settings.preview_slice, thenrun_slice. Or callprepare_print_jobto export the selected FreeCAD object and slice it in one step. Review the manifest, logs, and generated G-code. The preset files should match the actual printer, nozzle, material, and firmware.get_printer_status, thenupload_print_file. Uploading alone never starts a print.When ready, call
start_uploaded_printusing the returned upload ID. It refuses to start while the printer reports an active or paused job.
The run_slice tool accepts a .3mf with embedded settings or an STL/OBJ/STEP with all three preset JSON files. Common overrides such as layer_height, enable_support, support_type, sparse_infill_density, and wall_loops are directly validated. For other settings, derive a copy of a bundled preset and pass that copy to run_slice. OrcaSlicer validates the resulting configuration during slicing.
Safety and privacy
The server never runs shell commands assembled from tool inputs. It invokes FreeCAD and OrcaSlicer with argument arrays.
It never edits original CAD files or OrcaSlicer presets.
derive_profilerefuses script, G-code, print host, and credential fields.read_profileredacts credentials.upload_print_fileandstart_uploaded_printare separate calls. Print start checks that Klipper is ready and no job is active.Generated files and manifests can contain model names and local paths. The
outputs/directory is Git-ignored.Review G-code and printer preparation before starting a physical print. The server cannot check bed clearance, filament loading, or hardware condition.
Development
.\.venv\Scripts\python.exe -m unittest discover -s tests -vTests use local fixtures and mocked process/printer calls. A live smoke test should be run with your own FreeCAD, OrcaSlicer, presets, and Moonraker setup before printing. See docs/architecture.md for the adapter boundaries and roadmap.
License
MIT. This project is independent of FreeCAD, OrcaSlicer, and Moonraker.
This server cannot be deployed
Maintenance
Related MCP Connectors
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Render, verify, describe, and safely edit Mermaid diagrams through MCP.
MCP server for progressive tool usage at any scale (see https://klavis.ai)
Create, browse, remix, collaborate on, and run durable AI workflow nodes from MCP hosts.
Related MCP Servers
- AlicenseBqualityAmaintenanceEnables interaction with 3D printer management systems through an MCP server, supporting STL file manipulation, slicing, and control of printers like OctoPrint, Klipper, Duet, and more.30393 npm243GPL 2.0
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with FreeCAD for 3D modeling, macros, and debugging via MCP.MIT
- AlicenseCqualityCmaintenanceEnables MCP clients to monitor a Creality K2 printer via live Moonraker state, camera snapshots, and print history, while also inspecting local G-code, 3MF projects, and installed Creality Print profiles to review or create slice plans.151MIT
- FlicenseNot gradedqualityBmaintenanceEnables AI clients to create, edit, and export CAD models and drawings in a locally installed FreeCAD via MCP.3-