Skip to main content
Glama
quellant

OpenSCAD MCP Server

by quellant

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
OPENSCAD_PATHNoPath to OpenSCAD executable/usr/bin/openscad
MCP_SERVER_NAMENoMCP server nameopenscad-mcp
OPENSCAD_TIMEOUTNoTimeout for rendering operations (seconds)30
MCP_SERVER_VERSIONNoMCP server version1.0.0
MCP_SERVER_TRANSPORTNoTransport: stdio, sse, or httpstdio
MCP_RENDER_DEFAULT_WIDTHNoDefault image width800
MCP_RENDER_DEFAULT_HEIGHTNoDefault image height600
MCP_RENDER_MAX_CONCURRENTNoMax concurrent renders4

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tasks
{
  "list": {},
  "cancel": {},
  "requests": {
    "tools": {
      "call": {}
    },
    "prompts": {
      "get": {}
    },
    "resources": {
      "read": {}
    }
  }
}
tools
{
  "listChanged": true
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
render_singleA

Render a single view from OpenSCAD code or file.

Args: scad_content: OpenSCAD code to render (mutually exclusive with scad_file) scad_file: Path to OpenSCAD file (mutually exclusive with scad_content) view: Predefined view name ("front", "back", "left", "right", "top", "bottom", "isometric", "dimetric") camera_position: Camera position - accepts [x,y,z] list, JSON string "[x,y,z]", or dict {"x":x,"y":y,"z":z} (default: [70, 70, 70]) camera_target: Camera look-at point - accepts [x,y,z] list, JSON string, or dict (default: [0, 0, 0]) camera_up: Camera up vector - accepts [x,y,z] list, JSON string, or dict (default: [0, 0, 1]) image_size: Image dimensions - accepts [width, height] list, JSON string "[width, height]", "widthxheight", or tuple (default: [800, 600]) color_scheme: OpenSCAD color scheme (default: "Cornfield") variables: Variables to pass to OpenSCAD auto_center: Auto-center the model quality: Quality preset - "draft" (fast, low detail), "normal" (OpenSCAD defaults), or "high" (slow, high detail). User-provided variables override quality preset values. include_paths: Additional include paths for OpenSCAD via the OPENSCADPATH environment variable, enabling multi-file project support ctx: MCP context for logging

Returns: List containing the rendered PNG image and metadata

render_perspectivesA

Render multiple standard views of an OpenSCAD model in a single call.

Renders the model from several predefined camera perspectives in parallel, returning all images at once. Useful for generating a comprehensive visual overview of a 3D model.

Args: scad_content: OpenSCAD code to render (mutually exclusive with scad_file) scad_file: Path to OpenSCAD file (mutually exclusive with scad_content) views: List of view names to render. Valid names: "front", "back", "left", "right", "top", "bottom", "isometric". If not specified, renders all standard views. image_size: Image dimensions - accepts "widthxheight", "width,height", "[width, height]", or [width, height] list (default: [800, 600]) color_scheme: OpenSCAD color scheme (default: "Cornfield") variables: Variables to pass to OpenSCAD via -D flags quality: Quality preset - "draft" (fast, low detail), "normal" (OpenSCAD defaults), or "high" (slow, high detail). User-provided variables override quality preset values. include_paths: Additional include paths for OpenSCAD via the OPENSCADPATH environment variable, enabling multi-file project support ctx: MCP context for logging

Returns: List of rendered PNG images and metadata

check_openscadA

Verify OpenSCAD installation and return version info.

Args: include_paths: Include searched paths in response ctx: MCP context for logging

Returns: Dict with OpenSCAD installation information

export_modelA

Export OpenSCAD code or file to STL, 3MF, AMF, OFF, DXF, or SVG.

Args: scad_content: OpenSCAD code to export (mutually exclusive with scad_file) scad_file: Path to OpenSCAD file (mutually exclusive with scad_content) output_format: Export format - "stl", "3mf", "amf", "off", "dxf", or "svg" (default: "stl") output_path: Path to write the exported file. If not specified, a temp directory is used. variables: Variables to pass to OpenSCAD via -D flags include_paths: Additional include paths for OpenSCAD via the OPENSCADPATH environment variable ctx: MCP context for logging

Returns: Dict with success status, output_path, format, and file_size_bytes

create_modelA

Create a new OpenSCAD model file.

Args: name: File name for the model (alphanumeric, hyphens, underscores; .scad extension added automatically if missing) content: OpenSCAD source code for the model workspace: Directory to save the model in. Defaults to the configured temp_dir/models directory. ctx: MCP context for logging

Returns: Dict with success status, path, and name of the created file

get_modelA

Read an OpenSCAD model file and return its contents.

Args: name: File name of the model to read workspace: Directory containing the model. Defaults to the configured temp_dir/models directory. ctx: MCP context for logging

Returns: Dict with success status, name, content, path, and size_bytes

update_modelA

Update an existing OpenSCAD model file with new content.

The file must already exist. Use create_model to create new files.

Args: name: File name of the model to update content: New OpenSCAD source code for the model workspace: Directory containing the model. Defaults to the configured temp_dir/models directory. ctx: MCP context for logging

Returns: Dict with success status, path, and name of the updated file

list_modelsA

List all OpenSCAD model files in the workspace directory.

Args: workspace: Directory to list models from. Defaults to the configured temp_dir/models directory. ctx: MCP context for logging

Returns: Dict with success status, list of models (name, path, size_bytes, modified), and count

delete_modelA

Delete an OpenSCAD model file from the workspace.

The file must exist. Returns the path of the deleted file.

Args: name: File name of the model to delete workspace: Directory containing the model. Defaults to the configured temp_dir/models directory. ctx: MCP context for logging

Returns: Dict with success status, name, and deleted_path

validate_scadA

Syntax-check OpenSCAD code without performing a full render.

Runs OpenSCAD with output directed to /dev/null (NUL on Windows) so it only parses and evaluates the code without generating geometry output. Much faster than a full render. Captures and categorizes ECHO, WARNING, ERROR, and DEPRECATED messages from stderr.

Args: scad_content: OpenSCAD code to validate (mutually exclusive with scad_file) scad_file: Path to OpenSCAD file to validate (mutually exclusive with scad_content) variables: Variables to pass to OpenSCAD via -D flags include_paths: Additional include paths for OpenSCAD via the OPENSCADPATH environment variable ctx: MCP context for logging

Returns: Dict with success status, valid flag, errors list, warnings list, echo_output list, and deprecated list

analyze_modelA

Extract geometric information from an OpenSCAD model.

Exports the model to a temporary STL file, then parses vertex data to compute bounding box, dimensions, center point, and triangle count. The temporary STL is cleaned up after parsing.

Args: scad_content: OpenSCAD code to analyze (mutually exclusive with scad_file) scad_file: Path to OpenSCAD file to analyze (mutually exclusive with scad_content) variables: Variables to pass to OpenSCAD via -D flags include_paths: Additional include paths for OpenSCAD via the OPENSCADPATH environment variable ctx: MCP context for logging

Returns: Dict with success status, bounding_box (min/max xyz), dimensions (width/height/depth), center point, and triangle_count

get_librariesA

Discover installed OpenSCAD libraries on the system.

Searches standard OpenSCAD library paths for the current platform, plus the OPENSCADPATH environment variable. For each found library directory, lists subdirectories as libraries and reports file counts, README presence, and main entry files.

This is a read-only operation that does not require OpenSCAD to be installed.

Args: ctx: MCP context for logging

Returns: Dict with success status, library_paths searched, and libraries list with name, path, file_count, has_readme, and main_files for each library

compare_rendersA

Render two versions of a model for visual comparison.

Supports two modes:

  1. Two different SCAD contents: provide scad_content_before and scad_content_after.

  2. Same file with different variables: provide scad_file with variables_before and variables_after.

Both versions are rendered in parallel for efficiency. Uses the existing render_scad_to_png helper and QUALITY_PRESETS.

Args: scad_content_before: OpenSCAD code for the "before" version scad_content_after: OpenSCAD code for the "after" version scad_file: Path to OpenSCAD file (used with variable diffs) variables_before: Variables for the "before" render variables_after: Variables for the "after" render view: View preset name (default: "isometric"). Valid names: "front", "back", "left", "right", "top", "bottom", "isometric", "dimetric" image_size: Image dimensions - accepts "widthxheight", "width,height", "[width, height]", or [width, height] list (default: [800, 600]) quality: Quality preset - "draft", "normal", or "high" (default: "draft") ctx: MCP context for logging

Returns: List with before/after images and metadata

clear_cacheA

Delete all cached render files and report freed space.

Removes every .png file from the configured cache directory. Does nothing (and still reports success) when the cache is disabled or the directory does not exist.

Args: ctx: MCP context for logging

Returns: Dict with success status, cleared_files count, and freed_bytes

get_project_filesA

List all OpenSCAD files in a project directory and map their dependencies.

Recursively finds every .scad file under project_dir, parses each file for include and use statements, and returns a structured overview of the project's file tree and dependency graph.

Args: project_dir: Root directory of the OpenSCAD project. Validated against security.allowed_paths when configured. ctx: MCP context for logging

Returns: Dict with success status, files list (each with name, path, size_bytes, modified), and dependencies mapping (relative path to list of dependency strings).

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription
get_server_infoGet server configuration and capabilities.

Latest Blog Posts

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/quellant/openscad-mcp'

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