How SolidCraft MCP Connects AI Agents to Parametric CAD
Unlike mesh-only text-to-3D generators that output non-editable triangle soup, SolidCraft ships with a native Model Context Protocol (MCP) server built directly into solidcraft-cli. When you connect Claude Code, Claude Desktop, OpenAI Codex CLI, or Cursor IDE, the AI assistant executes the exact same B-rep engine commands as the desktop toolbar—creating constrained 2D sketches, extruding exact solids, applying fillets, measuring clearances, exporting STEP/3MF/STL, and saving an editable feature timeline locally.
For upstream protocol and engine command specs, see the official SolidCraft MCP guide on solidcraft.io and the tangency-labs/solidcraft docs/mcp.md reference on GitHub.
Step-by-Step Setup for Claude Code, Claude Desktop, Codex & Cursor
- Install SolidCraft & Verify
solidcraft-cli: Install the official desktop package or CLI binary using our SolidCraft Install Guide, then verify your terminal can find the binary by runningsolidcraft-cli --version. - Try Automatic Setup (Optional Shortcut): SolidCraft includes a built-in setup helper—preview detected clients safely with
solidcraft-cli mcp setup --dry-run, then runsolidcraft-cli mcp setupto write configs automatically. - Or Generate Your Exact Configuration Above: Select your AI client (Claude Code, Claude Desktop, OpenAI Codex CLI, or Cursor IDE) and operating system in the interactive generator at the top of this page, set your workspace directory, and click Copy Configuration.
- Apply the Config & Restart Your Client:
- Claude Code (CLI): Run
claude mcp add solidcraft -- solidcraft-cli mcp .inside your CAD workspace directory. On Windows, quote the full path tosolidcraft-cli.exeso stdio launching succeeds reliably. - Claude Desktop (JSON): Merge the
mcpServers.solidcraftJSON block intoclaude_desktop_config.json, then completely quit and relaunch Claude Desktop so the stdio server initializes. - OpenAI Codex CLI (
solidcraft mcp codex): Register directly viacodex mcp add solidcraft -- solidcraft-cli mcp ., or add the[mcp_servers.solidcraft]block generated above to~/.codex/config.toml. - Cursor IDE: Save the JSON output to
.cursor/mcp.jsonin your project root, open Cursor Settings → MCP, and confirm thesolidcrafttool list turns green.
- Claude Code (CLI): Run
- Run a Verification Prompt: Copy one of the starter parametric prompts above—or customize millimeter dimensions in our SolidCraft CLI & Parametric Prompt Builder—and confirm the agent creates a
.scfile and reports exact bounding-box dimensions back to you.
Headless Mode vs. Live Desktop Bridge (solidcraft-cli)
Because SolidCraft's MCP server sits directly on top of solidcraft-cli, you can choose between headless automation and live visual collaboration:
- Headless Mode (
solidcraft-cli mcp): Runs an isolated stdio session with zero GUI overhead—ideal for Git-tracked hardware scripts, batch exports, and fast generation. - Load Existing Project (
solidcraft-cli mcp --in part.sc): Starts the MCP session with an existing.scfile already loaded so Claude or Codex modifies your current part cleanly. - Live GUI Bridge (
solidcraft --control 7878 &+solidcraft-cli mcp --connect 127.0.0.1:7878): Connects your AI client to the open desktop app so you watch sketches, extrusions, and fillets appear live in the 3D viewport. See our complete SolidCraft CLI Cheat Sheet for full examples.
Prompt Engineering Tips for Reliable SolidCraft MCP Parts
Getting clean, printable geometry on the first prompt works best when you speak like a mechanical engineer rather than a concept artist:
- Declare Units & Named Parameters First: Always specify millimeters (
mm) and ask the agent to define named parameters (wall_thickness = 2.4,bolt_dia = 3.2,mount_spacing = 31.0) before drawing sketches so later revisions take one edit. - Build Feature by Feature: Ask the agent to create the base plate extrusion first, verify bounding-box dimensions, then add mounting bores, standoffs, and edge fillets last. Applying fillets at the end prevents downstream sketch-reference issues.
- Include 3D-Printing Clearances Explicitly: Tell Claude or Codex your printer tolerance (for example,
add 0.2mm clearance to M3 through-holes so 3.2mm diameterorleave 0.3mm radial gap for snap-fit lids). - Request Verification & Export: End your prompt with "Measure the final bounding box, verify wall thickness is at least 2.4mm everywhere, save the
.scfile, and export a.stepor.3mffile for OrcaSlicer."
Troubleshooting Common SolidCraft MCP Errors
solidcraft-cli: command not foundorENOENT: GUI clients like Claude Desktop often launch with a minimal systemPATHthat excludes Homebrew or custom user folders. Switch to an absolute executable path—C:\Program Files\SolidCraft\solidcraft-cli.exeon Windows,/opt/homebrew/bin/solidcraft-clion Apple Silicon Macs, or/usr/local/bin/solidcraft-clion Intel Macs.- Files Saved in an Unexpected Directory: Avoid passing a bare
.inside global config files likeclaude_desktop_config.jsonor~/.codex/config.toml. Instead, enter an explicit folder path (such as/Users/you/cad-projectsorC:\Users\you\cad-projects) in the Workspace Folder field above. - Client Shows Server Connected but No Tools Appear: Make sure your
solidcraft-clibinary is up to date from the official GitHub Releases page and test runningsolidcraft-cli mcpbriefly in a terminal to verify it starts cleanly without missing library errors. - Also Using FreeCAD With Claude or Codex? Compare setup and RPC bridge workflows in our FreeCAD MCP Setup Guide, or read SolidCraft vs FreeCAD vs Fusion 360 and return to the SolidCraft Guide.