convez.ai
MCP ServerAutomaçãoIntermediário
SamyiHu

MCP UART — Servidor Serial para Agentes IA

SamyiHu/mcp-uart

Comunique agentes IA com dispositivos seriais via UART

Ver no GitHub
InicialPluginScore · de 0 a 100

Servidor MCP que conecta agentes IA (Claude, Cline, Cursor) a dispositivos UART/serial. Oferece 11 ferramentas para ler, escrever, monitorar e reconfigurar portas seriais em tempo real, com suporte a 12 codificações e 6 protocolos diferentes.

Instalação

$npx convez-ai SamyiHu/mcp-uart

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
1
Forks
0
Acompanhando
0
Saúde
42%
Último commit
há 1 mês
Versão
—
Issues abertas
0
Contribuidores
1

Casos de uso

  • Automação de dispositivos embarcados (microcontroladores, sensores)
  • Depuração e monitoramento de comunicação serial em tempo real
  • Integração de hardware com workflows de IA (Modbus RTU, protocolos customizados)

Veredito

Ferramenta especializada e bem implementada para quem precisa conectar agentes IA a hardware serial. A cobertura de protocolos (Modbus, Hex frame, SLIP) e codificações (GBK, Shift_JIS, etc.) demonstra maturidade; ideal para IoT, eletrônica embarcada e troubleshooting.

README

A tradução para o português deste README ainda está na fila.

mcp-uart

Serial Port MCP Server for AI agents. Lets Claude, Cline, Cursor, and other MCP-compatible AI tools talk to UART/serial devices.

Features

  • 11 Tools: list ports, open, write, read, wait (single frame / full response), reconfigure, status, close, monitor start/stop, list encodings, list protocols
  • 12 Encodings: UTF-8, ASCII, Latin-1, GBK, GB2312, GB18030, Big5, Shift_JIS, EUC-KR, Hex, Base64, Binary
  • 6 Protocols: Raw, Line (newline), Custom delimiter, Modbus RTU, Hex frame, SLIP (RFC 1055)
  • Smart Wait: serial_wait collects a full device response (silence detection), serial_wait_frame returns on first frame
  • Real-time Monitor: Auto-opens a terminal window showing TX/RX data live, like a serial assistant
  • Time-aware Read: sinceLastRead mode returns only new messages with timing metadata
  • File Logging: serial_start_monitor logs all data to a file, viewable with tail -f

Install

From npm

npm install -g mcp-uart

From source

git clone https://github.com/yourname/mcp-uart.git
cd mcp-uart
npm install
npm run build

Setup

Claude Code

claude mcp add uart -- mcp-uart

Or add to ~/.claude/settings.json:

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

Cline (VS Code)

Open Cline -> MCP Servers -> Edit Configuration, add:

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

Cursor

Add to Cursor MCP settings:

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

From source (not installed globally)

If running from a local clone instead of npm install -g:

{
  "mcpServers": {
    "uart": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-uart/dist/index.js"]
    }
  }
}

Usage

Once configured, talk to your AI naturally:

"List available serial ports"
"Open COM3 at 115200 baud with GBK encoding and Modbus RTU protocol"
"Send 01030000000A in hex"
"Wait for the device to finish responding"
"Read any new data since my last read"
"Switch to 9600 baud"
"Close the connection"

Tools Reference

ToolDescription
serial_list_portsDiscover available serial ports
serial_openOpen a port (auto-opens monitor terminal)
serial_writeWrite data (text/hex/base64)
serial_readRead buffered messages (supports sinceLastRead)
serial_waitWait for complete device response (silence detection)
serial_wait_frameWait for a single data frame
serial_reconfigureChange settings on the fly
serial_statusView connection status
serial_closeClose a connection
serial_start_monitorStart logging to file
serial_stop_monitorStop file logging
serial_list_encodingsList supported encodings
serial_list_protocolsList supported protocols

Standalone Serial Monitor

Run directly from the terminal (no AI needed):

# Global install
serial-monitor COM3 115200 utf8

# From source
node dist/monitor.js COM3 115200 utf8

Type and press Enter to send. Ctrl+C to exit.

Supported Encodings

EncodingDescription
utf8UTF-8 (default)
ascii7-bit ASCII
latin1ISO-8859-1 Western European
gbkGBK Simplified Chinese (Windows)
gb2312GB2312 Simplified Chinese (basic)
gb18030GB18030 Simplified Chinese (full)
big5Big5 Traditional Chinese
shift_jisShift_JIS Japanese
euc-krEUC-KR Korean
hexHexadecimal string
base64Base64 encoded
binaryRaw hex bytes

Supported Protocols

ProtocolDescription
rawNo parsing, raw byte stream
lineNewline-delimited (\r\n)
delimiterCustom hex delimiter (e.g. 0D0A)
modbus-rtuModbus RTU frame detection by silence gap
hex-frameExtract between configurable start/end markers
slipSLIP RFC 1055 de-framing

License

MIT

Ver o original no GitHub

Bom para

Relacionados