PPK2 MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@PPK2 MCP Server Set PPK2 to source mode at 3.3V, power on, and measure current for 5 seconds."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
PPK2 MCP server
A Model Context Protocol (stdio) server that lets an MCP client — Claude Code, Claude Desktop, Cursor — drive a Nordic Power Profiler Kit II (PPK2) over its USB serial port: set mode/voltage, power a device-under-test (DUT), measure current/power/energy, and capture the 8 digital channels as a logic analyser.
The server holds the serial port open for its whole lifetime and serialises every tool call behind one lock, so it is the single owner of the PPK2 — the client talks to the device only through these tools.
Requirements
A PPK2 connected over USB
uv (the installer below will fetch it if missing)
Python ≥ 3.10 (uv will fetch one if needed)
Claude Code CLI (optional, for auto-registration)
Related MCP server: blea
One-shot install
git clone https://github.com/zhixuan2333/PPK2-MCP && cd PPK2-MCP
./install.sh # installs uv, syncs deps, registers the MCP server
./install.sh --run # ...and immediately launches Claude with a test promptinstall.sh registers the ppk2 server with the Claude Code CLI (claude mcp add, user scope). The serial port is autodetected — no path to configure.
Then in Claude:
Use the ppk2 MCP tools to check the PPK2: call
ppk2_status, then configure source mode at 3.3V, power the DUT on, measure current for 2 seconds, capture the logic channels for 1 second, and finally power off and disconnect.
Manual setup
uv sync # create .venv and install dependencies from uv.lockRun the server standalone (speaks MCP over stdio, so this is mostly a smoke
test — Ctrl-C to exit). The PPK2 port is autodetected; override with PPK2_PORT
if needed:
uv run ppk2_mcp_server.py
# or pin a port: PPK2_PORT=/dev/cu.usbmodemXXXX uv run ppk2_mcp_server.py.mcp.json in this repo also registers the server for any Claude Code session
opened in this directory (autodetected port, no edits needed). Approve the
project server (or run /mcp) and confirm it shows connected.
Tools
Tool | What it does |
| Connection state, mode, voltage, DUT power, available ports. Never opens the port. |
| Open the port, read calibration, set meter mode ( |
| Turn DUT power output |
| Sample current for N seconds → summary stats (current/power/charge/energy). |
| Capture the 8 digital channels (D0–D7) → per-channel duty, edges, activity. |
| Release the serial port. |
Modes
ampere — the PPK2 measures current drawn from an external supply (it does not power the DUT).
voltage_mvis still used for the gain/offset calibration, so set it to your external rail voltage.source — the PPK2 sources
voltage_mvto the DUT and measures the current it draws. Useppk2_power("ON")to enable the output rail.
Serial port resolution
First match wins: a tool's explicit port arg → PPK2_PORT env var →
autodetection via ppk2_api.list_devices().
Notes
A serial line has a single owner — only one process can hold the PPK2 at a time. Stop other PPK2 tools (e.g. nRF Connect Power Profiler) before using this.
Unconnected digital pins float and read a constant/noisy level; drive them from your DUT to see real logic activity.
Available Tools
6 toolsppk2_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.
Inputs: mode, voltage_mv, port. Returns: object
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.
Inputs: no named parameters. Returns: object
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.
Inputs: duration_seconds, settle_ms, channels, include_series, +1 more. Returns: object
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.
Inputs: duration_seconds, settle_ms, include_series, series_points. Returns: object
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".
Inputs: state (required). Returns: object
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.
Inputs: no named parameters. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool addresses a distinct aspect of PPK2 operation: configuration, disconnection, logic capture, current measurement, power control, and status reporting. There is no overlap in functionality.
All tools follow a consistent `ppk2_<verb_or_noun>` pattern. The names clearly indicate their action (configure, disconnect, measure, power, status) or feature (logic), making them predictable.
Six tools is a well-scoped set for a PPK2 hardware interface. Each tool maps to a required operation for using the device, without unnecessary bloat or missing essentials.
The tool set covers the full workflow: configure, power control, measurement, logic analysis, and cleanup. A very minor gap is the absence of a separate tool to read calibration data, but configure handles it implicitly.
Maintenance
Related MCP Connectors
MCP server for Statsig API - interact with Statsig's feature flags, experiments, and analytics
QuLab MCP remote server (Streamable HTTP) for computational science and lab tools.
Create and manage trading strategies, bots, webhooks and signals from any MCP client.
MCP compatibility and transport verification server.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceMCP server for Nordic Semiconductor's Power Profiler Kit II (PPK2), enabling current measurement and device control via 12 tools from Claude.1MIT
- AlicenseNot gradedqualityBmaintenanceProvides a local MCP server for Bluetooth Low Energy automation, enabling scanning, GATT inspection, characteristic reads and writes, and evidence capture, diff, and replay with safety guards.29 PyPI13MIT
- FlicenseNot gradedqualityCmaintenanceEnables MCP clients to list, inspect, probe, capture, and analyze current measurements from the Nordic Power Profiler Kit II, returning aggregates and file paths rather than raw samples.-
- FlicenseAqualityCmaintenanceEnables LLMs to control a Nordic Power Profiler Kit II over USB serial for current capture (500 nA–2000 mA at 100 kSa/s plus 8 logic channels) and DUT power sourcing (0.8–5 V), with samples written to npz files. Also supports offline analysis such as statistics, activity/duty-cycle segmentation, and battery-life estimation.19-