VisaMCPControl Lab Instruments with AI

A small program that runs on your own PC and lets an AI assistant talk to your instruments through whatever VISA you already have. It is an experiment rather than a product, and it may or may not suit the way you work.

Windows and Linux  ·  works with any VISA

What it does

MCP, the Model Context Protocol, is a way for an AI client to call tools that run somewhere else. VisaMCP is one of those tools. It is a command line program you start on your own machine, and it offers the ordinary VISA operations as MCP tools: find resources, open a session, write, read, query, set termination and timeouts, read the status byte, wait for a service request, and so on.

The AI client decides what to ask for. VisaMCP does the actual talking to the instrument. Everything runs locally, and the instrument never sees anything other than the commands that were sent to it.

Where this might help, and where it might not

I was sceptical about AI for a long time, and in some places I still am. What changed my mind was not a grand demonstration. It was a few small moments where it saved me an afternoon of reading.

The case where it earns its keep is an instrument you do not know yet. You have a box on the bench, a manual of several hundred pages written in 1987, and a question that should take two commands to answer. Being able to describe what you want and converge on a working sequence in a few minutes is worth something, particularly when the alternative is paging through a scanned PDF looking for the one mnemonic that sets the trigger source.

The case where it does not help is the one where you already know the instrument. A script you wrote yourself is faster, cheaper and entirely predictable, and it will behave the same way next year. Plenty of people work that way and have no reason to change. This is not meant to replace that.

A word of caution.AI-assisted work is easy to start and harder to keep. A few prompts get you something that runs, which makes it tempting to keep going without ever deciding what the thing is supposed to be. Six months later you have code that works, that nobody fully understands, and that nobody can safely change. If the result is going to live longer than an afternoon, decide the architecture first and treat whatever comes out of the assistant as a draft to review, not as an answer.

Why it is not inside the adapter

The first plan was to put an MCP server into the GPIBEE firmware itself. That is perfectly feasible: the device already has its own REST module, and an MCP layer on top of it would not have been a large step.

The reason I did not do it is a limitation that would have been built in from the start. An MCP server inside the adapter can only ever reach instruments on the GPIB bus. Most benches are not purely GPIB any more. There is usually a USB-TMC instrument, something on the LAN, perhaps a serial supply, and an assistant that can see half the bench and not the other half is awkward to work with.

Putting it on the PC on top of a VISA solves that. VisaMCP reaches everything the VISA reaches, GPIB included, and the adapter stays a bus adapter.

What you need

Where GPIBEE gets extra attention

Any VISA instrument works, but this is the adapter I build, so it is the one I could support properly rather than generically. When a GPIBEE is on the network it is found and recognised on its own, and everything the adapter can do is offered to the assistant as its own tool rather than hidden behind a raw command string:

The older UsbGPIB V2 is supported too.

Download

There are no external runtime libraries to install: unpack it and run it.

⬇ Windows x64 VisaMcp-win64.zip · 2.4 MB ⬇ Linux x64 VisaMcp-linux-x64.tar.gz · 2.5 MB
Real instruments, real risk.An assistant can misread a manual, confuse a unit or pick the wrong channel, and the command still goes out on the bus. A supply told 30 V instead of 3 V will deliver 30 V. An output can be switched on into a circuit that is not ready for it, and a generator can be set well above what the device under test survives. Set the voltage and current limits in the instrument itself, start on equipment you could afford to lose, and keep an eye on what is being sent. The limits in the hardware are the safety net, not the assistant.
Feedback welcome.This is an experiment, and how it is put together may well change. If something does not work, or a design decision in it looks wrong to you, let me know.

Installing it and connecting Claude

  1. Unpack it somewhere permanent

    Anywhere will do, but the path goes into a configuration file, so pick a folder you are not going to tidy away later. Something like C:\Tools\VisaMcp\ on Windows or ~/bin/VisaMcp/ on Linux.

  2. Run it once from a terminal, then close it again

    Start the program by hand before wiring anything up. It prints which VISA it loaded and what it can see. If it cannot find a VISA, that is the problem to fix first, and it has nothing to do with the AI side.

    This is a one-off check, not how the program is meant to run. Close the window when you are satisfied. VisaMCP does not need to be running, and you never start it yourself again. Once step 3 is done, the AI client launches it when it needs it and shuts it down afterwards.

  3. Tell Claude Desktop about it

    Open the configuration file:

    • Windows: %APPDATA%\Claude\claude_desktop_config.json
    • Linux: ~/.config/Claude/claude_desktop_config.json

    Add an entry under mcpServers, keeping any entries that are already there:

    {
      "mcpServers": {
        "visamcp": {
          "command": "C:\\Tools\\VisaMcp\\VisaMcp.exe",
          "args": []
        }
      }
    }

    On Linux the command is just the path to the binary, /home/you/bin/VisaMcp/VisaMcp. Note the doubled backslashes in the Windows path: that is JSON, not a typo.

  4. Restart the client

    Claude Desktop reads the file at startup, so it needs a full restart rather than a new conversation. The VisaMCP tools should then appear in the tools list. If they do not, the file is usually either in the wrong place or not valid JSON.

  5. Ask it something small first

    "List the VISA resources you can see" is a good opener, followed by asking it to identify one of them. If those two work, the plumbing is right and the rest is between you and the instrument.

When you replace VisaMCP with a newer build.Restarting the conversation is not enough, and neither is closing the window. The client keeps the old copy running in the background, so you have to shut the application down completely before it will pick up the new one. On Claude Desktop that often means ending every leftover Claude process in the task manager, including any background task still working, and if you are not sure you got them all, rebooting is the reliable way. If a feature you just added refuses to appear, this is almost always why.

Claude Code

One line instead of editing a file:

claude mcp add visamcp -- C:\Tools\VisaMcp\VisaMcp.exe

Other clients

Nothing here is specific to one assistant. VisaMCP speaks MCP over standard input and output, which is the usual transport, so any client that can launch a local MCP server should be able to use it. The details of where the configuration lives differ from client to client, but the two things it needs are always the same: the path to the binary, and permission to start it.

Instrument not responding?Check it the ordinary way first, with the PyVISA Code Generator or any VISA tool you already trust. VisaMCP adds a layer, and a layer is a poor place to debug a wiring problem.