An MCP (Model Context Protocol) server that exposes Ansys Zemax OpticStudio to Claude Code as a set of named, self-describing tools. Each tool couples one or a few ZOS-API operations with a clear feature description, so Claude can discover and call them directly.
Server has 14 tools with consistent naming (verb_noun pattern: zemax_*) and reasonable descriptions (50-200 chars). All tools have input schemas with types. However, critical gaps: (1) No output schemas documented, LLMs cannot predict return structure; (2) Parameter descriptions are minimal (10-30 chars) and lack constraints/ranges; (3) No error handling guidance, tools return generic dicts without recovery hints; (4) Missing enum constraints on string parameters (aperture_type, field_type, cell); (5) No idempotency or confirmation patterns for destructive ops (save, disconnect, delete surfaces). Naming is clear but descriptions could be more LLM-optimized per pattern:tool-description baseline (194 chars avg).
Connect to OpticStudio. mode="extension": attach to the ALREADY-RUNNING OpticStudio GUI (edits appear live). First enable Programming > Interactive Extension in OpticStudio. mode="standalone": launch a fresh HEADLESS OpticStudio (needs Pro/Premium license). Returns license edition, serial, and current system info.
Drop the ZOS-API connection. In standalone mode this closes the headless process.
Report the current connection: mode, license edition, serial, open file, seq/nonseq.
Insert a new surface at the given 0-based position in the Lens Data Editor.
Edit a surface (0-based index). Any omitted parameter is left unchanged. Set material='' for air. Use this to build a prescription surface by surface.
Return a compact table of every surface: index, comment, radius, thickness, material, semi-diameter. This is the sequential 'prescription' at a glance.
No output schemas documented. LLMs cannot predict return structure (e.g., zemax_lde_summary returns 'rows' array but structure is not declared). Agents cannot plan downstream calls or extract fields reliably.
String parameters lack enum constraints. aperture_type, field_type, and cell accept free-form strings (e.g., 'EntrancePupilDiameter', 'Angle', 'radius') but no enum is declared. LLMs will hallucinate invalid values.
Parameter descriptions are too brief (10-30 chars).
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | D | 56 | 2026-07-28+ | v2 |
Run the Optimization (Merit Function) Wizard to build a default merit function. optimization_goal is informational; the wizard defaults target RMS wavefront/spot. Returns the resulting merit function value.
Start a new, empty optical system. sequential=False starts in non-sequential mode.
Open a .zmx / .zos lens file (Windows path).
Save the current system. If path is given, Save-As to that path.
Set the System Aperture. aperture_type is a ZOSAPI SystemData.ZemaxApertureType name, e.g. 'EntrancePupilDiameter', 'ImageSpaceFNum', 'ObjectSpaceNA', 'FloatByStopSize'. value is the aperture value in the type's units.
Set field points. field_type is 'Angle', 'ObjectHeight', 'ParaxialImageHeight', or 'RealImageHeight'. points is a list of [x, y] field coordinates.
Make a Lens Data cell a VARIABLE for optimization. cell is 'radius', 'thickness', or 'conic'. (Variables are what the optimizer is allowed to change.)
Replace the wavelength set with the given values (in micrometers). 'primary' is the 1-based index of the primary wavelength.
No error handling guidance. Tools return generic dicts on success but no recovery hints on failure. E.g., zemax_connect could fail if OpticStudio is not running or Programming > Interactive Extension is disabled, but no error message guides the LLM to fix it.
Destructive operations (zemax_disconnect with save=true, zemax_save_file) lack confirmation or dry-run patterns. An LLM could accidentally overwrite a file or lose unsaved work without a chance to confirm.