cadcraft-electrical-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@cadcraft-electrical-mcp Create an IEC project for an S7-1200 with HMI and 4 valves, validate it, and build the PDF."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
cadcraft-electrical-mcp
Servidor MCP para generar planos eléctricos industriales con Claude y CADCraft.
Describe tu máquina en lenguaje natural ("PLC S7-1200, HMI KTP400, switch Balluff, 4 electroválvulas SMC, gabinete Spacial 500×400...") y Claude produce el juego completo de planos:
Esquemas eléctricos: portada con índice, potencia AC, control y distribución 24 VDC con referencias cruzadas y espejo de contactos, y hojas de E/S del PLC.
Layout de gabinete y platina: a escala 1:1 en un DXF de fabricación (con perforaciones y cotas) y a escala reducida en el juego de planos. Usa tus modelos 2D reales del fabricante.
Red PROFINET / Ethernet / IO-Link: topología con puertos y cables.
Plano de borneras, BOM, lista de cables, lista de E/S y lista de red en XLSX/CSV.
Validación normativa: designaciones, conflictos de E/S y de puertos, referencias cruzadas, espacio de reserva y encimamientos en la platina.
Todo cumple un perfil normativo configurable:
IEC: IEC 81346, 60617, 61082-1 y 60204-1.
IEC legado: códigos de una letra (-K/-F/-Q).
NFPA 79: escalera horizontal JIC/ANSI.
Los planos se generan como DXF y CADCraft los publica en PDF multipágina, PNG y DWG, y los puede abrir en vivo en la aplicación de escritorio.
Las funcionalidades traen ejemplos de instrucciones, la arquitectura incluye una guía de "si falla X, revisa Y", y hay una página con las normas y la configuración.
Cómo funciona
Claude ──MCP (stdio)──> cadcraft-elec-mcp
│ proyecto .elec.yaml (fuente de verdad, versionable en git)
│ → generadores → DXF determinista (ezdxf)
└──> CADCraft: cadcraft-cli (PDF / PNG / DWG / DWG→DXF)
cadcraft --control 7979 (abrir en la app viva)CADCraft ya trae su propio MCP genérico (
cadcraft-cli mcp) con primitivas de dibujo.Este servidor agrega la capa eléctrica que CADCraft no tiene: dispositivos, potenciales, bornes, E/S, cables, símbolos IEC/NFPA, cajetín, normas y validación.
El dibujo se hace en Python (ezdxf) en lugar de comando por comando en CADCraft (pre-alfa). Así el resultado es reproducible y probado, y CADCraft se usa para lo que hace mejor: renderizar, publicar y visualizar.
Related MCP server: THE_Studio5000_AI_Assistant_V35
Requisitos
Windows 10/11.
CADCraft 0.18 o superior (
cadcraft-0.18.0-windows-x64.msi).Una de estas dos opciones:
el ejecutable
cadcraft-elec-mcp.exede la página de Releases (no requiere Python);Python 3.11 o superior (con
uvopipx).
Instalación para el equipo
Opción A: script automático (recomendada)
git clone https://github.com/alfresonico666/cadcraft-electrical-mcp
cd cadcraft-electrical-mcp
powershell -ExecutionPolicy Bypass -File scripts\install.ps1El script:
Crea un entorno en
%LOCALAPPDATA%\cadcraft-elec-mcpe instala el paquete.Registra el servidor en Claude Code (alcance de usuario) y en Claude Desktop.
Opcionalmente registra también el MCP nativo de CADCraft (
-WithCadcraftMcp).
Al final ejecuta doctor para comprobar que todo responde.
Opción B: manual
# con uv
uv tool install git+https://github.com/alfresonico666/cadcraft-electrical-mcp
# o con pipx
pipx install git+https://github.com/alfresonico666/cadcraft-electrical-mcp
cadcraft-elec-mcp doctor # verifica CADCraft y la configuración
claude mcp add --scope user cadcraft-elec -- cadcraft-elec-mcpEn Claude Desktop, agrega esto a %APPDATA%\Claude\claude_desktop_config.json:
{ "mcpServers": { "cadcraft-elec": { "command": "cadcraft-elec-mcp", "args": [] } } }Con el .exe de Releases, usa la ruta completa del ejecutable como command.
Uso rápido
En Claude Code o Claude Desktop:
Crea el proyecto 26HA076 "Máquina LVDT" para un cliente automotriz con perfil IEC. Agrega un S7-1200 1214C DC/DC/DC, una HMI KTP400, una fuente de 24 VDC 10 A con su magnetotérmico, 4 electroválvulas SMC SY7320 en las salidas Q0.0–Q0.3 y 4 sensores inductivos en I0.0–I0.3 pasando por la bornera -XD3. Genera las hojas de potencia, 24 VDC, E/S y red, configura el gabinete NSYCRN54250P, valida y construye el PDF. Muéstrame la hoja de E/S.
Claude seguirá este flujo:
project_createlibrary_searchydevice_addsheet_addplc_io_assignyterminals_assign_ionetwork_linkcabinet_configurevalidateybuildsheet_preview
Los archivos quedan en Documentos\CadElec\<proyecto>\output\:
Archivo | Contenido |
| juego completo de hojas |
| platina 1:1 para taller (perforaciones, cotas) |
| BOM, cables, bornes, E/S, red |
| vistas previas |
Para ver el resultado en CADCraft: "ábrelo en CADCraft" (herramienta cadcraft_open).
Usar tus modelos 2D del fabricante
Importa
C:\...\Modelos\Siemens - PLC\PLC_Terminales.dxfcomo modelo del catálogosiemens-6es7214-1ag40-0xb0.
library_import_model hace lo siguiente:
convierte DWG a DXF con CADCraft;
quita ATTDEF de CADENAS, puntos de conexión y cotas;
normaliza a mm con la esquina en 0,0;
registra el modelo en tu catálogo.
Desde entonces, la platina dibuja el equipo real. Los modelos no se suben al repositorio (licencias de los fabricantes).
Ejemplo completo
examples/build_26ha076.py reproduce el proyecto 26HA076 completo (8 hojas):
python examples\build_26ha076.py --workspace C:\temp\CadElec --models "C:\...\26HA076\Modelos"Desarrollo
python -m venv .venv; .venv\Scripts\activate
pip install -e ".[dev]"
ruff check src tests; mypy; pytest # las pruebas de integración se omiten si no hay CADCraft
pyinstaller packaging\cadcraft-elec-mcp.spec # genera dist\cadcraft-elec-mcp.exeHay CI en GitHub Actions (Windows) con lint, tipos y pruebas. Al crear un tag v* se publica el .exe en Releases.
Solución de problemas
Síntoma | Causa / solución |
| Instala CADCraft o define |
| La app no tiene puerto de control. |
| Proxy o red corporativa. Usa el |
Un equipo sale como rectángulo en la platina | No tiene modelo. Impórtalo con |
| La placa es chica: más placa, canaletas más delgadas ( |
Los registros quedan en Documentos\CadElec\logs\cadcraft-elec-mcp.log.
Licencia
Apache-2.0. CADCraft es © storytold, Apache-2.0/MIT. Este proyecto no incluye modelos CAD de terceros.
Available Tools
41 toolsbuildA
Generate the drawing set: DXF (all sheets), multi-page PDF (via CADCraft), optional DWG, the 1:1
fabrication DXF of the back plate, XLSX/CSV lists and PNG previews of the sheet numbers in
previews. Returns file paths, page list and a validation summary.
Inputs: dwg, pdf, reports, previews, +1 more. Returns: object
cabinet_configureB
Configure the enclosure and mounting plate (mm). Defaults: 400x500x250 enclosure, 350x450 plate, 40x60 wire ducts, 10 mm duct clearance, 20 % spare rail length.
Inputs: device_gap, duct_depth, duct_width, plate_width, +10 more. Returns: object
cabinet_placeB
Place a device manually (lower-left corner, plate coordinates, mm). Omit x/y to return to auto.
Inputs: tag (required), x, y. Returns: object
cabinet_planARead-onlyIdempotent
Compute the back-plate layout without drawing: device positions, rails, fill %, warnings.
Inputs: no named parameters. Returns: object
cabinet_railsA
Fix which devices go on each DIN rail, top to bottom, left to right (e.g. [["-QB1","-FC1"], ["-KF1","-TB1"]]). An empty list returns to automatic filling.
Inputs: rails (required). Returns: object
cadcraft_executeB
Escape hatch: run any CADCraft engine command in the running app (e.g. 'zoom', 'layer.set'). Needs the desktop app started with --control. Prefer the domain tools for drawing content.
Inputs: command (required), params.
cadcraft_openA
Open a file in the CADCraft desktop app (launches cadcraft --control <port> if needed).
Without path: which='drawings' (sheet set DXF) or 'cabinet' (1:1 plate DXF) of the last build.
Inputs: path, which. Returns: object
cadcraft_statusBRead-onlyIdempotent
CADCraft installation, version and whether the desktop app control port is reachable.
Inputs: no named parameters. Returns: object
device_addA
Add one or more devices. Give catalog_id (see library_search) or at least kind.
Tags are auto-assigned from the profile letter code when omitted (-QA1, -KF2 ... or CR1, M1 in NFPA). Use mount='field' for devices outside the cabinet, 'door' for door-mounted ones. A terminal_strip device also creates its (empty) strip.
Inputs: items (required). Returns: result
device_listBRead-onlyIdempotent
List project devices (optionally of one kind).
Inputs: kind. Returns: result
device_removeADestructive
Remove a device. Fails if it is referenced unless force=true (then references are removed too).
Inputs: tag (required), force. Returns: object
device_updateC
Change device data. Renaming (new_tag) updates all references (sheets, I/O, network, cabinet).
Inputs: tag (required), data, mount, ports, +9 more. Returns: object
library_import_modelA
Clean a vendor 2D model (DXF or DWG front view) into a 1:1 mm block and add it to your catalog.
Removes CADENAS ATTDEFs, connection points and (by default) dimensions, converts DWG through
CADCraft, moves the lower-left corner to 0,0. Use target_width_mm (real device width) when
the file is not drawn in mm. The cleaned DXF goes to /library.
Inputs: catalog_id (required), source_path (required), kind, mount, +8 more. Returns: object
library_searchBRead-onlyIdempotent
Search the device catalog (built-in typical devices + your imported vendor models).
Example queries: 'S7-1200', 'balluff hub', 'mcb 2p', 'psu 24'.
Inputs: kind, limit, query. Returns: result
network_linkB
Connect device ports: [{a_device, a_port, b_device, b_port, protocol: profinet|ethernet|iolink, cable?, length_m?}]. The network sheet draws them as a tree rooted at the PLC.
Inputs: links (required). Returns: result
network_listCRead-onlyIdempotent
List network links.
Inputs: no named parameters. Returns: result
network_unlinkCDestructive
Remove the link(s) between two devices.
Inputs: a_device (required), b_device (required). Returns: object
plc_io_assignA
Assign PLC channels to field devices. Address (%I0.0, %Q0.0, %IW64) and module terminal (DIa.0, DQa.0 ... from the catalog) are auto-assigned when omitted; channel count is checked against the catalog.
Inputs: plc (required), channels (required). Returns: result
plc_io_listBRead-onlyIdempotent
List I/O assignments (optionally of one PLC).
Inputs: plc. Returns: result
plc_io_removeCDestructive
Remove one I/O channel assignment.
Inputs: plc (required), address (required). Returns: object
potential_setB
Declare a potential (rail): e.g. name='24V' kind='dc_plus', or 'L1_CTRL' kind='ac_control'.
The kind decides the conductor colour on drawings and lists.
Inputs: kind (required), name (required), source, voltage. Returns: result
project_createB
Create a new electrical project and make it the active one.
profile: 'iec' (IEC 81346-2:2019 two-letter codes, vertical paths, A3), 'iec_legacy'
(single-letter -K/-F/-Q codes) or 'nfpa' (NFPA 79 ladder, ANSI B). Standard potentials
L1 L2 L3 N PE 24V 0V are pre-declared. The project is saved as .elec.yaml in the workspace
(or in directory).
Inputs: project_code (required), plant, author, client, +9 more. Returns: object
project_infoARead-onlyIdempotent
Summary of the active project: title-block data, counts, potentials, sheets, cabinet.
Inputs: no named parameters. Returns: object
project_listARead-onlyIdempotent
List the projects found in the workspace folder.
Inputs: no named parameters. Returns: result
project_openB
Open an existing project by code (from the workspace) or by the full path of its .elec.yaml.
Inputs: code_or_path (required). Returns: object
project_updateB
Update title-block fields and/or switch the standards profile (iec / iec_legacy / nfpa).
Inputs: date, plant, author, client, +7 more. Returns: object
reportsB
Export BOM, wire list, terminal list, PLC I/O list and network list to XLSX (+ CSV).
Inputs: csv. Returns: object
sheet_addA
Add a sheet definition. Kinds:
power / control: list of current
paths. Each path:supplyrails (one per pole, e.g. ['L1','L2','L3'] or ['24V']), serieselements[{device, symbol?, terminals?, label?}], optionalreturn_rail('0V', 'N') andpe. Symbols/terminals default from the device kind (coil A1-A2, contacts 13-14/21-22..., poles 1-2/3-4/5-6). Use symbol 'contact_no'/'contact_nc' to draw a relay/contactor contact; cross references are automatic. Long sheets paginate.plc_io:
plctag (+ optional io_kinds); draws every channel assigned with plc_io_assign.network: topology of all network links. * cover / terminal_plan / cabinet_layout: automatic.
Inputs: kind (required), title (required), plc, note, +4 more. Returns: object
sheet_add_pathsC
Append current paths to an existing power/control sheet.
Inputs: paths (required), sheet_id (required). Returns: object
sheet_getCRead-onlyIdempotent
Full definition of one sheet.
Inputs: sheet_id (required). Returns: object
sheet_moveB
Move a sheet to a 1-based position in the set (cover stays first, terminal/cabinet sheets last).
Inputs: position (required), sheet_id (required). Returns: result
sheet_previewA
Render one sheet (1-based page number) to PNG with CADCraft and return the image to inspect.
Inputs: number (required).
sheet_removeCDestructive
Delete a sheet definition.
Inputs: sheet_id (required). Returns: object
sheet_updateC
Replace fields of a sheet (giving paths replaces all its paths).
Inputs: sheet_id (required), plc, note, paths, +2 more. Returns: object
standards_infoBRead-onlyIdempotent
Rules of a standards profile: letter codes per device kind, wire colours, sheet format, text heights, terminal marking, available profiles and validation rules.
Inputs: profile. Returns: object
symbols_listBRead-onlyIdempotent
Symbols available for current-path elements (use the id in PathElement.symbol).
Inputs: style. Returns: result
terminals_addA
Add terminals to a strip (created when missing; tag auto -XD1.. if omitted). Either count
consecutive numbers or explicit numbers. Mark protective-earth terminals with pe=true.
Inputs: pe, count, strip, numbers, +2 more. Returns: object
terminals_assign_ioB
Route every field-mounted I/O device through its own terminal on strip (drawn on the I/O
sheets and listed in the terminal plan).
Inputs: plc, strip, description. Returns: object
terminals_listCRead-onlyIdempotent
Terminal strips with their terminals.
Inputs: no named parameters. Returns: result
terminals_removeBDestructive
Remove one terminal, e.g. '-XD2:5'.
Inputs: ref (required). Returns: object
validateARead-onlyIdempotent
Check the project against the standards profile and consistency rules (designations, I/O, ports, terminals, cross references, cabinet fit/spare space ...).
Inputs: no named parameters. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 41 tools
Most tools have clearly distinct resource/action boundaries across projects, devices, sheets, I/O, terminals, network, cabinet, and library domains. There is some overlap between reports and build (both can emit XLSX/CSV lists), between sheet_add_paths and sheet_update, and between project_open and cadcraft_open, but descriptions mostly clarify the intended use.
The dominant convention is a predictable resource_action pattern (device_add, project_create, sheet_remove, plc_io_assign, terminals_list, network_link, cabinet_plan). A few tools deviate with bare verbs or nouns (reports, build, validate) and the cadcraft_ namespace, but the overall scheme is readable and consistent.
At 41 tools the surface is heavy for an MCP server, even for a broad electrical CAD domain. Many operations are genuinely distinct, but the count exceeds the 25-tool threshold and increases selection burden.
The surface covers the full engineering lifecycle: project/device/sheet CRUD, PLC I/O, terminals, networking, cabinet layout, validation, previews, reports, and build outputs. Only minor gaps exist, such as no project delete/archive, no potential listing/removal, and no dedicated device_get beyond device_list.
Maintenance
Related MCP Connectors
AI electrical drafting: create and edit 2D/3D drawings. Find equipment CAD, datasheets and manuals.
Electrical single-line and multi-line diagrams: build, check (NF C 15-100, IEC 60364), draw, PDF.
Design CCTV, access control and intruder systems with AI agents. Exports PDF, DXF and IFC.
Turn datasheets into source-backed JSON contracts, pinout matrices, and KiCad CAD for AI agents.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI-powered PLC programming with natural language to ladder logic conversion, L5X and .ACD project generation, and semantic search through L5X files and documentation.45-
- FlicenseNot gradedqualityBmaintenanceConverts natural language specifications into working ladder logic and complete Studio 5000 projects, enabling AI-powered PLC programming with L5X and .ACD file generation, semantic search, and documentation access.-
- AlicenseNot gradedqualityBmaintenanceEnables an LLM agent to assemble, wire, run, fault and observe electromechanical motor-control circuits through 26 tools covering component placement, terminal connections, button/switch operation, fault injection, and simulation control. Also lets agents load and save circuits and generate PDF drawing sets, screenshots and scripted demo videos.MIT
- FlicenseNot gradedqualityAmaintenanceEnables AI agents to create, edit, validate, and read back production-grade CAD drawings — including P&ID sheets, mechanical parts and assemblies, and architectural floor plans with measured areas and schedules — through a single typed tool contract that runs either live via COM on Windows or headlessly via ezdxf anywhere. It also supports standards-aware dimensioning, ISO GD&T and tolerance checks, takeoff workbooks, and drawing understanding, diffing, and critique.-