# Metal GPU Trace MCP server

> Measure GPU performance, frame pacing, and memory usage for Wine and macOS programs on Apple silicon using Metal System Trace.

- Repository: https://github.com/partprogramming09/metal-gpu-trace
- Page: https://hostedmcp.org/servers/partprogramming09/metal-gpu-trace
- Transport: stdio
- Stars: 1
- License: MIT
- Latest version: 0.24.0

## Install

### Claude Code

```sh
claude mcp add metal-gpu-trace -- uvx metal-gpu-trace
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "metal-gpu-trace": {
      "command": "uvx",
      "args": [
        "metal-gpu-trace"
      ]
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "metal-gpu-trace": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "metal-gpu-trace"
      ]
    }
  }
}
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "metal-gpu-trace": {
      "command": "uvx",
      "args": [
        "metal-gpu-trace"
      ]
    }
  }
}
```

### Codex (`~/.codex/config.toml`)

```toml
[mcp_servers.metal-gpu-trace]
command = "uvx"
args = ["metal-gpu-trace"]
```

### Gemini CLI (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "metal-gpu-trace": {
      "command": "uvx",
      "args": [
        "metal-gpu-trace"
      ]
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `METAL_TRACE_OUT` | no | no | Absolute path of the directory where recordings go |
| `METAL_TRACE_WINE` | no | no | Wine directory holding bin/wine, used when a recording names none |
| `PERF_OUT` | no | no |  |

## Tools (24)

- `perf_record`
- `perf_attach`
- `perf_runs`
- `perf_compare`
- `perf_baseline`
- `perf_baseline_record`
- `perf_cold_warm`
- `perf_ab`
- `perf_sweep`
- `perf_check`
- `perf_gate`
- `perf_history`
- `perf_panel`
- `perf_export_trace`
- `perf_diagnose`
- `trace_tables`
- `trace_count`
- `trace_query`
- `capture_summary`
- `capture_records`
- `gpu_family`
- `presentmon_install`
- `workload_list`
- `workload_fetch`

## FAQ

### What can this tool measure on Apple silicon?

It measures GPU time per frame, frame pacing, FPS, and memory using Instruments' Metal System Trace.

### Does the tool work on Windows?

Yes, it can record native programs on Windows using Intel's PresentMon to capture frame data, though it does not support Wine or Metal on Windows.

### What are the requirements to run the server?

You need Python 3.9+, zsh, and Xcode (specifically xctrace) installed on macOS.
