PortDock MCP (portdock-mcp.exe) is a windowless server started by an AI client. MCP (Model Context Protocol) is how AI clients call «tools» in other programs; with this server added, the AI can read this PC's COM port list, Port Inspector reports and network adapters during a conversation, and read Modbus, MC protocol and SCPI values from devices you name. It has been part of the release since 0.7.0, so you can download it now.
What it can and cannot do
| Tool | What it does |
|---|---|
| ports_list · port_inspect | COM port list; one port's driver, problem code, USB path, power saving and latency timer (read-only) |
| serial_read | Open a port and listen for up to 10 s — sends nothing |
| modbus_read | One FC 01–04 read (TCP, RTU, RTU over TCP) |
| mc_read | MC 3E binary batch read (0401) |
| scpi_query | One query ending with «?» — *RST, *TST?, *CAL? and similar refused |
| ping · net_adapters | Ping (up to 10 times), adapter settings, power saving and firewall profiles |
| device_map_get | Built-in device register maps |
| modbus_write_sim · mc_write_sim | Writes only to simulators on 127.0.0.1 / localhost |
The two write tools accept only this PC's address (127.0.0.1, ::1, localhost) and refuse any other target before connecting. The check is by address only — if a program on this PC forwards to another device (a TCP relay, a gateway, an SSH tunnel …), a value written to 127.0.0.1 can reach a real device, so do not use the write tools while such a program is running. Every call is kept in a session log on this PC (%LOCALAPPDATA%\dev.portdock\mcp-log, or inside the portable folder) and never sent anywhere. The same target is called at most once per 100 ms, and 120 calls per minute overall.
1. Install
- Claude Desktop: download PortDock-MCP.mcpb from the release and open it to get the install screen. You can choose the message language (en or ko).
- Other clients: unzip PortDock-MCP.zip into a folder (for example C:\Tools\PortDock-MCP) and put the exe path in command as below. There are no arguments.
- With Scoop: run scoop bucket add portdock https://github.com/portdock/scoop-bucket once, then scoop install portdock/portdock-mcp. Find the install folder with scoop prefix portdock-mcp and put the portdock-mcp.exe path inside it in command.
- It is not code-signed yet, so security policy on company PCs may block it. Ask your administrator first.
2. Settings examples
To set up Claude Desktop by hand, add this to claude_desktop_config.json (Settings → Developer → Edit config) and restart the app. Cursor's mcp.json uses the same shape.
{
"mcpServers": {
"portdock": {
"command": "C:\\Tools\\PortDock-MCP\\portdock-mcp.exe",
"env": { "PORTDOCK_MCP_LANG": "en" }
}
}
}VS Code uses servers in the workspace file .vscode/mcp.json.
{
"servers": {
"portdock": {
"type": "stdio",
"command": "C:\\Tools\\PortDock-MCP\\portdock-mcp.exe"
}
}
}Claude Code registers it once from the command line.
claude mcp add portdock -- C:\Tools\PortDock-MCP\portdock-mcp.exe
Paths inside JSON need doubled backslashes (\\). Once connected, the client's tool list shows the 11 tools such as ports_list. Keeping the client's «allow this tool call?» prompt turned on is recommended.
3. Practise without a PLC — PLC Simulator
- Open PortDock PLC Simulator, keep frame 3E binary, bind address 127.0.0.1 and port 5000 (defaults) and press Start. Put values in D100–D102.
- Ask the AI: «Read 3 words from D100 on the PLC simulator at 127.0.0.1 port 5000» → mc_read is called and returns the values.
- «Write 42 to D200 and read it back» → mc_write_sim, then mc_read. D200 changes on the simulator screen too.
- Change only the address to something like 192.168.0.10 and mc_write_sim ends with «Refused» — it does not connect to any address other than this PC.
4. Practise with Modbus Slave
- In PortDock Modbus Slave choose «TCP server (Modbus TCP)», change the bind address to 127.0.0.1 (the default 0.0.0.0 lets other PCs connect and triggers a firewall prompt), start it on a free port (for example 1502) and put values in a few holding registers.
- «Read 4 holding registers from 0 at 127.0.0.1:1502 unit 1» → modbus_read (FC 03). You can also ask it to decode 0–1 as a float (ABCD).
- For a device map: «Find the measured-value address in the Autonics MT4W map» → device_map_get. Addresses and scales are unofficial; check the device manual once more.
5. Look at COM port problems together
Ask «list my COM ports», «read the driver and USB power saving of COM3» or «when did COM3 disconnect in the last 7 days» and ports_list or port_inspect is called. User folder paths in the results are masked as «~» and MAC addresses as «xx-…». The fixes (Device Manager, Power Options) are yours to make — this server changes no settings.
Cautions
- Tool results go to the AI client you use. If you handle company device values, check that client's data policy first.
- The write tools only look at the address. Do not use them while a program on this PC forwards to real devices (PortDock TCP relay, a vendor gateway, an SSH tunnel …).
- Text sent by devices (such as an *IDN? reply) is only data, and the server tells the client so.
- Do not let the AI settle what a value means on its own — match units, scale and address notation (40001 and so on) against the device manual.
Sources
- Model Context Protocol — Connect to local MCP servers — Claude Desktop config file (mcpServers, command, env)
- VS Code — Use MCP servers — servers and type stdio in .vscode/mcp.json
- Cursor — Model Context Protocol — mcpServers in mcp.json
- MCP Bundles (.mcpb) — bundle format (manifest.json)
Published 2026-10-30