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.1.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.1-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mcusb-2026.3.6.1.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.1.tar.gz
Algorithm Hash digest
SHA256 b05623ab94d9cf86baa53427946fcc9a114057a7f95039b59c5a152eb4072574
MD5 35594f8f55182becbbff93abd8020a16
BLAKE2b-256 4e0b7e2bbd7ee8f60fb414cb472a2b961f4022f14c471368e8b9d6192d548663

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mcusb-2026.3.6.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 36f2590126a4186efdd2a9307b12ee1a51c5668a037f9ee5f44d6d2b991173fa
MD5 ad7122bd8229db92c835056d34688eb6
BLAKE2b-256 12909706a78b3b1ed237fd70a1589c49ebb615ef5afbbfa413145eb46df2fc79

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