Skip to main content

MCP server for serial port communication

Project description

Serial MCP Server

A Model Context Protocol (MCP) server for serial port communication, enabling LLMs to interact with hardware devices via serial connections.

Features

  • List available serial ports
  • Open/close serial port connections
  • Read and write data to serial ports
  • Control serial signals (DTR, RTS, CTS, DSR, DCD)
  • Support for custom baud rates, data bits, stop bits, and parity
  • JSON and Markdown output formats

Installation

# Install from PyPI (when published)
pip install serial-mcp-new

Usage

Running the Server

# Run with stdio transport (default, for local use)
serial-mcp

Config in Claude Code

  "mcpServers": {
    "ssh-mcp": {
      "command": "C:\\Users\\DELL\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python311\\Scripts\\serial-mcp.exe",
      "args": [],
      "env": {}
    }
  },

Available Tools

Tool Description
serial_list_ports List all available serial ports
serial_open Open a serial port connection
serial_close Close a serial port connection
serial_write Write data to a serial port
serial_read Read data from a serial port
serial_set_signals Set control signal states
serial_get_signals Read current signal states
serial_list_connections List all active connections

Example Workflow

  1. List available ports:

    serial_list_ports()
    
  2. Open a connection:

    serial_open(port="COM3", baud_rate=115200)
    
  3. Write data:

    serial_write(connection_id="conn_1", data="Hello, device!")
    
  4. Read response:

    serial_read(connection_id="conn_1", timeout=2.0)
    
  5. Close when done:

    serial_close(connection_id="conn_1")
    

Dependencies

  • Python 3.10+
  • mcp >= 1.6.1
  • pyserial >= 3.5
  • pydantic >= 2.0.0

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_new-1.0.0.tar.gz (9.3 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_new-1.0.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file serial_mcp_new-1.0.0.tar.gz.

File metadata

  • Download URL: serial_mcp_new-1.0.0.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for serial_mcp_new-1.0.0.tar.gz
Algorithm Hash digest
SHA256 2209e10dc1b7223a57c9e0543df747e80c5d9bf76123c00765017af5e000350d
MD5 d9bf6219c59d3a190a8e8265fcff9f0c
BLAKE2b-256 7542b150001dd73b831d3893ce5fa384e3f035bc76abae422801028f1fe066df

See more details on using hashes here.

File details

Details for the file serial_mcp_new-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: serial_mcp_new-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for serial_mcp_new-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 675c77a7abd536ac8017816227a5097b07c2c2a247325d517e215fa1e276ae1f
MD5 98c9e51892f095222ccdd92919e57f29
BLAKE2b-256 64ec7f692ec23c17a9236130251a53c6286a608d0ca114a04168a732ce219a6c

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