Skip to main content

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.

Built with FastMCP and PyUSB.

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 list
  • usb://classes — USB class code reference
  • usb://{device_id}/info — full descriptor tree
  • usb://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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcusb-2026.3.6.tar.gz (107.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcusb-2026.3.6-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

Details for the file mcusb-2026.3.6.tar.gz.

File metadata

  • Download URL: mcusb-2026.3.6.tar.gz
  • Upload date:
  • Size: 107.7 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

Hashes for mcusb-2026.3.6.tar.gz
Algorithm Hash digest
SHA256 ecba9030082a9a3df5752aa5bb7d6d66260d44097228620f02faf12573327963
MD5 108c8a44aa87149460f0e8741641ebe9
BLAKE2b-256 96128fbfbc5ac859c4270cd7e923a1b0fe039f8f40a595c7b1eddee1c713bbd7

See more details on using hashes here.

File details

Details for the file mcusb-2026.3.6-py3-none-any.whl.

File metadata

  • Download URL: mcusb-2026.3.6-py3-none-any.whl
  • Upload date:
  • Size: 20.5 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

Hashes for mcusb-2026.3.6-py3-none-any.whl
Algorithm Hash digest
SHA256 ea6167c25e8a77dde7403c06231bcfe378c991c7127d1b8b9fc7ea3244e9c408
MD5 3e0a25d12675f879a8c4e93c4e50745f
BLAKE2b-256 38c070f44aa885e1767d5dcf356ac02a8934b705d6d25905a332f05ae6486344

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page