Resources
MCP resources provide structured, read-only data that clients can access without executing tools. mcpyvisa exposes two static resources: the AR488/Prologix command reference and (when pymeasure is installed) the list of instruments with validated driver support.
visa://protocol/commands
Section titled “visa://protocol/commands”URI: visa://protocol/commands
Returns the full AR488/Prologix ++ command reference as a JSON document. This resource is static — it does not require a connected backend and is available immediately on server startup.
This is useful for LLMs that need to construct raw ++ commands or understand the underlying protocol without having to consult external documentation.
Reading the resource
result = await client.read_resource("visa://protocol/commands")Response structure
The response is a JSON object with three top-level keys:
{ "prologix_commands": { "++addr [N]": "Show or set current GPIB address (1-30)", "++auto [0|1|2|3]": "Auto-read mode: 0=off, 1=prologix, 2=on-query, 3=continuous", "++clr": "Send Selected Device Clear (SDC) to addressed device", "++eoi [0|1]": "Enable/disable EOI assertion on last byte", "++eor [0-7]": "Set EOR char: 0=CRLF 1=CR 2=LF 3=None 4=LFCR 5=ETX 6=CRLF+ETX 7=SPACE", "++eos [0-3]": "Set end-of-send character (0=CRLF, 1=CR, 2=LF, 3=None)", "++eot_enable [0|1]": "Enable/disable appending EOT character on EOI detection", "++eot_char [N]": "Set EOT character (ASCII 0-255)", "++ifc": "Assert Interface Clear for 150us -- become Controller-In-Charge", "++llo [all]": "Local Lockout -- disable front panel on instrument(s)", "++loc [all]": "Go To Local -- re-enable front panel on instrument(s)", "++mode [0|1]": "Set interface mode: 0=device, 1=controller", "++read [eoi|N]": "Read from bus until EOI, char N, or timeout", "++read_tmo_ms [N]": "Set read timeout in milliseconds (1-32000)", "++rst": "Reset the controller", "++savecfg": "Save configuration to NVS flash", "++spoll [N]": "Serial poll address N (or current address)", "++srq": "Return SRQ line state (0=unasserted, 1=asserted)", "++status [N]": "Set/get status byte for device mode", "++trg [N ...]": "Send Group Execute Trigger to address(es)", "++ver [real]": "Show firmware version string", "++verbose [0|1]": "Enable/disable human-readable output" }, "extended_commands": { "++allspoll [N ...]": "Serial poll multiple addresses, returns addr:status pairs", "++findlstn": "Find all listeners on the bus (returns space-separated addresses)", "++findrqs [N ...]": "Find device requesting service (returns SRQ:addr,status)", "++dcl": "Send Universal Device Clear to all devices", "++default": "Reset to factory default configuration", "++id name [S]": "Show/set interface name (max 15 chars)", "++id serial [N]": "Show/set interface serial number (max 9 digits)", "++id verstr [S]": "Show/set custom version string (max 47 chars)", "++idn [0|1|2]": "Enable *IDN? response: 0=off, 1=name, 2=name+serial", "++macro [N] [set|del]": "List/run/edit/delete macros (0-9, 128 bytes each)", "++ppoll": "Conduct parallel poll (returns response byte)", "++prompt [0|1]": "Show/hide command prompt", "++ren [0|1]": "Assert/deassert Remote Enable", "++repeat N ms cmd": "Repeat a command N times with ms delay", "++setvstr [S]": "Set custom version string (alias for ++id verstr)", "++srqauto [0|1]": "Auto serial poll on SRQ assertion", "++tmbus [N]": "Bus settling delay in microseconds (0-30000)", "++ton [0|1]": "Talk-only mode", "++xdiag mode byte": "Bus diagnostics: mode 0=data, 1=control" }, "notes": { "gpib_addresses": "Valid range 0-30. Address 0 is typically the controller.", "scpi_queries": "Commands ending with '?' expect a response -- use instrument_query.", "scpi_commands": "Commands without '?' set parameters -- use instrument_write.", "common_scpi": [ "*IDN? -- Identify instrument", "*RST -- Reset to power-on defaults", "*CLS -- Clear status registers", "*ESE N -- Set event status enable register", "*ESR? -- Read event status register", "*OPC -- Operation complete", "*OPC? -- Operation complete query", "*SRE N -- Set service request enable register", "*STB? -- Read status byte", "*TST? -- Self-test", "*WAI -- Wait for pending operations" ] }}visa://pymeasure/supported
Section titled “visa://pymeasure/supported”URI: visa://pymeasure/supported
Returns a JSON array of instruments that have pymeasure driver support. This resource is only available when pymeasure is installed (pip install mcpyvisa[pymeasure]).
Use this to quickly check which instruments on the bench can use the validated instrument_inspect / instrument_get / instrument_set / instrument_call tools instead of raw SCPI.
Reading the resource
result = await client.read_resource("visa://pymeasure/supported")Response structure
[ { "catalog_id": "keithley-2400", "module": "pymeasure.instruments.keithley", "class_name": "Keithley2400" }, { "catalog_id": "hp-34401a", "module": "pymeasure.instruments.hp", "class_name": "HP34401A" }, { "catalog_id": "keithley-2000", "module": "pymeasure.instruments.keithley", "class_name": "Keithley2000" }]Each entry maps a catalog identifier (used internally for IDN matching) to the pymeasure module and class that provides the validated driver.