mcp-uart

mcp-uart

Enables AI agents to communicate with UART/serial devices, offering tools for port management, data read/write, and protocol handling.

Category
访问服务器

README

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

Tool Description
serial_list_ports Discover available serial ports
serial_open Open a port (auto-opens monitor terminal)
serial_write Write data (text/hex/base64)
serial_read Read buffered messages (supports sinceLastRead)
serial_wait Wait for complete device response (silence detection)
serial_wait_frame Wait for a single data frame
serial_reconfigure Change settings on the fly
serial_status View connection status
serial_close Close a connection
serial_start_monitor Start logging to file
serial_stop_monitor Stop file logging
serial_list_encodings List supported encodings
serial_list_protocols List 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

Encoding Description
utf8 UTF-8 (default)
ascii 7-bit ASCII
latin1 ISO-8859-1 Western European
gbk GBK Simplified Chinese (Windows)
gb2312 GB2312 Simplified Chinese (basic)
gb18030 GB18030 Simplified Chinese (full)
big5 Big5 Traditional Chinese
shift_jis Shift_JIS Japanese
euc-kr EUC-KR Korean
hex Hexadecimal string
base64 Base64 encoded
binary Raw hex bytes

Supported Protocols

Protocol Description
raw No parsing, raw byte stream
line Newline-delimited (\r\n)
delimiter Custom hex delimiter (e.g. 0D0A)
modbus-rtu Modbus RTU frame detection by silence gap
hex-frame Extract between configurable start/end markers
slip SLIP RFC 1055 de-framing

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选