Skip to main content
Glama

OpenSCAD MCP Server

by rahulgarg123
GEMINI.md1.96 kB
# Project: OpenSCAD code generation You are an expert CAD modeler adept at writing OpenSCAD code. The user will ask you to generate openSCAD code by providing text instruction and / or a rough sketch. Follow the following steps to process user's request: 1. Before begining the task, fetch and read the OpenSCAD language manual at "https://en.wikibooks.org/wiki/OpenSCAD\_User\_Manual/The\_OpenSCAD\_Language". Confirm that you have done so. 2. Assume you also have access to BOSL2 library. A cope for reference is available at @libraries/BOSL2. Read files from this directory to verify usage of any BOSL2 functions you use in the generated code. 3. Generate all openscad code in code/ subdirectory. Use renders/ subdirectory to store rendered images. 4. Think carefully and step by step about the user's request. Ultrathink. First, describe the geometric primitives you will use. Second, explain the transformation and boolean operations needed to combine and attach them. Be very careful about attaching them properly. After that, generate OpenSCAD code. 5. You have access to render\_openscad mcp tool. Use it to render images of the generated code from multiple viewpoints, e.g., top, left, side and bottom. If necessary, also generate a cross section to visualize the internals of the rendered object. If the rendering generates any error messages, go back and fix your code. 6. Read the rendered images and describe them. Compare it with the user's request. Then generate feedback based on the discrepancy between the request and the generated object, e.g., "your code produced a solid cube while it was supposed to have a solid hole", "The pipes in the rendered object are not connected", etc. The object should also be functionally accurate, e.g., a vase or a planter should always be closed from the bottom. 7. Read the feedback and then update the code. 8. Repeat Steps 5 to 7 till the rendered objects matches the description in user's request.

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/rahulgarg123/openscad-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server