xcodeinstrumentmcp

xcodeinstrumentmcp

Local-first CLI and MCP server for turning Xcode Instruments artifacts into bounded, agent-sized evidence, with support for analyses like Time Profiler, Allocations, Network, and more.

Category
访问服务器

README

<img width="125" height="125" alt="image" src="https://github.com/user-attachments/assets/c56fc28d-c447-4408-bdfa-8d18111c7af8" />

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, and mcp
  • local 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-swiftsignpost SwiftSyntax helper
  • a bounded MCP surface over the same high-value workflows

Install

Repo-local install:

pnpm install
pnpm exec tsup
node dist/index.js doctor

Requirements:

  • macOS 14+
  • Node.js 22+
  • Xcode / xctrace
  • Swift toolchain for signpost helper build/use

CLI Quick Start

Check the local environment:

xcodeinstrumentmcp doctor

Import and persist a Time Profiler trace:

xcodeinstrumentmcp import --instrument time-profiler --input ./run.trace

Summarize a supported family fixture or artifact:

xcodeinstrumentmcp summarize --instrument allocations --input ./allocations.xml --format markdown
xcodeinstrumentmcp summarize --instrument network --input ./session.har --format json

Compare two stored snapshots:

xcodeinstrumentmcp compare --baseline-snapshot snap_base --candidate-snapshot snap_new --format json

Generate a reusable prompt pack:

xcodeinstrumentmcp prompt --snapshot snap_abc --size medium --format json

Scan 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_abc

Inspect the local cache:

xcodeinstrumentmcp db stats
xcodeinstrumentmcp db list-snapshots

Support Matrix

  • time-profiler: stable first-class analyzer with record, summarize, compare, and prompt support
  • allocations: stable first-class analyzer from trace export or exported detail XML
  • hangs: stable first-class analyzer from hang tables or fixture XML
  • network: stable first-class analyzer from HAR import with redaction by default
  • leaks: stable summary analyzer with conservative confidence language
  • energy-log: stable summary analyzer from exported summary XML
  • memory-graph: stable summary analyzer from imported .memgraph fixtures
  • processor-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_profile
  • record_profile
  • import_source
  • summarize_trace
  • summarize_snapshot
  • compare_traces
  • compare_snapshots
  • generate_optimization_prompt
  • generate_prompt_pack
  • list_snapshots
  • get_snapshot
  • get_comparison
  • get_findings
  • plan_signposts
  • apply_signpost_plan
  • revert_signpost_patch

Limitations

  • Processor Trace is experimental and returns experimental: true in 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 record path.
  • 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 xctrace succeeds.

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 --version works.
  • Re-run xcodeinstrumentmcp doctor and swift 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.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选