Skip to main content
Glama

unity-profiler-mcp

MCP server for analyzing saved Unity Profiler captures. An AI client (Claude Code, etc.) can list captures, summarize frame times, find the most expensive main-thread markers, and compare groups of captures marker by marker (e.g. 3 runs of branch A vs 3 runs of branch B) — instead of reading Profiler screenshots by hand.

Two parts:

Part

Path

Role

MCP server (Node, stdio)

server/

Tools below; reads .highlights and exported marker JSON, computes summaries and comparisons

Unity bridge (UPM, Editor-only)

unity-package/

Local HTTP listener on 127.0.0.1 that loads a .data capture with ProfilerDriver and exports per-marker statistics

.data captures can only be read by the Unity Editor, so marker statistics need the editor open. profiler_summary works without the editor (it reads the .highlights file the Profiler saves next to each capture).

Tools

Tool

Input

Result

profiler_list_captures

folder?

captures with size, time, hasHighlights, hasMarkers

profiler_summary

capture, folder?

estimated CPU/GPU frame time (p50/p95/p99/max, % over 16.7 / 33.3 ms) and main-thread frame time if exported

profiler_export

capture, folder?, force?

editor exports <capture>.data.markers.json

profiler_top_markers

capture, limit?, sortBy? (avg,p95,spikeAvg,selfAvg,gcBytesAvg), maxDepth?, contains?

most expensive markers; exports first if needed

profiler_compare

a[], b[], limit?, sortBy? (avg,p95,spikeAvg), maxDepth?, contains?

per-marker group means, delta, run-to-run spread, beyondSpread flag

capture is a file name inside the capture folder (with or without .data) or an absolute path. The capture folder defaults to UNITY_PROFILER_CAPTURES, then <project>/ProfilerCaptures of the open editor.

Marker export

  • Main thread only, samples merged by name, hierarchy depth ≤ 8, markers averaging under 0.005 ms dropped.

  • Per marker: frames present, total ms avg / p50 / p95 / max, spikeAvg (average over the slowest 5% of frames), selfAvg, callsAvg, gcBytesAvg.

  • Exporting loads the capture into the Profiler window (replacing what is shown) and blocks the editor while it runs; large captures take a while. Results are cached next to the capture.

.highlights

The frame-time series are decoded from the .highlights file the Profiler writes on save. The layout is undocumented; series 0/1 are assumed to be CPU/GPU frame time and are labelled cpuMsEstimated / gpuMsEstimated. Check them against the Profiler's Highlights module before relying on them.

Related MCP server: RenderDoc MCP

Install

1. Unity package

Add to Packages/manifest.json:

"com.shin0112.unity-profiler-mcp": "https://github.com/shin0112/unity-profiler-mcp.git?path=/unity-package"

or, for a local clone:

"com.shin0112.unity-profiler-mcp": "file:C:/projects/unity-profiler-mcp/unity-package"

Menu: Tools > Unity Profiler MCP > Status / Enable Bridge / Disable Bridge.

2. MCP server (Claude Code)

From GitHub:

claude mcp add unity-profiler -- npx -y github:shin0112/unity-profiler-mcp

From a local clone:

cd C:/projects/unity-profiler-mcp && npm install
claude mcp add unity-profiler -- node C:/projects/unity-profiler-mcp/server/index.js

Configuration

Setting

Where

Default

Port

EditorPrefs Shin0112.UnityProfilerMcp.Port (editor) and env UNITY_PROFILER_PORT (server) — keep them equal

17891

Capture folder

env UNITY_PROFILER_CAPTURES or tool folder

<project>/ProfilerCaptures

Export timeout

env UNITY_PROFILER_EXPORT_TIMEOUT_MS (server); the bridge waits up to 15 min

900000

Recording captures that compare well

  • Development Build, Deep Profile and allocation call stacks off.

  • Same scene, spawner, unit count and camera position for every run; record after the scene settles (e.g. 300+ frames).

  • Several runs per variant, so profiler_compare can separate real differences from run-to-run noise.

  • Emulators and the Editor are fine for relative comparison only; confirm absolute numbers on a target device.

License

MIT

Available Tools

5 tools
profiler_compareA

Compare two groups of captures (e.g. 3 runs of branch A vs 3 of branch B) per marker. Reports group means, the run-to-run spread inside each group, and flags differences larger than that spread.

Inputs: a (required), b (required), limit, folder, +3 more.

profiler_exportA

Have the open Unity Editor load a capture and export per-marker main-thread statistics to .data.markers.json. Large captures can take minutes and block the editor.

Inputs: capture (required), force, folder.

profiler_list_capturesA

List saved Unity Profiler captures (.data) with size, time, and whether highlights/marker exports exist.

Inputs: folder.

profiler_summaryA

Frame-time summary of one capture: estimated CPU/GPU frame time from .highlights (no editor needed) and main-thread frame time from the marker export if present.

Inputs: capture (required), folder.

profiler_top_markersA

Most expensive main-thread markers of one capture (exports first if needed). sortBy spikeAvg shows what grows in the slowest 5% of frames.

Inputs: capture (required), limit, folder, sortBy, +2 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool targets a distinct profiler workflow step: listing captures, summarizing one capture, exporting marker data, extracting top markers, and comparing capture groups. The export tool is a prerequisite for some analysis but its purpose is still clear and non-overlapping.

    Naming Consistency4/5

    All tools share a consistent `profiler_` prefix, but the second segment mixes verbs (`list`, `export`, `compare`) with nouns/noun phrases (`summary`, `top_markers`). The pattern is still highly readable and predictable enough for an agent to infer usage.

    Tool Count5/5

    Five tools is well-scoped for a Unity Profiler capture analysis server. Each tool covers a meaningful step in the workflow without redundancy or missing obvious operations.

    Completeness4/5

    The surface covers listing, summarizing, exporting, per-marker analysis, and group comparison for saved captures. Minor gaps exist, such as deeper per-frame or full marker hierarchy inspection, but core profiler workflows are supported.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to analyze RenderDoc GPU frame captures for graphics debugging and performance analysis through a headless Python API. It provides a comprehensive suite of tools for inspecting pipeline states, shader bindings, and exporting frame resources like textures and meshes.
      184
      -
    • A
      license
      B
      quality
      D
      maintenance
      Enables AI clients to analyze RenderDoc captures by browsing draw/dispatch events, inspecting pipeline state and shaders, and paginating vertex/constant buffer data.
      13
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables supported AI clients to connect to and automate the Unity Editor, covering scene and GameObject manipulation, asset and material operations, script creation and validation, testing, builds, screenshots, and editor-state inspection. It supports HTTP and stdio transports and ships client configuration helpers for Unity 2021.3+ on Windows, Linux, and macOS.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Gives MCP clients tools to inspect RenderDoc .rdc captures — listing and opening frames, querying draws, pipelines, shaders, bindings, textures, buffers and pixel history, reading GPU performance counters, and exporting buffer, texture, mesh, draw-call and Unity import packages. Multiple clients can share one local GUI or headless playback backend on Windows.
      2
      MIT