USB MCP server — enumerate, inspect, and transfer data with USB devices
Project description
mcusb
USB device bridge for Model Context Protocol (MCP). Enumerate, inspect, and transfer data with USB devices through structured tools.
Install
pip install mcusb
# With hot-plug detection (Linux, requires libudev):
pip install mcusb[hotplug]
Or run directly:
uvx mcusb
Register with Claude Code
claude mcp add mcusb -- uvx mcusb
What it does
23 tools for working with USB devices:
- Enumerate — list devices, view topology
- Inspect — descriptors, endpoints, device identification
- Transfer — control, bulk, interrupt, and isochronous read/write
- Manage — kernel drivers, interface claiming, configuration switching
- Monitor — hot-plug event detection via pyudev
4 resources for live device data:
usb://devices— connected device listusb://classes— USB class code referenceusb://{device_id}/info— full descriptor treeusb://events— hot-plug event buffer
All binary data uses hex string encoding. Device IDs use bus:addr format (e.g. 1:2). Write operations require user confirmation via MCP elicitation.
Permissions
USB access typically requires either root privileges or a udev rule. The generate_udev_rule tool creates persistent rules for specific devices:
generate_udev_rule(device_id="1:2")
Environment variables
| Variable | Default | Purpose |
|---|---|---|
MCUSB_DEFAULT_TIMEOUT |
1000 |
Transfer timeout (ms) |
MCUSB_MAX_TRANSFER_SIZE |
1048576 |
Max bytes per transfer |
MCUSB_ALLOW_UNGATED_WRITES |
(unset) | Allow writes without elicitation |
MCUSB_HOTPLUG_BUFFER_SIZE |
50 |
Hot-plug event ring buffer size |
MCUSB_WATCH_TIMEOUT |
30 |
Default watch_hotplug timeout (s) |
Requirements
- Python 3.10+
- libusb (system library)
- Linux recommended (udev integration, hot-plug detection)
License
MIT
Links
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 mcusb-2026.3.6.2.tar.gz.
File metadata
- Download URL: mcusb-2026.3.6.2.tar.gz
- Upload date:
- Size: 107.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"EndeavourOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95efd0e2bbdf2d7e38c94a080dbf94389292bb51a6474944ad603704f61e0a5d
|
|
| MD5 |
6e8e7522597c5ba0c3b244212b8370a0
|
|
| BLAKE2b-256 |
ab878230ba3d6551672f7627b569cbaf1edbc66890d0e35739ccabd498dbf03c
|
File details
Details for the file mcusb-2026.3.6.2-py3-none-any.whl.
File metadata
- Download URL: mcusb-2026.3.6.2-py3-none-any.whl
- Upload date:
- Size: 20.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"EndeavourOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
116d6aaa6ff66fc003a16eec343abd17e1c9c23527a43a109a574ecdba8701e9
|
|
| MD5 |
8a3a225b925829ca936c784d7c4ccb44
|
|
| BLAKE2b-256 |
1a47abb8d1a72b80441821df4d2d44d426da1f8b2e0b33f7cda9d1ea5a592d97
|