Get the FREE Ultimate OpenClaw Setup Guide →

OpenSCAD

Devin's attempt at creating an OpenSCAD MCP Server that takes a user prompt and generates a preview image and 3d file.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio jhacksman-openscad-mcp-server python src/main.py \
  --env GEMINI_API_KEY="Google Gemini API key" \
  --env VENICE_API_KEY="Venice.ai API key (optional)" \
  --env REMOTE_CUDA_MVS_API_KEY="Shared secret/key for authenticating remote CUDA MVS operations" \
  --env REMOTE_CUDA_MVS_ENABLED="Enable remote CUDA MVS processing (true/false)" \
  --env REMOTE_CUDA_MVS_SERVER_URL="Explicit URL for a remote CUDA MVS server (if not using LAN discovery)" \
  --env REMOTE_CUDA_MVS_USE_LAN_DISCOVERY="Discover remote CUDA MVS servers on LAN (true/false)"

How to use

This MCP server orchestrates image generation, multi-view reconstruction, and OpenSCAD-based parametric modeling to produce 3D models from prompts or images. You can generate images via Google Gemini or Venice.ai, create multiple views of a model for reconstruction, approve images in an workflow, and then reconstruct a 3D model using CUDA Multi-View Stereo (MVS). OpenSCAD code is generated to preserve parametric properties, and models can be exported in formats like CSG, AMF, 3MF, and SCAD. Additionally, the server can discover printers on the network and send print jobs when configured. To start, run the MCP server (for example with Python) and access the web interface at http://localhost:8000. Use the provided MCP tool calls to interact with the server: generate_image_gemini creates an image via Gemini; generate_multi_view_images creates several views of a given object; create_3d_model_from_images builds a model from approved views; create_3d_model_from_text runs the full text-to-model pipeline; export_model saves or converts the model to a chosen format; discover_printers and print_model handle network printer interactions.

How to install

Prerequisites:\n- Python 3.8+ installed on your system\n- Git installed\n- OpenSCAD installed on your machine (for parametric modeling)\n- CUDA Toolkit and CUDA-enabled GPU for CUDA MVS (optional if using remote processing)\n\nStep-by-step installation:\n1) Clone the repository and navigate into it:\nbash\ngit clone https://github.com/jhacksman/OpenSCAD-MCP-Server.git\ncd OpenSCAD-MCP-Server\n\n2) Create and activate a virtual environment:\nbash\npython -m venv venv\n# On macOS/Linux\nsource venv/bin/activate\n# On Windows\venv\Scripts\activate\n\n3) Install dependencies:\nbash\npip install -r requirements.txt\n\n4) Install OpenSCAD:\n- Ubuntu/Debian: sudo apt-get install openscad\n- macOS: brew install openscad\n- Windows: https://www.openscad.org/downloads.html\n```\n5) Install CUDA Multi-View Stereo (if using remote processing):\nbash\ngit clone https://github.com/fixstars/cuda-multi-view-stereo.git\ncd cuda-multi-view-stereo\nmkdir build && cd build\ncmake ..\nmake\n\n6) Optional: set up environment variables and API keys:\nbash\n# In root project, create .env or export variables as needed:\nGEMINI_API_KEY=your-gemini-api-key\nVENICE_API_KEY=your-venice-api-key # Optional\nREMOTE_CUDA_MVS_ENABLED=True\nREMOTE_CUDA_MVS_USE_LAN_DISCOVERY=True\nREMOTE_CUDA_MVS_API_KEY=your-shared-secret-key\n\n7) Run the server:\nbash\npython src/main.py\n

Additional notes

Environment variables documented in mcp_config can be customized per deployment. If you plan to use remote CUDA MVS, ensure the remote server is properly configured and accessible, and that the shared API key is kept secure. OpenSCAD must be installed for parametric model generation and exporting. If CUDA MVS is not available, you can still generate and export OpenSCAD code, but 3D reconstruction will be limited to non-CUDA pathways. When using remote processing, consider enabling LAN discovery for automatic server detection, and provide a direct SERVER_URL if you prefer explicit connections. If you encounter issues with API keys, verify network access and key permissions, and ensure the environment is loaded in the process running the MCP server (e.g., the venv is activated).

Related MCP Servers

Sponsor this space

Reach thousands of developers