uniwire

io.github.uniwire-dev由 GitHub 帳號 uniwire-dev 發布v0.1.8更新於 Nov 3, 2026

Electrical single-line and multi-line diagrams: build, check (NF C 15-100, IEC 60364), draw, PDF.

已驗證Streamable HTTP可網頁執行開發者工具資料與分析媒體與設計

概覽

AI 產生的概覽

uniwire 的遠端 MCP 伺服器,讓助理撰寫、驗證、依規範檢查並繪製電氣單線圖與多線圖。

可以做什麼
  • 讀取格式參考卡、列出節點類型並檢視某一類型的欄位
  • 驗證圖面文件,並依電氣規則設定(NF C 15-100、IEC 60364、Enedis、PLC)進行檢查
  • 以帶穩定 id 的大綱描述文件,並依節點 id 套用修補來修改
  • 將單線圖或多線圖算繪為 SVG 或 PDF,並回傳檢視器連結與 PDF 連結
  • 匯出配線清單(線號、導線、電纜)與物料清單
  • 列出並載入 53 個範例裝置作為起點,以及正規化文件
適用情境
適合使用者需要電氣圖、配電箱或配電盤配置,或需要檢查保護元件、電纜與漏電斷路器時;它提供可審閱、可比對的文字文件,以及圖面與匯出檔,而非 CAD 檔案。
執行需求
遠端 streamable HTTP 端點;未宣告任何套件、環境變數或標頭。文件為 uniwire 格式的 JSON,助理在撰寫前應先閱讀參考卡。
安裝前請注意
伺服器會編輯並改寫圖面文件,修補會變更使用者的檔案內容。規則檢查是自動檢查,並非合規證書,須由合格電工核實裝置。在託管伺服器上文件保留 30 天以便短連結開啟,任何取得連結的人都能開啟該文件。它不繪製控制電路圖。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 uniwire,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.uniwire-dev%2Funiwire/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "uniwire": {
      "type": "http",
      "url": "https://mcp.uniwire.sh/mcp"
    }
  }
}

README

uniwire

Electrical diagrams, as code.

An open standard to describe electrical installations, and the reference Python library that validates them, checks them against rules and draws their single-line and multi-line diagrams.

[CI] [PyPI] [Python] [License: Apache-2.0]

You describe the installation (sources, protective devices, cables, loads, PLCs) in a *.uniwire.json file or in Python, and uniwire computes the drawings. No coordinates, no CAD file: a text file you can review and diff.

Features

  • Single-line and multi-line diagrams from the same document: the multi-line view derives every conductor (L1, L2, L3, N, PE, PEN) from the single-line data, with no extra input.
  • 53 node types: utility grid, transformers, generators, UPS, PV, batteries, inverters; breakers, RCDs, RCBOs, fuses, switch-disconnectors, contactors, motor starters, transfer switches, SPDs, protection relays, instrument transformers, insulation monitors; busbars, boards, terminal blocks; lighting, sockets, heating, motors, EV chargers, modular PLCs and more.
  • Tree + links: the power tree is the backbone; transfers, bus ties, infeeds, earthing, control, interlocks, trips, measurements and data buses are links. A terminal / connectivity-node graph is derived automatically, with CIM, IFC and IEC 61850 SCL mappings.
  • Closed typing and unit-suffixed fields: in_A, idn_mA, section_mm2, p_kW; unknown fields are errors (calibre instead of in_A is caught), extensions live in ext. Templates declare a device once.
  • Rule profiles: core (always), nfc15100 (French dwellings), vde0100 (German installations), iec60364 (cable current-carrying capacity), enedis (connection to the French public network), plus PLC consistency checks.
  • Bill of materials: structured product references (manufacturer, part number, range, accessories) on any node or PLC module, aggregated to CSV (uniwire bom).
  • Wire and cable marking: marking rules per view (manual, sequential, per potential, pattern), marks drawn on the multi-line diagram, and CSV exports: wire list (uniwire wires), wire marker list (uniwire markers), cable schedule (uniwire cables); uniwire marks --write freezes the marks.
  • Colour modes: conductors in their IEC 60445 or North-American colours, or colouring by phase, source, status or voltage level.
  • Sheets: paper size, sub-tree views, automatic sheet splitting with cross-references, circuit schedule, enclosure frames, title block, revisions and notes. SVG output is deterministic and diff-friendly; the multi-sheet PDF has clickable links between sheets.
  • Drawings in English, French, German, Spanish, Portuguese, Italian, Polish, Turkish, Russian and Simplified Chinese, selected per document with meta.lang.
  • LLM tooling: a reference card generated from the model (uniwire card), a text outline with stable ids (uniwire describe), id-based edits (uniwire patch), an MCP server (uniwire-mcp, stdio) and a hosted MCP endpoint at https://mcp.uniwire.sh/mcp, plus llms.txt for assistants (full reference card included). Setup for ChatGPT, Claude, Cursor and VS Code: uniwire in your assistant (in ChatGPT, the uniwire plugin of the plugin directory); details in LLM tools.

Gallery

[French house, TT, single-line diagram]
French house, TT (NF C 15-100), single-line
[German house, TN-C-S, multi-line diagram in conductor colours]
German house, TN-C-S, multi-line in conductor colours
[Office building main LV switchboard]
Office building, main LV switchboard
[MV/LV substation, 1000 kVA]
MV/LV substation, 1000 kVA
[Standby generator, automatic transfer switch, load shedding]
Standby generator, ATS, load shedding
[Motor control centre, multi-line diagram with wire marks]
Motor control centre, multi-line with wire marks

All 53 examples are in examples/ and listed in the documentation; open any of them in the web viewer.

Install

bash
pip install uniwire                 # validation, rules, SVG rendering, bill of materials, exportspip install "uniwire[pdf]"          # + PDF output (reportlab)pip install "uniwire[mcp]"          # + MCP server (uniwire-mcp)pip install "uniwire[iec81346]"     # + optional IEC 81346-2 class table (separate CC BY-SA 4.0 data package)

Python 3.10 or later. The only required dependency is pydantic.

Quickstart

A document in JSON:

json
{  "$schema": "https://uniwire.sh/schema/v1/uniwire.schema.json",  "uniwire": "1.0.0",  "profiles": ["nfc15100"],  "meta": { "title": "Small house", "lang": "en" },  "installation": { "earthing": "TT", "system": "1P+N", "un_V": 230 },  "templates": { "C16": { "type": "breaker", "in_A": 16, "curve": "C" } },  "sources": [    { "type": "grid", "label": "Utility", "children": [      { "type": "main_breaker", "ref": "-Q0", "range_A": "15-45", "in_A": 45, "idn_mA": 500, "selective": true,        "children": [          { "type": "rcd", "ref": "-Q1", "in_A": 40, "idn_mA": 30, "rcd_type": "AC", "children": [            { "type": "breaker", "ref": "-Q11", "use": "C16", "cable": { "cores": "3G", "section_mm2": 1.5 },              "children": [ { "type": "lighting", "label": "Lighting", "points": 6 } ] }          ] },          { "type": "rcd", "ref": "-Q2", "in_A": 40, "idn_mA": 30, "rcd_type": "A", "children": [            { "type": "breaker", "ref": "-Q21", "in_A": 20, "curve": "C", "cable": { "cores": "3G", "section_mm2": 2.5 },              "children": [ { "type": "socket", "label": "Sockets", "points": 8 } ] }          ] }      ] }    ] }  ]}

The tree is the power flow (source, protective devices, loads); whatever falls outside the tree (transfer switches, bus ties, control and data connections) goes in links.

bash
uniwire validate house.uniwire.json                 # schema + integrityuniwire check house.uniwire.json                    # rule profiles (exit code 1 on errors)uniwire render house.uniwire.json                   # SVG sheets in out/house/uniwire render house.uniwire.json -f pdf -o house.pdfuniwire render house.uniwire.json --kind multi-line # multi-line power diagramuniwire bom house.uniwire.json -o house.bom.csv     # bill of materialsuniwire wires house.uniwire.json                    # wire list (also: markers, cables, marks)uniwire card                                        # reference card for assistants

The same installation in Python:

python
from uniwire.build import *
with Installation("Small house", earthing="TT", system="1P+N", un="230 V", profiles=["nfc15100"]) as inst:    with Grid("Utility"), MainBreaker("-Q0", "15-45 A", idn="500 mA", selective=True):        with RCD("-Q1", "40 A", "30 mA", type="AC"):            Breaker("-Q11", "C16", cable="3G1,5") >> Lighting("Lighting", points=6)        with RCD("-Q2", "40 A", "30 mA", type="A"):            Breaker("-Q21", "C20", cable="3G2,5 18 m") >> Socket("Sockets", points=8)
for finding in inst.check():    print(finding)inst.save("house.uniwire.json")inst.render("house.pdf")

with makes an element the parent of everything created inside it, >> chains elements, ratings and cables are written the way they appear on drawings ("C16", "3G2,5 18 m"). See the code-first API and the Python API and CLI.

Roadmap

  • Terminals, terminal strips and wires: UEP-0001, a draft for format 2.0 (named ports, terminal strips, wires and cables as objects, potentials).
  • Control schematics: coils, auxiliary contacts with cross-references, terminal plans and wire numbers, built on named ports.
  • Exports: DXF drawings, pandapower networks for load-flow and short-circuit studies.

Ideas and format proposals are welcome: see CONTRIBUTING.md.

Contributing

Bug reports, examples, rules, symbols and translations are welcome. Read CONTRIBUTING.md (development setup, tests, uniwire Enhancement Proposals) and the Code of Conduct. Report security issues privately, see SECURITY.md.

Licences

  • Code, CLI and JSON Schema: Apache License 2.0.
  • Specification text: CC BY 4.0: implement it freely, in any software.
  • Optional data package uniwire-data-iec81346 (IEC 81346-2 class table): CC BY-SA 4.0, distributed separately (pip install "uniwire[iec81346]").

See NOTICE for third-party notices.

來源:README.md,提交 e9a98d8

工具

14

get_reference_card

Reference card of the uniwire format

Return the reference card of the uniwire format for electrical diagrams: document skeleton, node types (breakers, RCDs, cables, loads, transformers, PV...) and their fields, enums, links, pitfalls, examples. Read it once before writing a document; type_info gives the fields of one type in detail.

輸入參數langlevel

list_types

List the node types

List the node types of the format (type, category, label), optionally for one category. Use it to find the type name of a device or load before writing a node; type_info then gives its fields.

輸入參數langcategory

type_info

Fields of a node type

Return every field of one node type with its description, unit and allowed values (enums). Use it before writing or editing a node of that type; list_types gives the type names.

輸入參數langtype必填

validate

Validate an electrical diagram

Validate a uniwire document (electrical diagram as JSON) against the format only: structure, types, ids, references and links, without the electrical rules (use check for those). Returns valid + issues, each naming the node id and field when possible, plus viewer_url (the document in the uniwire web editor) and pdf_url (the PDF drawn by uniwire).

輸入參數document必填

check

Check an electrical installation (NF C 15-100, IEC 60364)

Check an electrical installation (single-line diagram, panel, schéma unifilaire, tableau électrique): validates the document, then applies the rule profiles (NF C 15-100 'nfc15100', French grid connection 'enedis', IEC 60364 'iec60364', PLC; default: the document's 'profiles'; 'core' always applies): breaker ratings against cable sections, RCDs, circuits per protection, selectivity... Returns findings (level error/warning/info, rule, node id, message, source), a summary, 'scope' (what the checks cover and do not cover: automatic checks of the document data, not a conformity certificate), viewer_url (the document in the uniwire web editor: drawing, findings, downloads) and pdf_url (the PDF drawn by uniwire).

輸入參數document必填profiles

describe

Outline of an electrical diagram

Return a text outline of an electrical diagram: installation, full tree of the panel with stable ids, ratings and cables, links, interlocks, boards and findings summary. Use it to read a document and find the node ids before apply_patch.

輸入參數langdocument必填

apply_patch

Edit an electrical diagram

Edit an electrical diagram by node id (change a rating, add a circuit, move a load...) and return the new document. ops (applied in order): {"op":"set","id":ID,"path":"in_A","value":20} (null value removes; no id = document root, e.g. path "installation.earthing"); {"op":"add","parent":ID,"node":{...},"index":0} (or "at":"sources"); {"op":"remove","id":ID}; {"op":"move","id":ID,"parent":ID,"index":0}; {"op":"rename","id":ID,"new_id":NEW}; {"op":"link","link":{"kind":"control","from":ID,"to":ID}}; {"op":"unlink","id":LINK_ID} or {"op":"unlink","from":ID,"to":ID,"kind":K}. On failure returns ok=false and errors naming the failing op index (null = validation of the result).

輸入參數ops必填document必填validate

render

Draw the single-line or multi-line diagram

Draw the electrical diagram (schéma unifilaire / multifilaire). kind: 'single-line' or 'multi-line'; view: a view id of the document (e.g. a wire-marking view). format 'svg' returns the SVG text of every sheet (or of 'sheet', numbered from 1); 'pdf' writes to 'path' if given, else returns base64 (requires the uniwire[pdf] extra); on the hosted server it returns pdf_url (the PDF drawn by uniwire) instead. color: 'none' | 'conductors' | 'phase' | 'source' | 'status' | 'voltage' (adds a legend); conductor_colors: 'iec' (IEC 60445) | 'us'.

輸入參數kindpathviewcolorsheetformatdocument必填conductor_colors

wiring

Wire list, wire markers and cable schedule

Wiring exports of an installation as rows with stable column names (repérage des fils, carnet de câbles): what='markers' (one row per wire end, for label printers), 'wires' (wire list) or 'cables' (cable schedule). Marks follow the wire_marking rules of the view (id), by default the first view that declares them.

輸入參數viewwhatdocument必填

bom

Bill of materials

Compute the bill of materials (nomenclature) of an electrical installation from its document: one row per manufacturer / part number for the nodes with a product reference, then one row per kind of equipment without a reference (type and main characteristics in 'spec', e.g. 'C16 1P+N') and per kind of cable (total length in 'length_m'), with quantities and the reference designations involved. Use it to prepare a quote or an order; wiring gives the wire list and cable schedule.

輸入參數document必填

list_examples

List the example installations

List the 53 example installations (dwellings, shops, offices, workshops, PV, EV charging, UPS, MV/LV substations, PLCs): name, title, language, profiles, earthing, system.

無需輸入參數。

get_example

Get an example installation

Return an example installation document by name. Use it as a starting point for a similar installation, then edit it with apply_patch; list_examples gives the names.

輸入參數name必填

normalize

Normalized document

Return the resolved form of a document: templates ('use') applied, every node and link id assigned, numbers in canonical form. Use it to read a document exactly as the rules and drawings see it, or to get stable ids before apply_patch; it does not apply the electrical rules (see check).

輸入參數document必填

版本歷史

7
  1. v0.1.8最新Nov 3, 2026
  2. v0.1.7Nov 1, 2026
  3. v0.1.6Oct 30, 2026
  4. v0.1.5Oct 30, 2026
  5. v0.1.4Oct 29, 2026
  6. v0.1.1Oct 13, 2026
  7. v0.1.0Oct 13, 2026

評分

已滿足適用檢查項的 100%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分