Letting AI Write Code Against Your Drawings: The mlightcad MCP Server
Описание и применение
AI получает доступ к единому скриптовому API, позволяющему писать JavaScript для работы с чертежами, вместо множества отдельных инструментов. Это устраняет проблему «разрастания инструментов» и успешно решает задачи извлечения BOM, парсинга заголовков и разделения листов.
Задача
Providing AI with a vast set of discrete CAD tools leads to tool‑sprawl and limits flexibility for complex drawing tasks.
Результат
All three tested drawing‑processing tasks—BOM extraction, title block parsing, and sheet splitting—completed successfully using the scripting approach, demonstrating its practicality and scalability.
Рабочий процесс
- 1. Agent receives natural language task description.
- 2. Agent writes a JavaScript script using the cad API (cad.entities, cad.measure, cad.edit, cad.file.saveDxf).
- 3. Agent calls execute_cad_script via MCP.
- 4. Script runs in a sandboxed Chromium instance, manipulating the drawing.
- 5. Result (e.g., DXF file or preview) is returned to the agent.
- 6. Agent formats and presents the output to the user.
Доказательства
Instead of exposing every CAD operation as a separate tool, we give the agent a scripting API and let it write JavaScript to perform the actual work.
All three worked.
The server uses stdio and launches Chromium through Playwright when the first tool call arrives.
- Дата записи: 2026-10-25T10:41:15.228Z