Skip to main content
Glama
zhixuan2333

PPK2 MCP Server

by zhixuan2333

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
PPK2_PORTNoOverride the serial port for the PPK2 if autodetection fails.

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
ppk2_statusA

Report PPK2 connection and configuration state.

Returns whether a device is connected, the resolved/candidate serial port, the active meter mode, the configured source/reference voltage, the last commanded DUT power state, and any serial ports that look like a PPK2. Safe to call any time; never opens the port.

ppk2_configureA

Open the PPK2 and configure it for measurement.

Opens the serial port (if not already open), reads the device calibration, selects the meter mode, and sets the voltage. Call this before ppk2_measure.

Args: mode: "ampere" — the PPK2 measures current drawn from an external supply (it does not power the DUT). voltage_mv is still required and is used for the gain/offset calibration, so set it to your external rail voltage. "source" — the PPK2 sources voltage_mv to the DUT and measures the current it draws. Use ppk2_power("ON") to enable the output. voltage_mv: Source/reference voltage in millivolts (800–5000). port: Serial port override; defaults to PPK2_PORT or autodetection.

Returns the resulting status.

ppk2_powerA

Turn the DUT power output ON or OFF.

In source mode this enables/disables the voltage the PPK2 sources to the DUT. In ampere mode it connects/disconnects the PPK2's internal switch in the current path. Requires ppk2_configure to have been called first.

Args: state: "ON" or "OFF".

ppk2_measureA

Sample current for a fixed duration and return summary statistics.

Starts continuous sampling, discards an initial settling window, collects samples for duration_seconds, stops, and computes statistics. Requires a prior ppk2_configure. The PPK2 streams ~100k samples/s, so raw samples are never returned by default — only aggregates (and an optional downsampled series).

Args: duration_seconds: How long to collect samples (after settling). 0.05–60. settle_ms: Initial data discarded before timing starts, to skip the switch-on transient. Default 200 ms. include_series: If true, also return a downsampled current series. series_points: Target number of points in the downsampled series.

Returns current statistics in microamps (µA), plus average power (µW), charge (µC) and energy (µJ) when a voltage is configured. samples is the raw sample count; sample_rate_hz is the achieved rate.

ppk2_logicA

Capture the PPK2's 8 digital logic channels (D0–D7) — a logic analyser.

The PPK2 samples 8 digital inputs alongside current at ~100k samples/s. This starts sampling, discards a settling window, collects digital states for duration_seconds, and returns per-channel statistics: the fraction of time each channel was high, the number of edges (level transitions), and the first/last observed level. Requires a prior ppk2_configure.

Note: unconnected digital pins float and may read a constant or noisy level; drive them from your DUT to see real activity.

Args: duration_seconds: Capture window after settling. 0.05–60. settle_ms: Initial samples discarded before timing starts. Default 100 ms. channels: Which channels (0–7) to report. Default all eight. include_series: If true, also return a downsampled level series per channel (each point is the fraction high over that block, 0.0–1.0). series_points: Target number of points in each downsampled series.

Returns sample count, achieved sample rate, and a channels map keyed by channel index.

ppk2_disconnectA

Release the serial port (stops sampling and drops DUT power first).

Use this to hand the port to another process, or to recover from a wedged connection — the next tool call will reopen it.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/zhixuan2333/PPK2-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server