# Keithley SourceMeter SMU

Lets an agent drive a SourceMeter SMU: set a source level with a compliance cap, take V and I readings, run stepped IV sweeps. Useful when the instrument sits on a bench.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 23
- Author: K-Dense-AI
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/K-Dense-AI/lab-instrument-mcps/tree/HEAD/servers/physics/keithley-smu
- Updated: 2026-09-26
- HTML: https://affpapa.org/en/nevibecode/mcp/keithley-sourcemeter-smu

## What it does

Three Keithley remote dialects are covered: 2400-series SCPI, 2450-family SCPI and 2600B TSP. The server picks one from `*IDN?`, and you can pin it with `--option dialect=2400|2450|2600`. Links go over GPIB, USB (USBTMC), Ethernet (VXI-11 or raw socket 5025) and RS-232 on the 2400 series, through VISA or `tcp://`.

The tool set covers a full run. `configure_source` sets up the source while the output stays off, `output_on` energises the DUT, `measure` returns a single reading, and `run_iv_sweep` steps through levels and hands back the curve with compliance flags and a linear fit. A sweep always ends with the output switched off, errors included. `output_off` keeps working under `--read-only`, where configuration, output-on and sweeps are blocked.

You need `uvx` and a VISA library with GPIB support. NI-VISA covers every interface; pyvisa-py handles USBTMC and LAN, and GPIB needs `gpib-ctypes` or linux-gpib alongside it. On a 2450 above ±21 V the safety interlock has to be closed, and the instrument must be in the SCPI command set — in TSP mode the server stops and prints instructions. Test the link before wiring it into an agent: `uvx labmcp-keithley-smu --address GPIB0::24::INSTR --check`.

## Requirements
- Needs: Python and uv (commands run via uvx)
- Environment variables: `LABMCP_ADDRESS`, `LABMCP_SIMULATE`, `LABMCP_READ_ONLY`, `LABMCP_LIMITS` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env LABMCP_ADDRESS=<LABMCP_ADDRESS> --env LABMCP_SIMULATE=<LABMCP_SIMULATE> --env LABMCP_READ_ONLY=<LABMCP_READ_ONLY> --env LABMCP_LIMITS=<LABMCP_LIMITS> --transport stdio keithley-smu -- uvx labmcp-keithley-smu
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from labmcp-keithley-smu <command>

### Codex

**Platform CLI**
```bash
codex mcp add keithley-smu --env LABMCP_ADDRESS=<LABMCP_ADDRESS> --env LABMCP_SIMULATE=<LABMCP_SIMULATE> --env LABMCP_READ_ONLY=<LABMCP_READ_ONLY> --env LABMCP_LIMITS=<LABMCP_LIMITS> -- uvx labmcp-keithley-smu
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from labmcp-keithley-smu <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "keithley-smu": {
            "command": "uvx",
            "args": [
                "labmcp-keithley-smu"
            ],
            "env": {
                "LABMCP_ADDRESS": "<LABMCP_ADDRESS>",
                "LABMCP_SIMULATE": "<LABMCP_SIMULATE>",
                "LABMCP_READ_ONLY": "<LABMCP_READ_ONLY>",
                "LABMCP_LIMITS": "<LABMCP_LIMITS>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from labmcp-keithley-smu <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "keithley-smu": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "labmcp-keithley-smu"
            ],
            "env": {
                "LABMCP_ADDRESS": "<LABMCP_ADDRESS>",
                "LABMCP_SIMULATE": "<LABMCP_SIMULATE>",
                "LABMCP_READ_ONLY": "<LABMCP_READ_ONLY>",
                "LABMCP_LIMITS": "<LABMCP_LIMITS>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from labmcp-keithley-smu <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e LABMCP_ADDRESS=<LABMCP_ADDRESS> -e LABMCP_SIMULATE=<LABMCP_SIMULATE> -e LABMCP_READ_ONLY=<LABMCP_READ_ONLY> -e LABMCP_LIMITS=<LABMCP_LIMITS> keithley-smu uvx labmcp-keithley-smu
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from labmcp-keithley-smu <command>

## When to use it
- source a voltage onto a DUT with a current cap
- sweep a diode or resistor and get the IV curve
- read V and I in one agent call
- switch a low-resistance DUT to 4-wire sensing
- trace which raw commands reached the instrument

## Example prompts
- Connect to the SMU and tell me which instrument is on the line
- Configure the source for 5 V with a 20 mA compliance and turn the output on
- Run a linear sweep from 0 to 2 V and plot the curve

## Similar
- [OpenReadout](https://affpapa.org/en/nevibecode/mcp/openreadout.md) — MCP server · ★ 8
- [mouser](https://affpapa.org/en/nevibecode/skills/mouser.md) — skill · 490 installs
- [manus](https://affpapa.org/en/nevibecode/skills/manus.md) — skill · 390 installs
- [reddit-research](https://affpapa.org/en/nevibecode/skills/reddit-research.md) — skill · 10600 installs
- [semanticscholar-skill](https://affpapa.org/en/nevibecode/skills/semanticscholar-skill.md) — skill · 3400 installs
- [paper-fetch](https://affpapa.org/en/nevibecode/skills/paper-fetch.md) — skill · 3400 installs

From the same set: [k-dense-ai/lab-instrument-mcps](https://affpapa.org/en/nevibecode/by/k-dense-ai/lab-instrument-mcps.md) — 15 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
