xcodeinstrumentmcp
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., "@xcodeinstrumentmcprecord a time profile for the MyApp target"
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.
xcodeinstrumentmcp
xcodeinstrumentmcp is a local-first CLI and MCP server for turning Xcode Instruments artifacts into bounded, agent-sized evidence.
It ships one package with:
CLI workflows for
doctor,list,record,import,summarize,compare,prompt,db,signpost, andmcplocal SQLite caching with stable snapshot, comparison, and prompt-pack IDs
fixture-backed analyzers for Time Profiler, Allocations, Hangs, Network, Leaks, Energy Log, Memory Graph, and experimental Processor Trace
Swift-only signpost scan/plan/apply/revert/status flows backed by the
xim-swiftsignpostSwiftSyntax helpera bounded MCP surface over the same high-value workflows
Install
Repo-local install:
pnpm install
pnpm exec tsup
node dist/index.js doctorRequirements:
macOS 14+
Node.js 22+
Xcode /
xctraceSwift toolchain for signpost helper build/use
Related MCP server: XCAutokit
CLI Quick Start
Check the local environment:
xcodeinstrumentmcp doctorImport and persist a Time Profiler trace:
xcodeinstrumentmcp import --instrument time-profiler --input ./run.traceSummarize a supported family fixture or artifact:
xcodeinstrumentmcp summarize --instrument allocations --input ./allocations.xml --format markdown
xcodeinstrumentmcp summarize --instrument network --input ./session.har --format jsonCompare two stored snapshots:
xcodeinstrumentmcp compare --baseline-snapshot snap_base --candidate-snapshot snap_new --format jsonGenerate a reusable prompt pack:
xcodeinstrumentmcp prompt --snapshot snap_abc --size medium --format jsonScan and apply Swift signpost instrumentation:
xcodeinstrumentmcp signpost scan --project-root .
xcodeinstrumentmcp signpost plan --project-root . --strategy explicit-symbols --symbol GatewayViewModel.refresh
xcodeinstrumentmcp signpost apply --plan plan_abcInspect the local cache:
xcodeinstrumentmcp db stats
xcodeinstrumentmcp db list-snapshotsSupport Matrix
time-profiler: stable first-class analyzer with record, summarize, compare, and prompt supportallocations: stable first-class analyzer from trace export or exported detail XMLhangs: stable first-class analyzer from hang tables or fixture XMLnetwork: stable first-class analyzer from HAR import with redaction by defaultleaks: stable summary analyzer with conservative confidence languageenergy-log: stable summary analyzer from exported summary XMLmemory-graph: stable summary analyzer from imported.memgraphfixturesprocessor-trace: experimental gated analyzer with explicit caveats in CLI and MCP responses
MCP Setup
Cursor / generic stdio client:
{
"command": "xcodeinstrumentmcp",
"args": ["mcp"]
}Repo-local stdio launch:
{
"command": "node",
"args": ["/absolute/path/to/dist/index.js", "mcp"]
}Current MCP surface includes bounded workflow tools such as:
record_time_profilerecord_profileimport_sourcesummarize_tracesummarize_snapshotcompare_tracescompare_snapshotsgenerate_optimization_promptgenerate_prompt_packlist_snapshotsget_snapshotget_comparisonget_findingsplan_signpostsapply_signpost_planrevert_signpost_patch
Limitations
Processor Trace is experimental and returns
experimental: truein MCP responses.Network analysis is HAR-first in this release; trace-side network capture is still target/platform dependent.
Memory Graph support is import-oriented rather than a unified
xctrace recordpath.Outputs are intentionally bounded; raw exports are not returned by default.
Privacy
The tool is local-only. Persistence is local SQLite under ~/Library/Application Support/xcodeinstrumentmcp/cache.db unless XIM_DB_PATH overrides it for tests or custom local workflows.
Network outputs keep bodies, auth headers, and sensitive query values redacted by default. Sensitive network fields require an explicit opt-in flag or MCP argument.
Troubleshooting
xctrace not found:
Run
xcodeinstrumentmcp doctor.Confirm
xcrun --find xctracesucceeds.
No Time Profiler table found:
Re-record with the Time Profiler template or import a supported Time Profiler trace.
Processor Trace record/import is unavailable:
The analyzer is experimental and capability-gated.
Prefer importing a known-good Processor Trace artifact when host/target versions differ.
Signpost helper build fails:
Confirm
swift --versionworks.Re-run
xcodeinstrumentmcp doctorandswift build -c release --package-path tools/xim-swiftsignpost.
compare --baseline-snapshot fails:
Ensure both snapshots come from the same family, or pass explicit source artifacts with a supported comparison strategy.
This server cannot be deployed
Maintenance
Related MCP Connectors
- mcpOAuthio.artifacta
Artifact store for AI agents. Hosted OAuth at mcp.artifacta.io/mcp; local stdio via npm/PyPI.
MCP server for progressive tool usage at any scale (see https://klavis.ai)
Analytics for MCP servers. Find out which of your tools agents get wrong. MCPulse shows you which tools AI agents retry, which come back empty, and which they never call at all. Two lines inside your own server. It never sees your arguments or your results. getmcpulse.com
- SuperlogOAuthsh.superlog
Open-source agent that observes and fixes your application. Query logs, traces, metrics, incidents.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenancemacOS native profiling and debugging MCP server that wraps sample, atos, vmmap, leaks, and lldb to enable an agent to profile, symbolicate, and debug running or freshly launched processes without manual path or port handling.1-
- AlicenseNot gradedqualityCmaintenanceFirst-party MCP server and CLI for Xcode and iOS Simulator automation. Enables control of Xcode and iOS Simulator via MCP tools for tasks like building, testing, and automation.6 npm1MIT
- FlicenseNot gradedqualityAmaintenanceEnables coding agents to trace, profile, and burn down hotspots in application and native code, GPU kernels, and inference stacks by turning explicit local artifacts or commands into bounded, provenance-typed runtime evidence. Exposes named analysis and capture tools over stdio with optional durable preservation, without requiring workspace setup or project configuration.-
- FlicenseNot gradedqualityAmaintenanceEnables agents to gather bounded, reproducible runtime evidence by coordinating local profilers, benchmark tools, and trace processors against explicit artifacts or captured commands. It exposes typed analysis and capture operations over MCP that return provenance-tracked results inline, with optional durable preservation and replay of prior evidence.-