WE Multitool DUT MCP
multitool-mcp is a dependency-free Model Context Protocol server for inspecting and debugging a device under test (DUT) through a Wise Electronics WE Multitool.
It runs over standard input/output and bridges the Multitool's JSON-over-WebSocket API. It exposes bounded MCP tools for GPIO, I2C, SPI, UART, PWM, GPIO ownership, SWD debugging, and SWO trace. SWD/SWO tools manage a host OpenOCD process connected to the Multitool CMSIS-DAP TCP probe.
Requirements
- Python 3.11 or later
- A WE Multitool reachable over WebSocket
Install
Install from PyPI once published:
python -m pip install multitool-mcp
For development from a clone:
python -m pip install -e .
Configure an MCP client
Run the installed command:
[mcp_servers.we_multitool_dut]
command = "multitool-mcp"
env_vars = ["WE_MULTITOOL_URL", "WE_MULTITOOL_TIMEOUT_SECONDS"]
startup_timeout_sec = 10
tool_timeout_sec = 150
default_tools_approval_mode = "prompt"
By default, the server connects to ws://we-multitool.local/ws. Set these environment variables before starting the MCP client to change that:
WE_MULTITOOL_URL=ws://10.0.0.1/ws
WE_MULTITOOL_TIMEOUT_SECONDS=8
On PowerShell:
$env:WE_MULTITOOL_URL = "ws://10.0.0.1/ws"
$env:WE_MULTITOOL_TIMEOUT_SECONDS = "8"
Safety and firmware behavior
Read pins_get before configuring pins, and verify wiring, voltage, bus role, and DUT limits before driving signals.
gpio_configure accepts input, output, and open-drain directions. Open-drain mode requires firmware with open-drain GPIO setup support and an appropriate external pull-up.
- Commands are serialized because firmware responses do not carry request IDs.
- UART data received while another command awaits a response is buffered.
- The
gpio_setfirmware command has no acknowledgement;gpio_writereports it as dispatched but unverified. - The firmware tracks one active WebSocket response socket. Do not use the browser UI and MCP bridge concurrently.
SWD and SWO
Version 0.2.0 adds these tools:
| Tools | Purpose |
|---|---|
swd_status, swd_enable, swd_disable |
Configure the probe and reserve/release its pins |
swd_session_start, swd_session_status, swd_session_stop |
Manage one owned host OpenOCD process and inspect logs |
swd_control, swd_set_speed |
Halt/resume, instruction-step, reset/halt, and request clock speed |
swd_read_memory, swd_write_memory, swd_flash |
Bounded memory access and ELF program/verify/reset |
swo_start, swo_read, swo_stop |
Capture UART/NRZ SWO and decode software ITM ports |
Install an OpenOCD build with the CMSIS-DAP TCP backend. The Espressif build used here supports it; some stock 0.12.0 builds do not. Python still requires no runtime packages. Provide trusted local OpenOCD configuration files that select CMSIS-DAP TCP port 4441, read the host from WE_MULTITOOL_HOST, and configure the target. The server sets this environment variable from its WebSocket URL. Target flash algorithms and SWO pin routing belong in these files.
OpenOCD GDB/Tcl/trace ports bind to localhost (defaults 3333/6666/3443). Only one OpenOCD client can connect to the probe: stop a VSCode debug session before starting an MCP session. MCP client shutdown stops its owned process and normally resumes a halted DUT. Stopping a session keeps probe pins reserved; swd_disable releases them to inputs. Use direct wiring only with 3.3 V compatible targets and a shared ground.
Hardware verification
MCP tools were tested on the connected Nucleo L452: probe enable/disable/status, OpenOCD startup/cleanup, halt/resume/reset, single-step in debug_init, and two matching 64-byte Flash reads at requested 4 MHz. SWO at 100 kbaud with an 80 MHz trace clock returned 184 raw bytes / 92 ITM port-0 bytes, including the startup banner, with zero reported overflow packets or decoder errors. This MCP smoke test did not reflash the target.
Single-step waits for the target to halt again. Stepping a sleeping RTOS idle instruction can time out; the tool reports an error instead of reporting successful completion while the target is still running.
SWO reads return raw base64/hex, decoded itm_ports with text and payload bytes, overflow counts, and decoder errors. Decoding persists across reads, including split packets and UTF-8 sequences. Hardware event and timestamp packets are not interpreted as text. A quiet read can return zero bytes. No lossless throughput is promised; overflow counts describe ITM overflow packets, not every possible capture loss.
Memory writes and flashing are marked destructive. Flashing verifies an existing ELF and resets the target; it does not automatically remove protection. Set the MCP client tool timeout to at least 150 seconds for flash operations. Requested SWD speed is not a measurement of the physical clock. Prior direct OpenOCD tests on this L452 passed repeated reads at requested 4 MHz; retest your wiring before using a higher speed.
After installing the updated server, restart the MCP client to discover the new tools. To use this checkout on Windows, set its MCP command to D:/_projects/wise-electronics/multitool-mcp/.venv/Scripts/multitool-mcp.exe after installing with .venv/Scripts/python.exe -m pip install -e ..
Development
python -m pip install -e ".[test]"
python -m pytest
The runtime has no third-party dependencies. The optional test extra installs pytest.
License
Licensed under the GNU General Public License, version 3 or later (GPL-3.0-or-later). See LICENSE.
Metadata
Release files for multitool-mcp 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| multitool_mcp-0.2.0.tar.gz | 24.5 kB | With provenance | Details for multitool_mcp-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| multitool_mcp-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for multitool_mcp-0.2.0-py3-none-any.whl |
Total release size: 44.7 kB
Release files / multitool_mcp-0.2.0.tar.gz
| Download URL | multitool_mcp-0.2.0.tar.gz |
|---|---|
| Size | 24.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
08c1eb5e83e84b5bf5655786869263913bb3a49e69e6de4d0e13bae39c57b351
|
|
BLAKE2b-256 checksum How to use checksums |
1263529ee6b74d20c972569120cda35f46b8c3c37ae8d02a2c420a6c0d23a893
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.
Transparency logRelease files / multitool_mcp-0.2.0-py3-none-any.whl
| Download URL | multitool_mcp-0.2.0-py3-none-any.whl |
|---|---|
| Size | 20.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
44d5ee367e323ec12450742805532038b038e3210265b5c6f98babd5aebd07c9
|
|
BLAKE2b-256 checksum How to use checksums |
178feffa6e3bc5461743abcaa3fa75c2243b06a241fdb0508ccf4144cc3317a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.
Transparency logSecurity for multitool-mcp 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for multitool_mcp-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.