io.github.daedalus/mcp-rs232
An MCP server that exposes RS232 serial port connectivity
Versions
0.1.0latestTools 6
list_ports_tool Tool to list all available serial ports. Returns: List of available serial ports with their details.
open_port Open a serial port connection. Args: port: The name of the port (e.g., "COM1", "/dev/ttyUSB0"). baud_rate: The baud rate for communication (default: 9600). parity: Parity mode - "none", "even", "odd", "mark", "space" (default: "none"). stop_bits: Number of stop bits - 1, 1.5, or 2 (default: 1). data_bits: Number of data bits - 5, 6, 7, or 8 (default: 8). timeout: Read timeout in seconds (default: 1.0). Returns: True if the port was opened successfully. Raises: PortNotFoundError: If the port does not exist. PortAlreadyOpenError: If the port is already open. PortInUseError: If the port is in use by another process. InvalidParameterError: If any parameter is invalid.
close_port Close an open serial port connection. Args: port: The name of the port to close. Returns: True if the port was closed successfully. Raises: PortNotFoundError: If the port does not exist or is not open.
read_port Read data from an open serial port. Args: port: The name of the port to read from. size: Maximum number of bytes to read (default: 4096, max: 4096). timeout: Optional timeout override in seconds. Returns: Hex-encoded string of the data read. Empty string if no data available. Raises: PortNotFoundError: If the port is not open.
write_port Write data to an open serial port. Args: port: The name of the port to write to. data: Hex-encoded string of data to write (e.g., "48656c6c6f" for "Hello"). Returns: Number of bytes written. Raises: PortNotFoundError: If the port is not open. InvalidParameterError: If the data is not valid hex.
get_port_config Get the current configuration of an open serial port. Args: port: The name of the port to query. Returns: Dictionary containing the port configuration. Raises: PortNotFoundError: If the port is not open.
Permissions 0
No permissions indexed yet.