Skip to main content

serial-mcp

Give an LLM a reliable serial connection to microcontrollers, routers, modems, embedded Linux systems, and anything else with a UART.

serial-mcp is an MCP server built for real device work: interactive shells, bootloader prompts, binary protocols, logging, and file transfers. It continuously buffers incoming data so output is not lost between tool calls.

Claude using serial-mcp to inspect a connected device

Install

The PyPI package is named pyserial-mcp; the command it installs is serial-mcp.

uv tool install pyserial-mcp

Or with pip:

pip install pyserial-mcp

Python 3.10 or newer is required.

Connect it to your MCP client

For Claude Code:

claude mcp add serial-mcp -- serial-mcp

For clients that use an MCP JSON configuration:

{
  "mcpServers": {
    "serial": {
      "command": "serial-mcp"
    }
  }
}

To run without installing, use "command": "uvx" and "args": ["pyserial-mcp"] instead.

What it can do

  • Discover serial ports and USB metadata, then detect an unknown baud rate.
  • Run a single command with automatic open/close, or keep a session open for an interactive shell.
  • Read and write text, raw bytes, and hex data without losing output between calls.
  • React immediately to boot prompts with regex-triggered text or binary replies.
  • Control DTR, RTS, break, and read CTS, DSR, RI, and CD signals.
  • Capture logs and send or receive files with XMODEM checksum or CRC-16.
  • Identify the process holding a busy port and, with explicit use of serial_force_release, terminate it.

Open sessions automatically close after 15 minutes of inactivity by default. Clients should still call serial_close as soon as a session is finished so the port is available to other programs.

Typical workflows

Ask your LLM naturally, for example:

Find the connected serial device, detect its baud rate, and show me its shell prompt.

For one command, the server provides a safe one-shot tool:

serial_execute(port="/dev/ttyUSB0", data="uname -a", expect="\\$")

For longer work, use serial_open, one or more serial_command calls, and serial_close. Use serial_wait_for(..., respond=" ") to catch a time-sensitive prompt such as U-Boot's autoboot interruption.

Tool profiles

The default full profile exposes all 24 tools. If your client loads every tool schema and you only need common text workflows, use the smaller seven-tool profile:

serial-mcp --profile core

You can also set SERIAL_MCP_TOOL_PROFILE=core in the server environment.

Development

No hardware is required to run the test suite:

git clone https://github.com/alxgmpr/serial-mcp.git
cd serial-mcp
uv pip install -e ".[dev]"
pytest -v

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyserial_mcp-0.7.1.tar.gz (102.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyserial_mcp-0.7.1-py3-none-any.whl (24.2 kB view details)

Uploaded Python 3

File details

Details for the file pyserial_mcp-0.7.1.tar.gz.

File metadata

  • Download URL: pyserial_mcp-0.7.1.tar.gz
  • Upload date:
  • Size: 102.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pyserial_mcp-0.7.1.tar.gz
Algorithm Hash digest
SHA256 1ae7008a68cd3232b4c43c1a80fb34917ea6e50e931e2eb850a2fb0f9897d8a0
MD5 e3704e6629f1468a3777b9951f0e180d
BLAKE2b-256 ad82f8c309b8eeeb178fc6fa3968455b69779256b1d008ddedd39dee85ab1575

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyserial_mcp-0.7.1.tar.gz:

Publisher: release.yml on alxgmpr/serial-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyserial_mcp-0.7.1-py3-none-any.whl.

File metadata

  • Download URL: pyserial_mcp-0.7.1-py3-none-any.whl
  • Upload date:
  • Size: 24.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pyserial_mcp-0.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 55914c3474fed18df29061efa1a57f94b01b1d682eb5f9cdb878034843e45c19
MD5 fdebc9c4e2088eb94feda8c1a4a8a935
BLAKE2b-256 b27a6ee42ea16fdb49fe0723ef82e9f71e6518c9d390e269e71f4ffb753f3698

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyserial_mcp-0.7.1-py3-none-any.whl:

Publisher: release.yml on alxgmpr/serial-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.7.4

2 files

0.7.3

2 files

0.7.2

2 files

This release

0.7.1 This release

2 files

0.7.0

2 files

0.6.0

2 files

0.5.0

2 files

0.4.1

2 files

0.4.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page