serio-mcp

v0.1.0
serio-mcp Checked 1 day ago Published 3 months ago

High-performance Model Context Protocol (MCP) server for serial/UART communication with real-time Expect state-machine support.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

serial_list_ports

Enumerate all connected physical and virtual serial ports (e.g. /dev/ttyUSB0, COM3) on the system. Returns port details including device path, description, VID, and PID.

serial_configure

Configure or reconnect to a target serial port and baudrate. Args: port: Serial port device path (e.g. '/dev/ttyUSB0', '/dev/ttyACM0', 'COM3'). baudrate: Communication baud rate (e.g. 115200, 9600, 57600).

ParameterTypeDescription
baudrate
port

serial_expect

Atomically send an optional command and wait for any matching string or regex pattern in the incoming stream. Zero packet loss because the background daemon continuously ingests serial data. Args: patterns: List of regex or string patterns to expect (e.g. ['~ #', 'login:', 'Password:', 'IPQ807x#']). command: Optional initial command string to send before waiting. timeout: Maximum seconds to wait for a match. Defaults to 10.0s. poll_cmd: Optional characters/command to repeatedly send during wait (e.g. ' \r\n' to intercept U-Boot). poll_inter…

ParameterTypeDescription
patterns *array
command
poll_cmd
poll_intervalnumber
timeoutnumber

serial_exec_expect

Execute a shell or U-Boot command and automatically wait for the prompt to return, returning the clean command output. Args: command: The command string to execute. prompts: Optional list of prompt patterns to match (defaults to common Linux/U-Boot prompts). timeout: Maximum seconds to wait for prompt. Defaults to 8.0s.

ParameterTypeDescription
command *string
prompts
timeoutnumber

serial_send

Send raw characters or escape sequences to the serial device (e.g. '\x03' for Ctrl+C, ' ' for space). Args: text: The text or escape sequence to send. send_enter: If True, appends a carriage return / newline (\r\n).

ParameterTypeDescription
text *string
send_enterboolean

serial_read_buffer

Read newly accumulated text from the background stream buffer without blocking. Args: clear: If True, flushes the read buffer after fetching. Defaults to False.

ParameterTypeDescription
clearboolean

serial_get_history

Fetch recent chronological output lines captured by the background daemon. Args: limit: Number of recent lines to retrieve. Defaults to 50.

ParameterTypeDescription
limitinteger

serial_status

Check the current status and health of the serial connection and background worker.