MCP.so
Sign In

Serial-MCP

@PaDev1

About Serial-MCP

MCP server allowing Agents to talk to devices connected to serial port of the computer. Tested only with MAC atm.

Config

Add this server to your MCP-compatible client using the configuration below.

{
  "mcpServers": {
    "serial-mcp": {
      "command": "python",
      "args": [
        "serial_MCP.py"
      ]
    }
  }
}

Tools

No tools detected

We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.

Overview

What is Serial-MCP?

Serial-MCP is a Model Context Protocol (MCP) server that enables AI agents to communicate with devices connected to a serial port on the host computer. Built with the FastMCP framework and pyserial, it provides robust asynchronous serial communication, message buffering, connection management, and detailed error handling. The server is tested only on macOS.

How to use Serial-MCP?

Clone the repository and install dependencies with pip install -r requirements.txt. Configure the server by setting the environment variables SERIAL_PORT, SERIAL_BAUD_RATE, and SERIAL_BUFFER_LENGTH. Add the server to your Claude Desktop configuration using the provided uv run command pointing to serial_MCP.py. Start the server with python serial_MCP.py then use the exposed tools (init_serial, send_message, read_message, etc.) to interact with serial devices.

Key features of Serial-MCP

  • Asynchronous serial communication using asyncio
  • Configurable message buffering with timestamp support
  • Automatic port detection and connection handling
  • Comprehensive error detection and reporting
  • Environment variable and runtime configuration
  • Detailed logging with timestamps and error tracking

Use cases of Serial-MCP

  • Sending commands from an AI agent to an Arduino or embedded device
  • Reading sensor data from a microcontroller over USB serial
  • Controlling hardware peripherals based on natural language instructions
  • Debugging and monitoring serial communication in development workflows

FAQ from Serial-MCP

How do I configure the serial port and baud rate?

The server uses environment variables: SERIAL_PORT (default /dev/tty.usb*), SERIAL_BAUD_RATE (default 9600), and SERIAL_BUFFER_LENGTH (default 100). These can be set in the MCP client configuration or overridden at runtime via the init_serial and configure_serial tools.

What tools are available?

Serial-MCP offers nine tools: delay, init_serial, send_message, read_message, list_serial_ports, get_serial_status, configure_serial, close_serial, and help. Each has documented parameters and return values.

How do I send a message and wait for a response?

Use send_message with wait_for_response: true and an optional response_timeout. The response is returned as a list of timestamped messages in the response_messages field.

What runtime dependencies are required?

Python 3.7+ and the packages pyserial>=3.5, fastmcp>=0.1.0, pydantic>=2.0.0, and asyncio>=3.4.3.

Where are logs stored?

Logs are written to logs/serial_MCP.log with timestamp, level, and message.

Frequently asked questions

How do I configure the serial port and baud rate?

The server uses environment variables: `SERIAL_PORT` (default `/dev/tty.usb*`), `SERIAL_BAUD_RATE` (default `9600`), and `SERIAL_BUFFER_LENGTH` (default `100`). These can be set in the MCP client configuration or overridden at runtime via the `init_serial` and `configure_serial` tools.

What tools are available?

Serial-MCP offers nine tools: `delay`, `init_serial`, `send_message`, `read_message`, `list_serial_ports`, `get_serial_status`, `configure_serial`, `close_serial`, and `help`. Each has documented parameters and return values.

How do I send a message and wait for a response?

Use `send_message` with `wait_for_response: true` and an optional `response_timeout`. The response is returned as a list of timestamped messages in the `response_messages` field.

What runtime dependencies are required?

Python 3.7+ and the packages pyserial>=3.5, fastmcp>=0.1.0, pydantic>=2.0.0, and asyncio>=3.4.3.

Where are logs stored?

Logs are written to `logs/serial_MCP.log` with timestamp, level, and message.

Comments

More Other MCP servers