PortDock

Using PortDock MCP from AI clients (Claude Desktop and others) — setup and practice

Settings JSON to add PortDock MCP to Claude Desktop, VS Code or Cursor, and a practice run with Modbus and MC reads and writes against 127.0.0.1 simulators.

Tools for this guideMCP for AI clients · freePort Inspector Windows program · free

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

ToolWhat it does
ports_list · port_inspectCOM port list; one port's driver, problem code, USB path, power saving and latency timer (read-only)
serial_readOpen a port and listen for up to 10 s — sends nothing
modbus_readOne FC 01–04 read (TCP, RTU, RTU over TCP)
mc_readMC 3E binary batch read (0401)
scpi_queryOne query ending with «?» — *RST, *TST?, *CAL? and similar refused
ping · net_adaptersPing (up to 10 times), adapter settings, power saving and firewall profiles
device_map_getBuilt-in device register maps
modbus_write_sim · mc_write_simWrites 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

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

4. Practise with Modbus Slave

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

Sources

Published 2026-10-30