MCP server that exposes RS485 bus connectivity
Project description
mcp-rs485
MCP server that exposes RS485 bus connectivity for reading and writing serial data.
mcp-name: io.github.daedalus/mcp-rs485
Install
pip install mcp-rs485
Configuration
{
"mcpServers": {
"mcp-rs485": {
"command": "mcp-rs485",
"env": {},
"name": "io.github.daedalus/mcp-rs485"
}
}
}
Usage
This MCP server exposes RS485 serial bus connectivity through the Model Context Protocol. It allows AI assistants to interact with RS485 devices.
Tools
list_ports: Lists all available serial ports on the systemconnect_rs485: Opens a connection to an RS485 devicedisconnect_rs485: Closes an RS485 connectionread_rs485: Reads data from an open RS485 connectionwrite_rs485: Writes data to an RS485 connectionget_connection_status: Gets the status of an RS485 connection
Example
from mcp_rs485.server import connect_rs485, write_rs485, read_rs485
# Connect to a device
conn_id = connect_rs485("/dev/ttyUSB0", baudrate=9600)
# Write data (Modbus RTU example)
write_rs485(conn_id, "01 03 00 00 00 0A")
# Read response
response = read_rs485(conn_id)
# Cleanup
disconnect_rs485(conn_id)
Development
git clone https://github.com/daedalus/mcp-rs485.git
cd mcp-rs485
pip install -e ".[test]"
# run tests
pytest
# format
ruff format src/ tests/
# lint
ruff check src/ tests/
# type check
mypy src/
API
list_ports()
Lists all available serial ports.
Returns: List of port dictionaries with port, description, and hwid.
connect_rs485(port, baudrate=9600, parity="N", stopbits=1, bytesize=8, timeout=1.0)
Opens a connection to an RS485 device.
Parameters:
port: Serial port path (e.g., "/dev/ttyUSB0")baudrate: Communication speed (default: 9600)parity: "N" (none), "E" (even), "O" (odd)stopbits: Number of stop bitsbytesize: Data bits per frametimeout: Read timeout in seconds
Returns: Connection ID string.
read_rs485(connection_id, length=1024)
Reads data from an open RS485 connection.
Parameters:
connection_id: Connection ID from connect_rs485length: Maximum bytes to read
Returns: Hex string of received data.
write_rs485(connection_id, data)
Writes data to an RS485 connection.
Parameters:
connection_id: Connection ID from connect_rs485data: Hex string (e.g., "01 03 00 00 00 0A")
Returns: Number of bytes written.
get_connection_status(connection_id)
Gets connection status and statistics.
Returns: Dictionary with connection state and statistics.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_rs485-0.1.0.tar.gz.
File metadata
- Download URL: mcp_rs485-0.1.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
91b02c3b19ba0aa859fc524da7bbabea5e6fe5549189d00a920c1db0e7017579
|
|
| MD5 |
7b6fdc10c5fff17bf2da41768c7e4f20
|
|
| BLAKE2b-256 |
2228bbb957a3b0ecdc8ebef4df3fffc8ea5bdf5ea4b57ad480a17029f0f09331
|
Provenance
The following attestation bundles were made for mcp_rs485-0.1.0.tar.gz:
Publisher:
pypi-publish.yml on daedalus/mcp-rs485
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_rs485-0.1.0.tar.gz -
Subject digest:
91b02c3b19ba0aa859fc524da7bbabea5e6fe5549189d00a920c1db0e7017579 - Sigstore transparency entry: 1191406000
- Sigstore integration time:
-
Permalink:
daedalus/mcp-rs485@134076d363b0bb9bd8bed4efb71d51724c7fd981 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/daedalus
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@134076d363b0bb9bd8bed4efb71d51724c7fd981 -
Trigger Event:
release
-
Statement type:
File details
Details for the file mcp_rs485-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mcp_rs485-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da077642ad7a783e73151295ccf43ab341d19b2c6200e18059d1d3b72582ae28
|
|
| MD5 |
fb56bd2c7d90573564522b5c8e4e7510
|
|
| BLAKE2b-256 |
bc6e33b8ef1b0a634ab80230d02dce80a392e748ce9764781ab59e6c470f24b9
|
Provenance
The following attestation bundles were made for mcp_rs485-0.1.0-py3-none-any.whl:
Publisher:
pypi-publish.yml on daedalus/mcp-rs485
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_rs485-0.1.0-py3-none-any.whl -
Subject digest:
da077642ad7a783e73151295ccf43ab341d19b2c6200e18059d1d3b72582ae28 - Sigstore transparency entry: 1191406003
- Sigstore integration time:
-
Permalink:
daedalus/mcp-rs485@134076d363b0bb9bd8bed4efb71d51724c7fd981 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/daedalus
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@134076d363b0bb9bd8bed4efb71d51724c7fd981 -
Trigger Event:
release
-
Statement type: