Clone
12
ai_assistants
ispyisail edited this page 2026-10-02 16:17:22 +13:00
This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Connecting an AI assistant

Let the AI assistant you already use (Claude, GitHub Copilot, Gemini, Codex, or a model running on your own computer) open, check and edit your QElectroTech drawings. It does this through QElectroTech's MCP server, a small program that runs on your computer next to your drawings. Nothing is uploaded to us. What the assistant reads goes to whichever AI company runs it, as with anything else you show it.

This page is the setup for each assistant. What the tools do, and every option, is on the MCP server page.


Before you start

  1. Python 3.9 or later. Nothing else to install: the server uses only Python's standard library. On Windows, get it from python.org and tick "Add python.exe to PATH" in the installer. If typing python in a terminal opens the Microsoft Store, Python is not installed: that is a shortcut Windows ships in its place.
  2. The server itself, one file, qet_mcp.py.
    • Development builds made after 29 September 2026 install it with QElectroTech: in share/qelectrotech/mcp/ on Linux, and in the mcp\ folder of the installation on Windows (installer component "AI assistant (MCP)", on by default). The Windows installer can also add Python for it: tick "Python for the AI assistant" and step 1 is done (mcp\python\python.exe).
    • With those builds, Aide → Connecter un assistant IA… (Help → Connect an AI assistant) writes the setup text below for you, with this installation's paths filled in: choose the assistant and the folder, then click Copy.
    • With an older version, download the file: qet_mcp.py, and save it anywhere, for example next to your drawings.
  3. A folder for the drawings the assistant may use. The server only reads and writes inside it (QET_MCP_WORKSPACE). Pick a folder of drawings, not your whole home folder.

In every setup below, replace:

Placeholder With
/path/to/qet_mcp.py where you saved the server
/path/to/drawings your drawings folder
/path/to/qelectrotech the QElectroTech program: /usr/bin/qelectrotech on Linux, C:\Program Files\QElectroTech\bin\qelectrotech.exe or wherever you installed it on Windows

On Windows, write each \ in a JSON file as \\, and use python where the examples say python3.

What the assistant can do

Setting Tools the assistant gets
nothing extra read projects and symbols, compare two versions of a project (qet_diff), search the symbol collection, export to PDF/PNG/SVG/DXF and lists
QET_ENABLE_SCRIPTING=1 also edit: place symbols, draw wires, set labels, add sheets, check design rules, query the project database

Leave QET_ENABLE_SCRIPTING out if you only want the assistant to read. Edits are never saved over an existing file unless the assistant asks for it explicitly. They go to a new file you name.

Be careful with projects from other people. An assistant reads the text in a project: labels, notes, symbol names. Text written to look like an instruction can steer it. Keep editing off when you work on drawings you did not make, and check what an assistant changed (it can show you with qet_diff).

Telling it where QElectroTech is

With a QElectroTech built before PR #1129 (September 2026), QET_BINARY is ignored: tell the assistant in the chat where the QElectroTech program is when it asks.

Exports and edits start QElectroTech in the background. The server finds it from QET_BINARY, else from qelectrotech on your PATH. The assistant cannot pick another program.


Setups

Each was checked as far as the "Tested" column says, on 2026-09-29.

Assistant Where the setup goes Tested
Claude Desktop Settings → Developer → Edit Config not on Windows or macOS; same format as Claude Code
Claude Code .mcp.json in your drawings folder, or claude mcp add a real tool call, Claude Code 2.1.283
GitHub Copilot in VS Code .vscode/mcp.json format from VS Code's documentation; not run
Cursor ~/.cursor/mcp.json format from Cursor's documentation; not run
Gemini CLI ~/.gemini/settings.json connects (gemini mcp list: Connected)
Codex CLI ~/.codex/config.toml setup accepted (codex mcp list: enabled); no tool call
LM Studio Program → Install → Edit mcp.json format from LM Studio's documentation; not run

Claude Desktop

Settings → Developer → Edit Config, add this, then quit the app fully and start it again:

{
  "mcpServers": {
    "qet": {
      "command": "python3",
      "args": ["/path/to/qet_mcp.py"],
      "env": {
        "QET_MCP_WORKSPACE": "/path/to/drawings",
        "QET_BINARY": "/path/to/qelectrotech",
        "QET_ENABLE_SCRIPTING": "1"
      }
    }
  }
}

Claude Code

The same block, saved as .mcp.json in your drawings folder, or in one command:

claude mcp add qet \
  -e QET_MCP_WORKSPACE=/path/to/drawings \
  -e QET_BINARY=/path/to/qelectrotech \
  -e QET_ENABLE_SCRIPTING=1 \
  -- python3 /path/to/qet_mcp.py

GitHub Copilot in VS Code

Copilot uses tools in agent mode only. Save as .vscode/mcp.json in the folder you open in VS Code. VS Code asks you to trust the server the first time it starts:

{
  "servers": {
    "qet": {
      "type": "stdio",
      "command": "python3",
      "args": ["/path/to/qet_mcp.py"],
      "env": {
        "QET_MCP_WORKSPACE": "/path/to/drawings",
        "QET_BINARY": "/path/to/qelectrotech",
        "QET_ENABLE_SCRIPTING": "1"
      }
    }
  }
}

Note the key is servers here, not mcpServers.

Cursor

~/.cursor/mcp.json for every project, or .cursor/mcp.json in one:

{
  "mcpServers": {
    "qet": {
      "type": "stdio",
      "command": "python3",
      "args": ["/path/to/qet_mcp.py"],
      "env": {
        "QET_MCP_WORKSPACE": "/path/to/drawings",
        "QET_BINARY": "/path/to/qelectrotech",
        "QET_ENABLE_SCRIPTING": "1"
      }
    }
  }
}

Gemini CLI

~/.gemini/settings.json, or .gemini/settings.json in your drawings folder:

{
  "mcpServers": {
    "qet": {
      "command": "python3",
      "args": ["/path/to/qet_mcp.py"],
      "env": {
        "QET_MCP_WORKSPACE": "/path/to/drawings",
        "QET_BINARY": "/path/to/qelectrotech",
        "QET_ENABLE_SCRIPTING": "1"
      }
    }
  }
}

Gemini CLI starts no server in a folder you have not trusted: it asks the first time you run gemini there. gemini mcp list should then show qet … Connected.

Codex CLI

~/.codex/config.toml:

[mcp_servers.qet]
command = "python3"
args = ["/path/to/qet_mcp.py"]

[mcp_servers.qet.env]
QET_MCP_WORKSPACE = "/path/to/drawings"
QET_BINARY = "/path/to/qelectrotech"
QET_ENABLE_SCRIPTING = "1"

codex mcp list should show qet as enabled.

LM Studio

LM Studio 0.3.17 or later. In the Program tab of the right-hand sidebar, Install → Edit mcp.json, and add the same block as Gemini CLI. A model running on your own computer sends nothing anywhere, but small models use tools less reliably than the big hosted ones. Expect more mistakes with edits.

Any other assistant

Most take the same command / args / env block under mcpServers. The server speaks MCP over standard input and output.


Added on 29 September 2026

Four changes make this simpler. All four merged on 29 September 2026, so they are in builds made after that (on Windows, nightlies newer than git10275). With an older build, the setup above is the way.

Windows: exports and edits

Without it, on Windows only the reading tools work: every export, edit, check and query fails, because the server could not start QElectroTech there.

The server installed with QElectroTech

qet_mcp.py comes with QElectroTech (share/qelectrotech/mcp/ on Linux, mcp\ in the Windows installation folder) and finds that QElectroTech and its symbols by itself, so no download and no QET_BINARY are needed.

Python with the Windows installer

The installer offers "Python for the AI assistant" (unticked by default), so Windows users need not install Python themselves. The command becomes C:\Program Files\QElectroTech\mcp\python\python.exe (in JSON, each \ is written \\).

Help → Connect an AI assistant

Aide → Connecter un assistant IA... (Help → Connect an AI assistant) writes the setup for your assistant with this installation's paths filled in:

The dialog with Claude Desktop chosen, /home/you/drawings as the folder, editing allowed, and the setup text below

  1. Pick the assistant: Claude Desktop, Claude Code, GitHub Copilot (VS Code), Cursor, Gemini CLI, Codex CLI or LM Studio.
  2. Pick the folder of drawings it may use (Dossier accessible).
  3. Tick Autoriser l'assistant à modifier les schémas only if it may edit them. It is unticked by default.
  4. Copier (Copy), and paste where the dialog says. The dialog writes nothing and starts nothing itself.

It also tells you, in bold, when something is missing:

Message Meaning
Le serveur MCP n'est pas installé avec cette version this QElectroTech was installed without the server: use the download above
Python est introuvable sur cet ordinateur the Python the setup names is not there. On Windows, run the QElectroTech installer again and tick Python pour l'assistant IA, or install Python; elsewhere, install Python 3 from your system's packages
Python n'est peut-être pas installé (Windows) only the Microsoft Store shortcut answers to python, which opens the Store instead of running the server

Buttons, live mode, recordings

Merged on 2 October 2026 (#1219–#1225, #1227, #1228), so in development builds made since then. Each has its own page:

  • Script buttons: ask the assistant for a button; it writes the script, tests it on a copy of a project, and stores it with an icon. You press it.
  • Live mode: with a setting turned on and a warning accepted at each start, the assistant works in the project you have open, one Ctrl+Z per action.
  • Macro recorder: do the task once by hand while recording, paste the request, and the assistant writes a script it has checked does the same.

ChatGPT, and Claude or Copilot in a web browser

These reach a server only through the internet, from their own computers. QElectroTech's server does not open itself to the internet, and there is no plan to: it stays on your computer. A web chat that can run Python can still use the server's reading tools on a project you upload to it. See Using it without Claude Code.

See also