Bench
Bench 是一款原生的 macOS MCP 服务器,它让 Claude Code、Cursor 和 Windsurf 等 AI 工具能够识别已连接的 USB 硬件。它可以识别设备、查找串口并识别常见的创客开发板——让您的 AI 助手了解您的工作台上有什么。
无需 API 密钥。无需驱动程序。一条命令即可安装。
功能概览
涵盖四个类别的 22 个工具:
发现
工具 | 描述 |
| 健康检查 — 返回服务器状态、版本、macOS 版本 |
| 列出所有已连接的 USB 设备,包括供应商、类型、速度、序列号 |
| 通过序列号、位置 ID 或名称获取特定设备的详细信息 |
| 智能识别 83 种以上的已知创客/开发板 |
| 枚举串口并匹配对应的 USB 设备 |
| USB 集线器树状视图,显示端口层级和连接情况 |
| 完整的 USB 描述符链 — 接口、端点、类代码 |
| 通过 esptool 检测 ESP32/微控制器的确切芯片类型 |
监控
工具 | 描述 |
| 检测调用期间的 USB 连接/断开事件 |
| 捕获并对比 USB 设备状态快照 |
| 查询系统日志以获取特定设备的 USB 错误 |
| 每个设备的功耗、总线预算、充电检测 |
管理
工具 | 描述 |
| 安全卸载并弹出可移动存储设备 |
| 为设备设置持久化的用户自定义别名 |
| 重置 USB 端口以恢复死机的设备 |
| 通过 esptool/dfu-util/avrdude/UF2 烧录固件 |
| 发送/接收原始 HID 报告 |
串口通信
工具 | 描述 |
| 打开具有可配置波特率、数据位、校验位的串口连接 |
| 从打开的串口连接中读取可用数据 |
| 向打开的串口连接写入数据或命令 |
| 关闭打开的串口连接 |
| 捕获 N 秒的串口输出(启动日志、调试输出) |
Related MCP server: mcp-serial
特性
设备分类 — 自动将设备归类为存储、输入、集线器、视频、串口适配器、微控制器或调试器
串口检测 — 将 USB 设备映射到其
/dev/cu.*串口(创客最常问的问题)83 种以上已知开发板 — 识别 Arduino、Raspberry Pi、ESP32、Adafruit、SparkFun、Teensy、STM32 以及常见的 USB 转串口芯片
存储信息 — USB 驱动器的挂载点、容量和剩余空间
USB 监控 — 事件跟踪、状态快照、诊断日志查询和电源分析
固件烧录 — 直接烧录 ESP32、STM32、Arduino AVR 和 RP2040 开发板
HID 交互 — 与 Stream Deck、宏键盘和自定义 HID 设备发送及接收报告
串口通信 — 通过可配置的波特率、数据位、校验位和停止位打开、读取、写入和监控串口
要求
macOS 14+ (Sonoma 或更高版本),运行于 Apple Silicon
支持 MCP 的 AI 工具(Claude Code、Cursor、Windsurf 等)
从源码构建:Xcode 16.3+ / Swift 6.1+
安装
Homebrew (推荐)
brew install seayniclabs/tap/bench从源码构建
git clone https://github.com/seayniclabs/bench.git
cd bench
swift build -c release
codesign --force --sign - --entitlements Sources/Bench/Bench.entitlements .build/release/Bench二进制文件位于 .build/release/Bench。
添加到 Claude Code
claude mcp add bench -- $(which bench)或者手动添加到 ~/.claude.json:
{
"mcpServers": {
"bench": {
"command": "/path/to/bench",
"args": []
}
}
}使用方法
连接后,直接与您的 AI 工具对话即可:
“连接了哪些 USB 设备?”
“我的 Arduino 在哪个端口?”
“识别 /dev/cu.usbserial-2120 上的设备”
“弹出 Samsung T7”
“显示所有存储设备”
“以 9600 波特率打开到 /dev/cu.usbserial-2120 的串口连接”
“监控我的 ESP32 串口输出 10 秒”
工作原理
Bench 使用 Apple 的 IOKit 框架在 macOS 上原生枚举 USB 设备。它通过串口检测(扫描 /dev/cu.*)、存储信息(diskutil)以及内置的已知创客开发板数据库来丰富结果。它通过 Model Context Protocol (JSON-RPC) 使用 stdio 与 AI 工具进行通信。
AI Tool --stdio/JSON-RPC--> Bench --IOKit--> USB Device Tree
--diskutil--> Storage Info
--/dev/cu.*--> Serial Ports
--DeviceDB--> Board Recognition无需特殊权限。IOKit USB 枚举无需 CLI 二进制文件的授权即可工作。
构建
swift build # debug build
swift build -c release # release build
swift test # run testsBench 需要 Swift 6.1+ 并针对 macOS 14+ 进行编译。
许可证
MIT
致谢
由 Seaynic Labs 构建。
This server cannot be deployed
Maintenance
Related MCP Connectors
Generate IDs, QR codes, and hashes, encode values, geolocate IPs, plus gated host diagnostics.
Developer toolkit: UUID, timestamp, unit conversion, JSON tools, and QR code (SVG). Free.
Read-only MAC address, OUI, and vendor lookup tools for network diagnostics.
21Developer and text tools: JSON, QR codes, units, passwords, UUIDs, hashes, Base64, regex and more.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables control of Digilent WaveForms instruments (oscilloscope, AWG, logic analyzer) over USB, supporting devices like Analog Discovery 2/3 and Digital Discovery.3MIT
- AlicenseAqualityCmaintenanceEnables AI agents to communicate with serial devices such as Arduinos, ESP32s, USB-UART adapters, and RS-232 instruments by discovering ports, opening connections, sending commands, reading responses, and controlling reset lines.121MIT
- AlicenseAqualityAmaintenanceLocal serial and USB hardware access for coding agents, with typed YAML protocol commands, checksum validation, audited writes, lossless captures, hardware-free replay, and MCP App visualizations. Runs locally over stdio; live hardware use requires a serial device connected to the same machine.187MIT
- AlicenseBqualityCmaintenanceEnables remote control and observation of the ESP32-2432S028 CYD desktop via USB serial, including status checks, app launching, touch/key input, file transfer, UI tree inspection, diagnostics, and execution control of MicroPython apps.421MIT