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.2.tar.gz (107.9 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.2-py3-none-any.whl (20.7 kB view details)

Uploaded Python 3

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

Hashes for mcusb-2026.3.6.2.tar.gz
Algorithm Hash digest
SHA256 95efd0e2bbdf2d7e38c94a080dbf94389292bb51a6474944ad603704f61e0a5d
MD5 6e8e7522597c5ba0c3b244212b8370a0
BLAKE2b-256 ab878230ba3d6551672f7627b569cbaf1edbc66890d0e35739ccabd498dbf03c

See more details on using hashes here.

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

Hashes for mcusb-2026.3.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 116d6aaa6ff66fc003a16eec343abd17e1c9c23527a43a109a574ecdba8701e9
MD5 8a3a225b925829ca936c784d7c4ccb44
BLAKE2b-256 1a47abb8d1a72b80441821df4d2d44d426da1f8b2e0b33f7cda9d1ea5a592d97

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