Getting Started
This guide walks you through downloading, installing, and configuring the Keysight MCP Server for Instrument Control with your AI client.
Prerequisites
- Windows 10 or Windows 11 (64-bit), or Linux (tested on Ubuntu 24.04 LTS or later)
- On Windows, a VISA library is required for instrument communication over USB or GPIB: Keysight IO Libraries Suite 2026 or later, National Instruments VISA, or Rohde & Schwarz VISA. LAN instruments can connect directly by IP address or hostname without any VISA library installed.
- On Linux, GPIB, USB, and serial (RS-232) instruments aren't supported yet; connect LAN instruments directly by IP address or hostname instead.
- Any MCP-compatible AI client. All MCP-compatible clients should work. We have tested primarily with Claude Code, Claude Desktop, and GitHub Copilot.
Note that the MCP server does nothing on its own, it's a background process that exposes instrument-control tools to whichever AI client you register it with. All of your actual interaction happens in that AI client (Claude Code, Claude Desktop, GitHub Copilot, etc.), not in the MCP server itself. If you don't already have one of these installed and working with an LLM, set that up first, the steps below only cover adding the Keysight MCP server to a client you already have.
Step 1: Download and Install
Download the latest Keysight MCP Server for Instrument Control from the Keysight website:
- Open File Explorer and navigate to the download location.
- Run the MCP executable and follow the on-screen instructions to install it.
- After installation, the installed files are located under:
C:\Program Files\Keysight\MCP\Instrument Control\
The installer also generates ready-to-use MCP client configuration files for several supported clients, in:C:\Program Files\Keysight\MCP\Instrument Control\client-configs
See README.txt in that folder for where each client expects its file. Auto-generated configurations are currently provided for:
- Claude Code (CLI)
- Claude Desktop (including required static paths and keys pre-filled)
- VS Code (GitHub Copilot)
- Cursor
Use these generated files as a starting example even if you plan to customize your configuration, or if your client isn't listed, since the structure follows the same general pattern described below.
On Linux:
- Download the Linux installer (a self-extracting
.runfile) from the Keysight website. - Make it executable and run it:
chmod +x <downloaded-file>.run && ./<downloaded-file>.run - After installation, the installed files are located under:
/opt/keysight/MCP/Instrument Control/
The same auto-generated client configuration files described above are also created on Linux, under /opt/keysight/MCP/Instrument Control/client-configs.
The installer sets a database encryption key as a system-wide environment variable. On Linux, this takes effect on your next login, not immediately. If the MCP server reports a database error right after installing, log out and back in (or open a new terminal session) and try again.
Step 2: Configure Your AI Client
Register the MCP server with your AI client so it can find and launch it. We provide tested, step-by-step setup below for Claude Code, Claude Desktop, and GitHub Copilot. If you use a different MCP-compatible client, consult that client's documentation for how to add an MCP server, the configuration follows the same general pattern.
Adding an MCP server requires a local AI client (a CLI or desktop app) that exposes an "add MCP server" or equivalent setting. Hosted or web-based chat agents (for example, a web-based Copilot chat) typically cannot add local MCP servers, because they have no way to launch a local process. If you're unsure whether your client supports this, ask it directly: "Can you add MCP servers?" or "Do you support the Model Context Protocol?"
Common Config File Locations
| AI Client | Config File |
|---|---|
| Claude Code / VS Code Extension | <project>/.mcp.json
|
| Claude Desktop | %APPDATA%\Claude\claude_desktop_config.json
|
| GitHub Copilot | .vscode/mcp.json
|
Using a different MCP-compatible AI client? Consult that client's documentation for how to add an MCP server.
Project-Scoped vs. Global Configuration
Whether the server is available depends on where its client's config file lives relative to what you have open:
| Scope | File | Description |
|---|---|---|
|
Project-Scope |
|
|
| Global Scope | Claude Desktop's config (%APPDATA%\Claude\claude_desktop_config.json |
It applies to every chat regardless of folder, because Claude Desktop doesn't have a folder/workspace concept. |
This is expected client behavior, not a bug: if the server "disappears" after switching folders in Claude Code or VS Code, check whether the new folder has its own .mcp.json/mcp.json with the entry.
Configuration Settings
All MCP-compatible AI clients use a JSON configuration block in the same format. The command field must point to the exact filename you installed.
| Argument | Value | Description |
|---|---|---|
-transport
|
stdio, http, or sse |
Select one of the following communication transport methods:
TLS is supported when a certificate and key are provided during startup. |
-http-allowed-origins
|
(empty)
|
Applies to the http and sse transports. Sets the allowed value for the Origin header on incoming requests; the server rejects any request with a non-matching Origin header and returns HTTP 403. Omit this argument, or pass an empty string, to allow all origins. There is no "allow all" keyword; passing that or any other literal text is treated as the one allowed origin value, so real requests will be rejected (see Security). |
-visa-provider
|
ks
|
Selects the VISA provider. Use
If you omit this argument, the server uses |
-log-level
|
warn
|
Sets the log verbosity. Accepted values are debug, info, warn, and error. |
-scpi-poll-instrument-errors
|
true
|
Controls when the server checks the instrument's error queue during a command sequence. True is the default: the server checks after each command and stops the sequence as soon as one fails. False: the server checks only once, at the end of the sequence, and keeps running even if a command fails. Pass this flag with an equals sign, for example -scpi-poll-instrument-errors=false. Passing the flag and value as two separate arguments does not work. |
-file-transfer-local-base-dir
|
(empty)
|
When set, restricts file operations to this directory tree. Omitting local_path for capture_screenshot saves files into this directory instead of the OS temporary directory. For upload_file, download_file, and explicit local_path values in capture_screenshot, the server rejects any path that escapes this directory tree (see Security). |
Example: Claude Code (CLI and VS Code Extension)
Create the file .mcp.json at the root of your project workspace if it does not already exist, and add the following. If the file already exists, for example because you have registered other MCP servers, add the keysight-instrument-control entry to its existing mcpServers object instead of replacing the file:
| <your-project>/.mcp.json |
|---|
| { "mcpServers": { "keysight-instrument-control": { "type": "stdio", "command": "C:\\Program Files\\Keysight\\MCP\\Instrument Control\\mcp-instrument-control.exe", "args": ["-transport", "stdio", "-visa-provider", "ks", "-log-level", "warn"] } } } |
Restart Claude Code after saving. The MCP server appears automatically in the session.
Example: Claude Code on Linux
The same .mcp.json file, pointing at the Linux install path. On Linux, use socket for -visa-provider to connect directly to LAN instruments; GPIB, USB, and serial (RS-232) instruments aren't supported yet:
| <your-project>/.mcp.json |
|---|
| { "mcpServers": { "keysight-instrument-control": { "type": "stdio", "command": "/opt/keysight/MCP/Instrument Control/mcp-instrument-control", "args": ["-transport", "stdio", "-visa-provider", "socket", "-log-level", "warn"] } } } |
Example: GitHub Copilot
Assuming Copilot is integrated with VS Code, create a .vscode folder at the root of your project workspace, then create mcp.json inside it:
| <your-project>/.vscode/mcp.json |
|---|
| { "servers": { "keysight-instrument-control": { "type": "stdio", "command": "C:\\Program Files\\Keysight\\MCP\\Instrument Control\\mcp-instrument-control.exe", "args": ["-transport", "stdio", "-visa-provider", "ks", "-log-level", "warn"] } } } |
Restart VS Code after saving. The MCP server appears automatically for Copilot.
Step 3: Verify the Installation
After configuring your client, verify connectivity by asking the AI:
| Verification Prompt |
|---|
| Discover available instruments. |
The server should respond with a list of VISA resources on your system. If no instruments are found, check that:
- On Windows: your VISA library (Keysight IO Libraries Suite, NI-VISA, or R&S VISA) is installed and running.
- Your instrument is powered on and connected (USB, LAN, or GPIB on Windows; LAN only on Linux).
- On Windows: the VISA resource string is visible in that VISA library's connection manager (Keysight Connection Expert for Keysight IO Libraries Suite).
For a LAN instrument, you can also connect directly by asking the AI to connect to the instrument's IP address or hostname, without a VISA library installed. On Linux, this is currently the only supported connection method; GPIB, USB, and serial (RS-232) instruments aren't supported there yet.
Troubleshooting
| Symptom | Likely Cause | Fix |
|---|---|---|
| Server not listed in AI client | Config file not saved or wrong path | Re-check the JSON file path and restart the client. |
| Command not found error | Executable path incorrect | Verify the .exe exists at the configured path. |
| No instruments discovered | No VISA library installed, instrument offline, or not registered in the VISA library's connection manager (Windows); or, on Linux, a GPIB, USB, or serial (RS-232) instrument, which isn't supported there yet | On Windows: install a VISA library (Keysight IO Libraries Suite 2026 or later, NI-VISA, or R&S VISA) and check its connection manager (Keysight Connection Expert for Keysight IO Libraries Suite). On either platform, you can also connect directly using the instrument's IP address or hostname for LAN instruments. |
| Permission denied | Not running as administrator | Run the AI client as Administrator, or move the executable to a non-admin path. |