Documentation

Command line, MCP server and plugins

Projects and the parts server without a window, for scripts and AI agents.

openecraft-cli edits projects and maintains the parts server without a window. The same commands are offered to AI agents over the Model Context Protocol (openecraft-cli mcp, JSON-RPC on stdin / stdout), so an agent can create projects, place symbols, draw wires between connection points, assign parts, run the check, generate reports and export PDF / SVG / DXF / DWG.

cargo run --release -p openecraft-cli -- help                 # all commands
cargo run --release -p openecraft-cli -- help connect         # parameters of a command
cargo run --release -p openecraft-cli -- --version             # also -V or version
openecraft-cli new_project --name "Pump control" --path pump.oec
openecraft-cli new_project --example star_delta_starter --path star_delta.oec   # see list_examples
openecraft-cli -p pump.oec place_symbol --page 1 --symbol pb_no --x 200 --y 100   # -S1
openecraft-cli -p pump.oec place_symbol --page 1 --symbol coil --x 200 --y 160    # -K1
openecraft-cli -p pump.oec place_part --page 1 --part GEN.LMP-GN-24 --x 240 --y 160   # -P1 with its part
openecraft-cli -p pump.oec connect --page 1 --from -S1:14 --to -K1:A1
openecraft-cli -p pump.oec check
openecraft-cli -p pump.oec export --format pdf --path pump.pdf
openecraft-cli --server http://127.0.0.1:8090 --token <secret> parts_import --path parts.csv
openecraft-cli --server http://127.0.0.1:8090 --token <secret> parts_import --path 6ED1052-1CC08-0BA3.edz
openecraft-cli --project drawing.oec import_eplan_symbols --path drive.edz
openecraft-cli --project drawing.oec import_eplan_symbols --path Beckhoff --part BEC.EK1100

The MCP server is openecraft-cli of the packages: on Windows the setup component Command line and MCP server (installation type Full, not part of Editor), in %LOCALAPPDATA%\Programs\OpenECraft\ (or C:\Program Files\OpenECraft\ for all users); on macOS /Applications/OpenECraft.app/Contents/MacOS/openecraft-cli; on Linux /usr/bin/openecraft-cli (deb, rpm), ~/.local/bin (tar.gz), <AppImage> cli, flatpak run --command=openecraft-cli io.github.nilres.OpenECraft or openecraft.cli (snap). Register it with an agent, e.g. Claude Code (started in the folder of the projects):

claude mcp add openecraft -- /path/to/openecraft-cli mcp
claude mcp add --scope user -e OPENECRAFT_MCP_ROOT=/home/me/projects openecraft -- openecraft-cli mcp

or in the mcpServers configuration of other clients (Claude Desktop: claude_desktop_config.json in %APPDATA%\Claude\, ~/Library/Application Support/Claude/ or ~/.config/Claude/; Cursor: ~/.cursor/mcp.json; VS Code: .vscode/mcp.json with servers instead of mcpServers):

{ "mcpServers": { "openecraft": { "command": "openecraft-cli", "args": ["mcp"],
    "env": { "OPENECRAFT_MCP_ROOT": "/home/me/projects" } } } }

The agent can read and write any file the server process can access; start it in a working directory (and with a parts server token) you are fine with the agent using. Let an AI agent draw your schematic has a worked example with its transcript, example prompts and the setup of more clients.

Plugins

Plugins add commands, checks, reports and exports to the editor (Plugins tab: Plugin commands lists every command by plugin with a search, the star pins one to the tab; Check tab), the command line and the MCP server at the same time. Built-in plugins are Rust code in crates/openecraft-api; external plugins are programs in any language that answer JSON requests on stdin / stdout:

OPENECRAFT_PLUGINS=examples/plugins openecraft-cli -p pump.oec plugins
openecraft-cli --plugins examples/plugins -p pump.oec report --kind page_notes

See docs/plugins.md for the API and the protocol.

This document in the repository

More documentation

Getting started: from the first page to the bill of materials

This tutorial walks through a small control circuit in OpenECraft: pages, symbols, wires, devices with parts, terminals, a PLC, the project check, reports, the panel layout and the output. Commands are written as Tab ›…

Read

Installation and building

Packages for Windows, Linux and macOS, the web version, and building from source.

Read

User interface

The editor's layout and the commands and keys of everyday work. New users start with the tutorial.

Read

Schematic editor

Pages, devices and their structure, live cross references, editing tools, navigators and project storage. The user interface lists the commands and keys.

Read

Symbols and libraries

The built-in symbol libraries (IEC, NFPA / JIC, GB, GOST, JIS, fluid power, P&ID, single-line) and the symbol editor for own symbols.

Read

Wires, cables, potentials and numbering

How connections get their cable, colour, cross-section and number, and how devices, pages and wires are numbered.

Read

Terminal strips, plugs, PLC and marking

Terminal strips with multi-level terminals and accessories, plugs, PLC cards with the exchange to PLC programming tools, and the markers for the workshop.

Read

Macros, configurator and table editing

Reuse of circuits as macros with variants and placeholders, pages generated by the configurator, and bulk changes in tables and spreadsheets.

Read

Parts management

The parts database shared by all projects (EPLAN style): commercial, technical and mounting data, function templates, connection points, 2D / 3D graphics and the import of manufacturer data. Parts are shared between…

Read

Reports, forms and the project check

Reports as windows, CSV / Excel or live report pages, title blocks and report forms (also graphical and own drawn forms), and the project check with its message management.

Read

Electrical sizing, calculations and verification

Conductor sizing, short circuit and protection coordination, load calculation, EMC, functional safety and rule sets – all part of the project check – and the inspection and test report of the installation.

Read

Panel layout, rooms and 3D routing

OpenECraft aligns the device's clip to the rail centerline. For Beckhoff's 12 × 100 × 68 mm EL I/O housings with 8 or 16 terminals, and the matching EK1100 coupler, the rail center is 63.8 mm from the top. For example…

Read

Wiring and mounting assistants

The panel layout as a checklist for the workshop, on a desktop or a tablet.

Read

Fluid power, process and plant engineering

Hoses and pipes in their own nets, electro-fluid links, PCT loops, the pre-planning of the plant and single-line / multi-line engineering.

Read

Wire harnesses

Harnesses with 3D topology, protections and fixings, KBL export, the harness interface for machines and nailboard drawings (Connections › Harnesses…). The example project conveyor has a door harness.

Read

Output and data exchange

PDF, DXF / DWG, SVG and 3D exports, DXF / DWG import, the enterprise integration layer (ERP, PDM, PLM, ECAD, MCAD, procurement, wiring machines) and Autodesk Vault.

Read

Revisions, review and change management

Revisions with locked pages and marked changes, the approval workflow, baselines with compare and merge, comments and redlining, and change requests.

Read

Plugins

OpenECraft is extended through the openecraft-api crate. A plugin adds

Read

Parts server and parts manager

The data portal shared by all OpenECraft installations and the app that maintains it.

Read

Project server

Shared projects for a team: several users work on the same project, each page is locked by one of them.

Read

Access control of the servers

The parts server and the project server share one access model: users sign in with a local account or with a directory (Active Directory, OpenLDAP or another LDAP server), and what they may do comes from roles given to…

Read