Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

Metal GPU Trace

Latest version: v0.30.0

Overview

Last scanned
24 Nov 2026
Published
24 Nov 2026
MCP server Transport: stdio Publisher: partprogramming09
1 Stars
0 Forks
38 Versions
Python Repo language

Scan summary

Metal GPU Trace was last scanned on 24 Nov 2026 at version 0.30.0. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 38 versions; the latest 2 were published within 2 days (23 and 24 Nov 2026).
  • Findings: No rules fired in version 0.30.0.
  • MCP server: Runs over stdio.

Versions

38 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.30.0 LATEST 24 Nov 2026 No rules fired
0.29.0 23 Nov 2026 Not shown
0.28.0 17 Nov 2026 No rules fired
0.27.3 16 Nov 2026 Not shown
0.27.2 16 Nov 2026 Not shown

No rules fired in 0.30.0

Findings

Findings for v0.30.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.30.0; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

metal-gpu-trace

test

In short

metal-gpu-trace measures how hard a program works the graphics chip (the GPU) of a Mac with Apple silicon or of a Windows PC (PresentMon), and whether its pictures come out evenly. It is for people who port or test games and apps on a Mac (Windows games under Wine included), and for the AI coding agents that help them.

Real example: a 20-second recording of the drawstress test program ran at 104.5 FPS, and the GPU needed 5.6 ms to draw each picture (see A first result).

Ask your agent to record again after a change, and it says with numbers whether the program got faster, slower or stayed the same. It needs Xcode to record on macOS (on Windows, PresentMon records instead), and it does not fix the program.

How it works

Your AI agent calls the metal-gpu-trace server. The server starts Instruments (Apple's profiler, installed with Xcode), which records the program for the seconds you asked. It writes a summary (a JSON file with the numbers) and two small tables, one row per frame and one for memory. The agent reads them back and compares them with other recordings or with a saved reference.

Details for people who change the code: How it works.

Start in 4 steps

  1. Install Xcode from the App Store. Open the Terminal app (press Cmd+Space, type "Terminal", press Enter; it is a window where you type commands) and type xcrun xctrace version: it should print a version.
  2. Install uv, a tool that downloads and runs the server for you. In the Terminal: brew install uv (Homebrew is the Mac's usual installer for command-line tools; if brew is not found, install it from brew.sh first).
  3. Connect the server to your agent. An MCP server is a small helper program that gives your AI agent new tools. Run uvx metal-gpu-trace init to set up every AI app it finds at once, or, for Claude Code, paste this in the Terminal (METAL_TRACE_OUT is the folder where recordings are saved): claude mcp add --scope user metal-trace -e METAL_TRACE_OUT=$HOME/perf-runs -- uvx metal-gpu-trace. For other AI apps see MCP server.
  4. Ask: "Record my app for 30 seconds, then tell me its FPS and how long the GPU takes per frame." For a Windows program under Wine (software that runs Windows programs on a Mac), also add -e METAL_TRACE_WINE=/path/to/wine to the command of step 3 (see Install).

Already installed? Using it walks through five typical jobs. Not sure what to read? Where to start says what to read if you are a user, an AI agent or a contributor.

Words used here

  • frame: one picture the program draws. A game at 60 FPS draws 60 of them each second.
  • FPS: frames per second. Higher is smoother, until the screen's refresh rate caps it (the screen cannot show more pictures per second than it refreshes; this limit is called vsync).
  • GPU ms per frame: the milliseconds the graphics chip works on one frame. Lower is better, and unlike FPS the screen does not cap it.
  • 1 % low: the FPS of the slowest 1 % of frames. It shows the stutter an average hides, and needs at least 100 frames.
  • hitch: a frame that takes far longer than its neighbours; you see it as a stutter.
  • frame pacing: how evenly frames arrive. Even gaps look smooth, uneven gaps look like stutter.
  • encoder: a block of GPU commands the program sends. Too many tiny ones waste GPU time.
  • command buffer: the package of work a program hands the GPU; it holds one or more encoders.
  • translation layer: software that lets a program written for another graphics API (Direct3D, Vulkan) run on Metal, such as DXMT, Mullion or MoltenVK.
  • Wine: software that runs Windows programs on a Mac.
  • Metal System Trace: the Instruments recording template that logs what the GPU does; this tool records with it.
  • .trace: the file Instruments writes. It is large (tens to hundreds of MB), so it is deleted after the summary unless you set KEEP_TRACE=1. The tables the summary read stay in <run>.tables.sqlite, which trace_query can filter without the .trace (PERF_TABLES=0 skips it).
  • .gputrace: a Metal capture of the draw commands of a few frames; this tool reads it without Xcode.
  • baseline: a saved reference made of several equal recordings. It shows how much a number moves by itself, so a later run can be judged against it.
  • regression: a change that makes the program worse than its baseline, for example FPS falling under the baseline's range by more than the margin.

A first result

A trimmed summary of a real 20-second recording of the drawstress test program in native Metal (the file holds many more fields):

{
  "process": {"name": "drawstress", "arguments": "--mtl"},
  "duration_s": 20.78,
  "gpu": {
    "frames": 2034,
    "fps_estimate": 104.5,
    "frame_gpu_ms": {"mean": 5.564, "p95": 6.16},
    "frame_interval_ms": {"p95": 10.017, "max": 22.189}
  },
  "encoders": {"per_frame": {"p50": 2}},
  "gpu_idle": {"idle_share": 0.422}
}

Read it like this: 2 034 frames in 20.8 s. fps_estimate is 104.5: it comes from the median gap between frames, so it can differ from frames divided by seconds (about 98). The GPU needed 5.6 ms per frame on average, and under 6.2 ms for 95 % of them (p95). The longest wait between two frames was 22.2 ms. The program sent 2 encoders per frame (the median, p50), and the GPU sat idle 42 % of the time. One recording says little by itself: compare two, and repeat a run before calling a difference real.

What's new

Version 0.30.0. Older versions: changelog.

  • ✨ A command line that answers. metal-gpu-trace --help lists the commands, and a wrong command says so and exits 2, instead of waiting for an AI app. Proof
  • 🩺 doctor. metal-gpu-trace doctor says what a recording needs on this machine, one line per check with the exact fix. Proof
  • 🔍 runs. metal-gpu-trace runs lists your recordings newest first, with fps, GPU time and memory. Proof
  • 🔍 compare. metal-gpu-trace compare A B compares two recordings in a table, or as Markdown for a PR comment. Proof

For developers

Measures how a Wine or macOS program uses the GPU on an Apple silicon Mac, and how a native Windows program does with PresentMon, from the command line or through an AI coding agent: GPU time per frame, frame pacing, FPS and memory; whether a translation layer splits the work into too many short encoders; .gputrace captures read without Xcode; and Apple's published facts per GPU family. Python 3.9+ standard library; on macOS zsh and Xcode (for xctrace); on Windows PresentMon. MIT license (LICENSE).

Architecture, decisions and guides: docs/README.md. Sending a change: CONTRIBUTING.md.

File What it does
src/metal_gpu_trace/perf_record.sh Records a program for N seconds and writes <label>_<date>.json plus per-frame and memory CSVs. Deletes the .trace unless KEEP_TRACE=1.
src/metal_gpu_trace/perf_report.py Summarizes an existing .trace the same way.
src/metal_gpu_trace/gputrace_read.py Reads a Metal .gputrace without Xcode. Call names marked probable are not confirmed.
src/metal_gpu_trace/data/apple-gpu-families.json Apple7 to Apple10: chips, what each family adds, limits that differ, with Apple's sources.
src/metal_gpu_trace/metal_trace_mcp.py The MCP server over all of the above.
tests/ Self-check without Instruments: python3 -I tests/run.py prints ok; pytest tests runs the same tests.

Recording

PERF_OUT=~/perf-runs zsh src/metal_gpu_trace/perf_record.sh game-d3d12 30 /path/to/wine ~/.wine /path/to/game game.exe
PERF_OUT=~/perf-runs zsh src/metal_gpu_trace/perf_record.sh app-metal 30 native - /path/to/app ./app

Arguments: label, seconds, a Wine directory holding bin/wine (or native), the Wine prefix (the folder holding that Wine's fake Windows drive, ~/.wine by default), the working directory, the program and its arguments. Without PERF_OUT, runs go to ./perf-runs. Reading the trace takes about a minute on an M1 Pro (87 s for a 10 s recording). Through the MCP server the call times out after 15 s per recorded second plus 180 (55 with GPU counters), and an overrun recording leaves no files behind. One recording runs at a time; keep other GPU work off the Mac while it records. Under Wine, record for 30 s: Wine's start-up takes part of the recording. Under 100 frames is too short to compare.

Disk use

Each recording keeps a JSON summary and three CSVs, about 2 MB for 10 s (most of it the Metal memory samples). The .trace is deleted unless KEEP_TRACE=1. PERF_MEMORY=0 skips the Metal memory table, the slowest to read (41 % faster to summarize a 626 MB trace); the summary then has no metal_memory_mib. The MCP tools perf_record and perf_baseline_record offer the same as memory=false. What each setting deletes: Retention.

MCP server

Install

The server runs with uvx from PyPI, with nothing to clone (brew install uv installs it). Recording also needs Xcode: xcrun --find xctrace must find xctrace, which the Command Line Tools alone do not include (install Xcode from the App Store and point xcode-select at it).

uvx metal-gpu-trace

This is the command each client below runs. Desktop apps do not see Homebrew's PATH: give them the full path that which uvx prints (/opt/homebrew/bin/uvx on Apple silicon). Unpinned, uvx keeps the version it first downloaded, and a --refresh (or a cache clean) moves you to the latest without warning.

Pin the version you have tested: uvx metal-gpu-trace@X.Y.Z (for example uvx metal-gpu-trace@0.29.0), in the command each client runs and in a CI job. The project is still 0.x and ships often: an incompatible change is listed under ### Removed (incompatible) in the changelog, and a recording's summary keeps its old keys, so older .json files stay readable. What counts as the public surface, and when 1.0 comes, is a proposal: ADR-0010.

Environment variables and project files: Configuration.

One command: init

uvx metal-gpu-trace init finds the AI apps installed on this Mac or PC (Claude Code, Claude Desktop, Cursor, Codex CLI) and adds the server to each, with the absolute path of uvx and METAL_TRACE_OUT set to ~/perf-runs, resolved.

uvx metal-gpu-trace init --dry-run                       # show what it would write, write nothing
uvx metal-gpu-trace init --client cursor --wine /path/to/wine

Options: --client claude-code|claude-desktop|cursor|codex|vscode, --wine DIR (a Wine directory holding bin/wine; METAL_TRACE_WINE is used when set), --out DIR, --dry-run, --project. An existing JSON config is merged (your other servers stay) and copied to <file>.bak first; a file that is not valid JSON is refused untouched. For Codex the block is appended to config.toml when missing, and only shown when [mcp_servers.metal-trace] is already there. Claude Code is registered with claude mcp add, not by editing its file. VS Code needs --project (it writes .vscode/mcp.json); --project files hold absolute paths of your machine, so keep them out of git. init is supported on macOS and Windows; on other systems it says "not supported yet". Restart the app afterwards.

Claude Code
claude mcp add --scope user metal-trace -e METAL_TRACE_OUT=$HOME/perf-runs -e METAL_TRACE_WINE=/path/to/wine \
  -- uvx metal-gpu-trace
claude mcp list

claude mcp list shows metal-trace as connected. --scope user makes it available in every project; leave it out to add it to the current project only.

Windows

On Windows the server records native programs (src/metal_gpu_trace/perf_record_windows.py): no Wine, no Metal, and METAL_TRACE_WINE is not needed. Frames come from Intel's PresentMon (MIT), installed with presentmon_install, found on PATH, or pointed to with PRESENTMON_EXE. Without it the summary falls back to DWM composition intervals (gpu.source is dwm-composition), which cover the whole desktop and carry no GPU time. With neither source a recording fails; it never invents frames. Details: Windows engine.

winget install --id=astral-sh.uv -e
uvx metal-gpu-trace init
claude mcp list

init writes the server into Claude Desktop (%APPDATA%\Claude\claude_desktop_config.json), Cursor (%USERPROFILE%\.cursor\mcp.json) and Codex (%USERPROFILE%\.codex\config.toml), and finds uvx.exe on PATH or in %USERPROFILE%\.local\bin; without uv it names the winget command. In JSON clients use "command": "uvx" (or the full path where uvx prints) and Windows paths with doubled backslashes. Run the Windows tests with python -m pytest tests/test_perf_record_windows.py.

Claude Desktop, Cursor and other JSON clients

These apps do not expand ~ or $HOME: write absolute paths.

{
  "mcpServers": {
    "metal-trace": {
      "command": "/opt/homebrew/bin/uvx",
      "args": ["metal-gpu-trace"],
      "env": {
        "METAL_TRACE_OUT": "/absolute/path/to/perf-runs",
        "METAL_TRACE_WINE": "/absolute/path/to/wine"
      }
    }
  }
}
Client File
Claude Desktop ~/Library/Application Support/Claude/claude_desktop_config.json (Settings, Developer, Edit Config); restart the app
Cursor ~/.cursor/mcp.json
VS Code .vscode/mcp.json in the project; the top key is servers, and the server adds "type": "stdio"
Codex CLI ~/.codex/config.toml: a [mcp_servers.metal-trace] table with the same command, args and env
Tools

26 tools in four groups. Your agent picks them; you rarely call one yourself. Every tool also takes an optional fields, a list of dotted paths such as common.frame_pacing.fps_1pct_low: the result keeps only those (on a page, in each row), so the agent reads a few numbers instead of a whole summary. A path that matches nothing is listed in _meta.fields_missing. Each tool's arguments are in Server and transport.

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • MCP Registry io.github.partprogramming09/metal-gpu-trace

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

PolinRider Returns
Research

PolinRider Returns: Hijacked npm Packages Use Ethereum Blockchain to Conceal Malware Infrastructure

Copy of Template Design OX Blog (1)
Research

Thousands Of GitHub Accounts Hijacked With wfx-loot CI Secret Stealing Malware Via GitHub Actions & npm

Vulnerability Insights

Compromised Claude Code extensions (versions 2.1.312 & 2.1.313) in Cursor try to install a backdoor

Frame 2085668439 (1)
Group 1261154229