Skip to main content

MCP server for serial port management

Project description

serial-mcp

MCP server for serial port communication. Provides tools to open, read, write, and manage serial ports through the Model Context Protocol.

Written by and for AI.

Features

  • List available serial ports on the system
  • Open ports with configurable baud rate, parity, stop bits, and flow control
  • Read data by byte count, terminator character, or duration
  • Write string or hex data
  • Send BREAK signals
  • Monitor port status and control line states

Installation

Via PyPI

uvx serial-mcp@latest

Local Clone

git clone https://github.com/davidalo/serial-mcp.git
cd serial-mcp
uvx --from "$(pwd)" serial-mcp

Integration

Via PyPI

# Claude Code
claude mcp add serial -- uvx serial-mcp@latest

# Codex CLI
codex mcp add serial -- uvx serial-mcp@latest

Local Clone

git clone https://github.com/davidalo/serial-mcp.git
cd serial-mcp

# Claude Code
claude mcp add serial -- uvx --from "$(pwd)" serial-mcp

# Codex CLI
codex mcp add serial -- uvx --from "$(pwd)" serial-mcp

Tools

Tool Description
list_ports List available system serial ports
open_port Open a serial port with configuration (baud rate, parity, stop bits, etc.)
close_port Close an open port
write_data Write string or hex data to a port
read_bytes Read N bytes with timeout
read_until Read until a terminator character
read_for_duration Read continuously for N seconds
send_break Send a BREAK signal
get_port_status Get port status and control line states
list_open_ports List all currently managed ports

Testing with Virtual Ports

Use socat to create virtual serial port pairs for testing:

# Create virtual port pair
socat -d -d pty,raw,echo=0,link=/tmp/ttyV0 pty,raw,echo=0,link=/tmp/ttyV1

Then open /tmp/ttyV0 with the MCP server and /tmp/ttyV1 with another terminal program to test communication.

Requirements

  • Python 3.10+
  • uv package manager (for running with uvx)

License

MIT

Project details


Download files

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

Source Distribution

serial_mcp-0.2.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

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

serial_mcp-0.2.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file serial_mcp-0.2.0.tar.gz.

File metadata

  • Download URL: serial_mcp-0.2.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.25 {"installer":{"name":"uv","version":"0.9.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for serial_mcp-0.2.0.tar.gz
Algorithm Hash digest
SHA256 9165a22a704f6395481ad3bd291450d9713b7d89c4e22df3022b8ca17b0bf061
MD5 0f660f2e29643a3df65e8e7caf7c5cbb
BLAKE2b-256 0093f6e1979bb2f7129871dcb905c26adc151a87f3791d735095dd6c9261e2ad

See more details on using hashes here.

File details

Details for the file serial_mcp-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: serial_mcp-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.25 {"installer":{"name":"uv","version":"0.9.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for serial_mcp-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 16cfacb9c13d792c3e68fbf2723ad1ab4617100e0f1447377ddee207e83eaeab
MD5 c10e16134509192ae1d510456135275f
BLAKE2b-256 13f6e6a8e5e7010577dc89eec0a0d30007ca690b3ea3411072a95702c50200fe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page