Initial MCP serial server implementation

FastMCP server for serial port access via Model Context Protocol:
- 10 tools: list, open, close, read, write, configure, flush, status
- 4 dynamic resources: ports list, data, status, raw hex
- USB device filtering (hides phantom ttyS ports by default)
- Full pyserial support with configurable baudrate/parity/etc
This commit is contained in:
Ryan Malloy 2026-01-27 22:05:59 -07:00
commit 1a26109fc1
6 changed files with 685 additions and 0 deletions

13
.env.example Normal file
View file

@ -0,0 +1,13 @@
# MCP Serial Server Configuration
# Default baud rate for serial connections
MCSERIAL_DEFAULT_BAUDRATE=9600
# Default timeout in seconds for read operations
MCSERIAL_DEFAULT_TIMEOUT=1.0
# Maximum number of concurrent serial port connections
MCSERIAL_MAX_CONNECTIONS=10
# Log level (DEBUG, INFO, WARNING, ERROR)
MCSERIAL_LOG_LEVEL=INFO