instruments-mcp-server
Health Pass
- License — License: MIT
- Description — Repository has a description
- Active repo — Last push 0 days ago
- Community trust — 10 GitHub stars
Code Warn
- process.env — Environment variable access in src/__tests__/axe.test.ts
- network request — Outbound network request in src/__tests__/trace-store.test.ts
Permissions Pass
- Permissions — No dangerous permissions requested
This MCP server wraps Xcode Instruments to provide AI coding agents with structured performance profiling data (CPU, memory, SwiftUI, etc.) instead of raw, unparsed XML outputs. It also enables programmatic control over the iOS simulator and UI automation for testing scenarios.
Security Assessment
Overall Risk: Medium. The core function of this server requires it to execute local shell commands to interact with Xcode, the iOS simulator, and the `xctrace` command-line tool. While this is expected behavior for its intended purpose, it means the tool inherently requires significant local system privileges to operate. A static scan of the codebase found no hardcoded secrets and no dangerous permissions requested. The automated checks did flag environment variable access and an outbound network request, but upon closer inspection, these are safely isolated within the test suite (`axe.test.ts` and `trace-store.test.ts`) rather than the core application. No malicious data harvesting or external communication was found in the production code.
Quality Assessment
The project demonstrates strong health and maintenance indicators. It is licensed under the permissive and standard MIT license. It is very actively maintained, with repository pushes occurring as recently as today. While the tool is relatively new and niche, it has started to accumulate a modest level of community trust with 10 GitHub stars. The project is well-documented, providing clear setup instructions, requirements (macOS and Xcode), and expected outputs for developers.
Verdict
Safe to use.
MCP server for Xcode Instruments — AI agents get structured performance profiling (CPU, SwiftUI, memory, hitches) instead of raw xctrace XML
InstrumentsMCP
Profiler data for agents.
MCP server that wraps Xcode Instruments. Record traces, automate the simulator, and return structured profiling data your coding agent can act on.
Quick Start
Requirements: macOS, Xcode, Node.js >= 20
Add to your project's .mcp.json:
{
"mcpServers": {
"instruments": {
"command": "npx",
"args": ["-y", "instrumentsmcp@latest"]
}
}
}
Or run directly: npx instrumentsmcp@latest
Works with Claude Code, Cursor, Windsurf, and any MCP client.
What It Does
Ask your agent to profile. It records a trace, drives the simulator, and returns structured results:
=== Time Profiler === severity: [WARNING] samples: 1587
Hotspots:
UpdateStack::update() (AttributeGraph) 42.3ms self ━━━━━━╌╌╌╌╌╌╌╌╌ 12.1%
FeedViewModel.loadItems() (MyApp) 28.1ms self ━━━━╌╌╌╌╌╌╌╌╌╌╌ 8.0%
Main thread blockers:
[WARNING] FeedViewModel.loadItems() 28.1ms
35 tools across profiling, UI automation, simulator control, and trace analysis. Full tool list →
Profiling
- One-shot —
profile_cpu,profile_swiftui,profile_memory,profile_hitches,profile_launch,profile_energy,profile_leaks,profile_network - Scripted scenarios —
profile_scenariorecords a trace while executing UI steps (tap, scroll, type, launch) - Interactive —
start_profiling/stop_profilingfor manual interaction - Health check —
performance_auditruns 5 templates and combines the results - Any template —
profile_rawhandles templates without a dedicated parser
UI Automation
Drive the simulator programmatically: ui_tap, ui_type, ui_swipe, ui_gesture, ui_snapshot, ui_long_press. Powered by AXe CLI (brew tap cameroncooke/axe && brew install axe).
Simulator Control
Launch/terminate apps, open deep links, push notifications, take screenshots, set location, toggle dark mode.
Analysis
Re-analyze saved traces, drill into specific functions, track regressions with baselines, generate Markdown reports.
CLI Mode
Record traces from the terminal without an MCP client:
npx instrumentsmcp record --process MyApp
npx instrumentsmcp record --process MyApp --template Allocations
Ctrl+C to stop. Feed the trace to your agent for analysis.
Compatibility
- Xcode Instruments (xctrace) 15.x through 26.x
- Handles xctrace 26 Deferred recording mode automatically
- Device identifiers (
booted, device name, UDID) resolved automatically
Docs
Architecturesrc/
├── index.ts # MCP server entry + CLI router
├── cli.ts # CLI mode (instrumentsmcp record)
├── tools/
│ ├── profile.ts # One-shot profiling tools
│ ├── simulator.ts # Simulator control + start/stop + scenarios
│ ├── analyze.ts # Trace analysis + symbolication + audit
│ ├── baseline.ts # Baseline comparison + report generation
│ ├── investigate.ts # Drill-down + trace listing
│ ├── ui.ts # UI automation (snapshot, tap, type, swipe)
│ └── list.ts # Discovery tools (status, templates, devices)
├── parsers/ # Template-specific XML→JSON parsers
└── utils/ # xctrace, simctl, AXe wrappers + shared helpers
Build from source
git clone https://github.com/nemanjavlahovic/instruments-mcp-server.git
cd instruments-mcp-server
npm install && npm run build
Point your MCP client to dist/index.js.
License
MIT
Reviews (0)
Sign in to leave a review.
Leave a reviewNo results found