Skip to main content

FastMCP server for test equipment via pyvisa — GPIB, USB-TMC, LAN, and more

Project description

mcpyvisa

MCP server for test equipment. Connects any MCP client (Claude Code, Claude Desktop, etc.) to instruments via pyvisa - GPIB, USB-TMC, LAN/VXI-11, or simulated hardware.

Docs: mcpyvisa.warehack.ing

Install

pip install mcpyvisa
# or
uv add mcpyvisa

Optional extras for specific backends and features:

pip install mcpyvisa[ar488]      # GPIB via AR488/Prologix adapters
pip install mcpyvisa[pyvisa-py]  # USB-TMC, LAN/VXI-11
pip install mcpyvisa[pymeasure]  # Validated drivers for 8 instruments
pip install mcpyvisa[sim]        # Simulated instruments (no hardware needed)
pip install mcpyvisa[all]        # Everything

Add to Claude Code

claude mcp add mcpyvisa -- uvx mcpyvisa

The server runs over stdio. Works with any MCP client.

Configure

Create mcpyvisa.toml in the current directory or ~/.config/mcpyvisa/config.toml:

[server]
log_level = "INFO"

# AR488/Prologix adapter on serial
[[backend]]
name = "bench"
type = "ar488"
transport = "serial"
port = "/dev/ttyUSB0"
baudrate = 115200

# Give instruments friendly names
[instruments.dmm]
resource = "GPIB0::22::INSTR"
backend = "bench"

[instruments.smu]
resource = "GPIB0::24::INSTR"
backend = "bench"

Config search order: $MCPYVISA_CONFIG, ./mcpyvisa.toml, ~/.config/mcpyvisa/config.toml.

Backends

Type Extra What it connects to
ar488 mcpyvisa[ar488] GPIB instruments via AR488 or Prologix adapters (serial or TCP)
pyvisa-py mcpyvisa[pyvisa-py] USB-TMC and LAN/VXI-11 instruments
system (none) NI-VISA or Keysight IO Libraries
sim mcpyvisa[sim] Simulated instruments from YAML definitions

Multiple backends can be active simultaneously. A GPIB bus on serial and a LAN scope work side-by-side through the same server.

Tools (22)

Universal - server_status, connect_backend, disconnect_backend, discover_instruments, instrument_query, instrument_write, instrument_identify, instrument_reset

GPIB - instrument_clear, serial_poll, check_srq, bus_trigger, interface_clear, instrument_local, instrument_remote

AR488 - ar488_command, ar488_diagnostic, configure_ar488

pymeasure (when installed) - instrument_inspect, instrument_get, instrument_set, instrument_call

What a session looks like

You:    Connect to the bench backend and see what's on the bus.

Claude: [connect_backend("bench")] Connected.
        [discover_instruments("bench")] Found 3 instruments:
          GPIB0::5::INSTR   - HP 34401A multimeter
          GPIB0::22::INSTR  - Keithley 2400 SourceMeter
          GPIB0::10::INSTR  - HP 33120A function generator

You:    Measure DC voltage on the DMM.

Claude: [instrument_query("dmm", "MEAS:VOLT:DC?")] -0.00342 V

Try without hardware

Install the sim backend and point it at the included instrument catalog:

[[backend]]
name = "virtual-bench"
type = "sim"
sim_file = "gpib-catalog/sim/all_instruments.yaml"

This gives you 16 simulated instruments that respond to *IDN? and basic SCPI.

pymeasure drivers

When mcpyvisa[pymeasure] is installed, 4 additional tools let you interact with instruments through validated, property-based drivers instead of raw SCPI. Supported instruments:

HP 33120A, HP 34401A, HP 3478A, HP 8657B, Agilent 4284A, Keithley 2000, Keithley 2400, Keithley 6517B

Requirements

  • Python 3.11+
  • pyvisa >= 1.13
  • fastmcp >= 3.0

Links

License

MIT

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

mcpyvisa-2026.2.25.tar.gz (33.8 kB view details)

Uploaded Source

Built Distribution

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

mcpyvisa-2026.2.25-py3-none-any.whl (36.6 kB view details)

Uploaded Python 3

File details

Details for the file mcpyvisa-2026.2.25.tar.gz.

File metadata

  • Download URL: mcpyvisa-2026.2.25.tar.gz
  • Upload date:
  • Size: 33.8 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 mcpyvisa-2026.2.25.tar.gz
Algorithm Hash digest
SHA256 4a6dd762fe865e273b09db1ba6bb95ca54097e9aa2d032cdf98122ffdc235fa7
MD5 5090fe3781069b28290fd636f21e466c
BLAKE2b-256 ccc16175f70742a6087964fe6ff3915478a6ab0746526d75f2366599f9110883

See more details on using hashes here.

File details

Details for the file mcpyvisa-2026.2.25-py3-none-any.whl.

File metadata

  • Download URL: mcpyvisa-2026.2.25-py3-none-any.whl
  • Upload date:
  • Size: 36.6 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 mcpyvisa-2026.2.25-py3-none-any.whl
Algorithm Hash digest
SHA256 fb065b4537bf14514a068f6d9793da239caac2fce6c6364c4eb598a5ce3dffed
MD5 24c61e710da0954bed17927d037b2424
BLAKE2b-256 daacaf494c2f2eefd471190e7cc3fa7ccf0e2820b7834a47aa626bf59e3fb683

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