Skip to content

Commit 211b14c

Browse files
committed
refactor(11/12): update manifests, config, docs, and example projects (#329)
This is **PR 11 of 12** in a stacked PR series that decouples the rendering pipeline from MCP transport. Depends on PR 10 (boundary rewiring). Updates all configuration files, YAML manifests, documentation, and example projects to reflect the rendering pipeline refactor. No behavioral code changes -- this is metadata, documentation, and project configuration. All tool manifests updated to reflect the simplified handler contract. Changes are consistent across all manifests: - Removed output format configuration that is now handled by the render session - Updated parameter descriptions where they referenced the old rendering model Added `manifests/resources/` directory with resource manifest definitions that were previously inline. - `package.json` + `package-lock.json`: Dependency updates and script changes - `knip.json`: Dead code analysis configuration for the new module structure - `vitest.config.ts`: Minor updates for new test paths - `vitest.flowdeck.config.ts` + `vitest.snapshot.config.ts`: New vitest configs for flowdeck integration tests and snapshot tests respectively New developer documentation explaining the rendering pipeline architecture: - `RENDERING_PIPELINE.md`: Architecture overview for contributors - `RENDERING_PIPELINE_REFACTOR.md`: Migration guide and decision log - `QUERY_TOOL_FORMAT_SPEC.md`: Specification for query tool output formatting - `FIXTURE_DESIGNS.md`: Snapshot test fixture design documentation - `STRUCTURED_XCODEBUILD_EVENTS_PLAN.md`: Design document for the xcodebuild event model - Updated `ARCHITECTURE.md`, `TESTING.md`, `MANIFEST_FORMAT.md`, `TOOL_DISCOVERY_LOGIC.md` Minor updates to example projects to work with the updated tool interfaces. Updated test files and project configuration. - `AGENTS.md`: Updated project rules - New test infrastructure: `test-helpers.ts`, `vitest-executor-safety.setup.ts` - Build scripts updated: removed `copy-build-assets.js` (no longer needed), added benchmark and capture wrapper scripts - PR 1-10/12: All code changes - **PR 11/12** (this PR): Manifests, config, docs, examples - PR 12/12: Snapshot test fixtures and benchmarks - [ ] `npx vitest run` passes - [ ] Manifest validation passes for all YAML files - [ ] Documentation renders correctly in GitHub - [ ] Example projects build successfully
1 parent 2063cca commit 211b14c

File tree

64 files changed

+3715
-687
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+3715
-687
lines changed

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ Use these sections under `## [Unreleased]`:
4646
- Append to existing subsections (e.g., `### Fixed`), do not create duplicates
4747
- NEVER modify already-released version sections (e.g., `## [0.12.2]`)
4848
- Each version section is immutable once released
49+
- NEVER update snapshot fixtures unless asked to do so, these are integration tests, on failure assume code is wrong before questioning the fixture
4950
-
5051
#### Attribution
5152
- **Internal changes (from issues)**: `Fixed foo bar ([#123](https://github.com/cameroncook/XcodeBuildMCP/issues/123))`

docs/CLI.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,34 @@ xcodebuildmcp simulator launch-app --simulator-id <UDID> --bundle-id io.sentry.M
7777
xcodebuildmcp simulator build-and-run --scheme MyApp --project-path ./MyApp.xcodeproj
7878
```
7979

80+
### Human-readable build-and-run output
81+
82+
For xcodebuild-backed build-and-run tools:
83+
84+
- CLI text mode prints a durable preflight block first
85+
- interactive terminals then show active phases as live replace-in-place updates
86+
- warnings, errors, failures, summaries, and next steps are durable output
87+
- success output order is: front matter -> runtime state/diagnostics -> summary -> execution-derived footer -> next steps
88+
- failed structured xcodebuild runs do not render next steps
89+
- compiler/build diagnostics should be grouped into a readable failure block before the failed summary
90+
- the final footer should only contain execution-derived values such as app path, bundle ID, app ID, or process ID
91+
- requested values like scheme, project/workspace, configuration, and platform stay in front matter and should not be repeated later
92+
- when the tool computes a concrete value during execution, prefer showing it directly in the footer instead of relegating it to a hint or redundant next step
93+
94+
For example, a successful build-and-run footer should prefer:
95+
96+
```text
97+
✅ Build & Run complete
98+
99+
└ App Path: /tmp/.../MyApp.app
100+
```
101+
102+
rather than forcing the user to run another command just to retrieve a value the tool already knows.
103+
104+
MCP uses the same human-readable formatting semantics, but buffers the rendered output instead of streaming it to stdout live. It is the same section model and ordering, just a different sink.
105+
106+
`--output json` is still streamed JSONL events, not the human-readable section format.
107+
80108
### Testing
81109

82110
```bash
@@ -85,8 +113,15 @@ xcodebuildmcp simulator test --scheme MyAppTests --project-path ./MyApp.xcodepro
85113

86114
# Run with specific simulator
87115
xcodebuildmcp simulator test --scheme MyAppTests --simulator-name "iPhone 17 Pro"
116+
117+
# Run with pre-resolved test discovery and live progress
118+
xcodebuildmcp simulator test --json '{"workspacePath":"./MyApp.xcworkspace","scheme":"MyApp","simulatorName":"iPhone 17 Pro","progress":true,"extraArgs":["-only-testing:MyAppTests"]}'
88119
```
89120

121+
Simulator test output now pre-resolves concrete Swift XCTest and Swift Testing cases when it can, then streams filtered milestones for package resolution, compilation, and test execution plus a grouped failure summary instead of raw `xcodebuild` noise.
122+
123+
For reproducible performance comparisons against Flowdeck CLI, see [dev/simulator-test-benchmark.md](dev/simulator-test-benchmark.md).
124+
90125
For a full list of workflows and tools, see [TOOLS-CLI.md](TOOLS-CLI.md).
91126

92127
## Configuration

docs/TOOLS-CLI.md

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This document lists CLI tool names as exposed by `xcodebuildmcp <workflow> <tool>`.
44

5-
XcodeBuildMCP provides 76 canonical tools organized into 14 workflow groups.
5+
XcodeBuildMCP provides 71 canonical tools organized into 13 workflow groups.
66

77
## Workflow Groups
88

@@ -22,10 +22,10 @@ XcodeBuildMCP provides 76 canonical tools organized into 14 workflow groups.
2222

2323

2424
### iOS Device Development (`device`)
25-
**Purpose**: Complete iOS development workflow for physical devices (iPhone, iPad, Apple Watch, Apple TV, Apple Vision Pro). (17 tools)
25+
**Purpose**: Complete iOS development workflow for physical devices (iPhone, iPad, Apple Watch, Apple TV, Apple Vision Pro). (15 tools)
2626

2727
- `build` - Build for device.
28-
- `build-and-run` - Build, install, and launch on physical device. Preferred single-step run tool when defaults are set.
28+
- `build-and-run` - Build, install, and launch on physical device. Runtime logs are captured automatically and the log file path is included in the response. Preferred single-step run tool when defaults are set.
2929
- `clean` - Clean build products.
3030
- `discover-projects` - Scans a directory (defaults to workspace root) to find Xcode project (.xcodeproj) and workspace (.xcworkspace) files. Use when project/workspace path is unknown.
3131
- `get-app-bundle-id` - Extract bundle id from .app.
@@ -37,38 +37,33 @@ XcodeBuildMCP provides 76 canonical tools organized into 14 workflow groups.
3737
- `list` - List connected devices.
3838
- `list-schemes` - List Xcode schemes.
3939
- `show-build-settings` - Show build settings.
40-
- `start-device-log-capture` - Start device log capture.
4140
- `stop` - Stop device app.
42-
- `stop-device-log-capture` - Stop device app and return logs.
4341
- `test` - Test on device.
4442

4543

4644

4745
### iOS Simulator Development (`simulator`)
48-
**Purpose**: Complete iOS development workflow for both .xcodeproj and .xcworkspace files targeting simulators. (23 tools)
46+
**Purpose**: Complete iOS development workflow for both .xcodeproj and .xcworkspace files targeting simulators. (20 tools)
4947

5048
- `boot` - Defined in Simulator Management workflow.
5149
- `build` - Build for iOS sim (compile-only, no launch).
52-
- `build-and-run` - Build, install, and launch on iOS Simulator; boots simulator and attempts to open Simulator.app as needed. Preferred single-step run tool when defaults are set.
50+
- `build-and-run` - Build, install, and launch on iOS Simulator; boots simulator and attempts to open Simulator.app as needed. Runtime logs are captured automatically and the log file path is included in the response. Preferred single-step run tool when defaults are set.
5351
- `clean` - Defined in iOS Device Development workflow.
5452
- `discover-projects` - Defined in iOS Device Development workflow.
5553
- `get-app-bundle-id` - Defined in iOS Device Development workflow.
5654
- `get-app-path` - Get sim built app path.
5755
- `get-coverage-report` - Defined in Code Coverage workflow.
5856
- `get-file-coverage` - Defined in Code Coverage workflow.
5957
- `install` - Install app on sim.
60-
- `launch-app` - Launch app on simulator.
61-
- `launch-app-with-logs` - Launch sim app with logs.
58+
- `launch-app` - Launch app on simulator. Runtime logs are captured automatically and the log file path is included in the response.
6259
- `list` - Defined in Simulator Management workflow.
6360
- `list-schemes` - Defined in iOS Device Development workflow.
6461
- `open` - Defined in Simulator Management workflow.
6562
- `record-video` - Record sim video.
6663
- `screenshot` - Capture screenshot.
6764
- `show-build-settings` - Defined in iOS Device Development workflow.
6865
- `snapshot-ui` - Print view hierarchy with precise view coordinates (x, y, width, height) for visible elements.
69-
- `start-simulator-log-capture` - Defined in Log Capture workflow.
7066
- `stop` - Stop sim app.
71-
- `stop-simulator-log-capture` - Defined in Log Capture workflow.
7267
- `test` - Test on iOS sim.
7368

7469

@@ -87,16 +82,6 @@ XcodeBuildMCP provides 76 canonical tools organized into 14 workflow groups.
8782

8883

8984

90-
### Log Capture (`logging`)
91-
**Purpose**: Capture and retrieve logs from simulator and device apps. (4 tools)
92-
93-
- `start-device-log-capture` - Defined in iOS Device Development workflow.
94-
- `start-simulator-log-capture` - Start sim log capture.
95-
- `stop-device-log-capture` - Defined in iOS Device Development workflow.
96-
- `stop-simulator-log-capture` - Stop sim app and return logs.
97-
98-
99-
10085
### macOS Development (`macos`)
10186
**Purpose**: Complete macOS development workflow for both .xcodeproj and .xcworkspace files. Build, test, deploy, and manage macOS applications. (13 tools)
10287

@@ -200,10 +185,10 @@ XcodeBuildMCP provides 76 canonical tools organized into 14 workflow groups.
200185

201186
## Summary Statistics
202187

203-
- **Canonical Tools**: 76
204-
- **Total Tools**: 108
205-
- **Workflow Groups**: 14
188+
- **Canonical Tools**: 71
189+
- **Total Tools**: 99
190+
- **Workflow Groups**: 13
206191

207192
---
208193

209-
*This documentation is automatically generated by `scripts/update-tools-docs.ts` from the tools manifest. Last updated: 2026-03-16T20:47:13.697Z UTC*
194+
*This documentation is automatically generated by `scripts/update-tools-docs.ts` from the tools manifest. Last updated: 2026-04-07T11:23:03.868Z UTC*

docs/TOOLS.md

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# XcodeBuildMCP MCP Tools Reference
22

3-
This document lists MCP tool names as exposed to MCP clients. XcodeBuildMCP provides 82 canonical tools organized into 16 workflow groups for comprehensive Apple development workflows.
3+
This document lists MCP tool names as exposed to MCP clients. XcodeBuildMCP provides 77 canonical tools organized into 15 workflow groups for comprehensive Apple development workflows.
44

55
## Workflow Groups
66

@@ -20,10 +20,10 @@ This document lists MCP tool names as exposed to MCP clients. XcodeBuildMCP prov
2020

2121

2222
### iOS Device Development (`device`)
23-
**Purpose**: Complete iOS development workflow for physical devices (iPhone, iPad, Apple Watch, Apple TV, Apple Vision Pro). (17 tools)
23+
**Purpose**: Complete iOS development workflow for physical devices (iPhone, iPad, Apple Watch, Apple TV, Apple Vision Pro). (15 tools)
2424

2525
- `build_device` - Build for device.
26-
- `build_run_device` - Build, install, and launch on physical device. Preferred single-step run tool when defaults are set.
26+
- `build_run_device` - Build, install, and launch on physical device. Runtime logs are captured automatically and the log file path is included in the response. Preferred single-step run tool when defaults are set.
2727
- `clean` - Clean build products.
2828
- `discover_projs` - Scans a directory (defaults to workspace root) to find Xcode project (.xcodeproj) and workspace (.xcworkspace) files. Use when project/workspace path is unknown.
2929
- `get_app_bundle_id` - Extract bundle id from .app.
@@ -35,18 +35,16 @@ This document lists MCP tool names as exposed to MCP clients. XcodeBuildMCP prov
3535
- `list_devices` - List connected devices.
3636
- `list_schemes` - List Xcode schemes.
3737
- `show_build_settings` - Show build settings.
38-
- `start_device_log_cap` - Start device log capture.
3938
- `stop_app_device` - Stop device app.
40-
- `stop_device_log_cap` - Stop device app and return logs.
4139
- `test_device` - Test on device.
4240

4341

4442

4543
### iOS Simulator Development (`simulator`)
46-
**Purpose**: Complete iOS development workflow for both .xcodeproj and .xcworkspace files targeting simulators. (23 tools)
44+
**Purpose**: Complete iOS development workflow for both .xcodeproj and .xcworkspace files targeting simulators. (20 tools)
4745

4846
- `boot_sim` - Defined in Simulator Management workflow.
49-
- `build_run_sim` - Build, install, and launch on iOS Simulator; boots simulator and attempts to open Simulator.app as needed. Preferred single-step run tool when defaults are set.
47+
- `build_run_sim` - Build, install, and launch on iOS Simulator; boots simulator and attempts to open Simulator.app as needed. Runtime logs are captured automatically and the log file path is included in the response. Preferred single-step run tool when defaults are set.
5048
- `build_sim` - Build for iOS sim (compile-only, no launch).
5149
- `clean` - Defined in iOS Device Development workflow.
5250
- `discover_projs` - Defined in iOS Device Development workflow.
@@ -55,18 +53,15 @@ This document lists MCP tool names as exposed to MCP clients. XcodeBuildMCP prov
5553
- `get_file_coverage` - Defined in Code Coverage workflow.
5654
- `get_sim_app_path` - Get sim built app path.
5755
- `install_app_sim` - Install app on sim.
58-
- `launch_app_logs_sim` - Launch sim app with logs.
59-
- `launch_app_sim` - Launch app on simulator.
56+
- `launch_app_sim` - Launch app on simulator. Runtime logs are captured automatically and the log file path is included in the response.
6057
- `list_schemes` - Defined in iOS Device Development workflow.
6158
- `list_sims` - Defined in Simulator Management workflow.
6259
- `open_sim` - Defined in Simulator Management workflow.
6360
- `record_sim_video` - Record sim video.
6461
- `screenshot` - Capture screenshot.
6562
- `show_build_settings` - Defined in iOS Device Development workflow.
6663
- `snapshot_ui` - Print view hierarchy with precise view coordinates (x, y, width, height) for visible elements.
67-
- `start_sim_log_cap` - Defined in Log Capture workflow.
6864
- `stop_app_sim` - Stop sim app.
69-
- `stop_sim_log_cap` - Defined in Log Capture workflow.
7065
- `test_sim` - Test on iOS sim.
7166

7267

@@ -85,16 +80,6 @@ This document lists MCP tool names as exposed to MCP clients. XcodeBuildMCP prov
8580

8681

8782

88-
### Log Capture (`logging`)
89-
**Purpose**: Capture and retrieve logs from simulator and device apps. (4 tools)
90-
91-
- `start_device_log_cap` - Defined in iOS Device Development workflow.
92-
- `start_sim_log_cap` - Start sim log capture.
93-
- `stop_device_log_cap` - Defined in iOS Device Development workflow.
94-
- `stop_sim_log_cap` - Stop sim app and return logs.
95-
96-
97-
9883
### macOS Development (`macos`)
9984
**Purpose**: Complete macOS development workflow for both .xcodeproj and .xcworkspace files. Build, test, deploy, and manage macOS applications. (13 tools)
10085

@@ -216,10 +201,10 @@ This document lists MCP tool names as exposed to MCP clients. XcodeBuildMCP prov
216201

217202
## Summary Statistics
218203

219-
- **Canonical Tools**: 82
220-
- **Total Tools**: 114
221-
- **Workflow Groups**: 16
204+
- **Canonical Tools**: 77
205+
- **Total Tools**: 105
206+
- **Workflow Groups**: 15
222207

223208
---
224209

225-
*This documentation is automatically generated by `scripts/update-tools-docs.ts` from the tools manifest. Last updated: 2026-03-16T20:47:13.697Z UTC*
210+
*This documentation is automatically generated by `scripts/update-tools-docs.ts` from the tools manifest. Last updated: 2026-04-07T11:23:03.868Z UTC*

docs/dev/ARCHITECTURE.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,20 @@ XcodeBuildMCP is a Model Context Protocol (MCP) server that exposes Xcode operat
3838
- MCP server created with stdio transport
3939
- Plugin discovery system initialized
4040

41-
3. **Plugin Discovery (Build-Time)**
42-
- A build-time script (`build-plugins/plugin-discovery.ts`) scans the `src/mcp/tools/` and `src/mcp/resources/` directories
43-
- It generates `src/core/generated-plugins.ts` and `src/core/generated-resources.ts` with dynamic import maps
44-
- This approach improves startup performance by avoiding synchronous file system scans and enables code-splitting
45-
- Tool code is only loaded when needed, reducing initial memory footprint
46-
47-
4. **Plugin & Resource Loading (Runtime)**
48-
- At runtime, `loadPlugins()` and `loadResources()` use the generated loaders from the previous step
49-
- All workflow loaders are executed at startup to register tools
50-
- If `XCODEBUILDMCP_ENABLED_WORKFLOWS` is set, only those workflows (plus `session-management`) are registered; `workflow-discovery` is only auto-included when `XCODEBUILDMCP_EXPERIMENTAL_WORKFLOW_DISCOVERY=true`
51-
52-
5. **Tool Registration**
53-
- Discovered tools automatically registered with server using pre-generated maps
54-
- No manual registration or configuration required
41+
3. **Manifest-Driven Discovery**
42+
- YAML manifests in `manifests/tools/`, `manifests/workflows/`, and `manifests/resources/` define all metadata
43+
- `loadManifest()` reads and validates all YAML files at startup against Zod schemas
44+
- Tool and resource code modules are dynamically imported on demand
45+
46+
4. **Tool & Resource Loading (Runtime)**
47+
- `registerWorkflowsFromManifest()` selects workflows based on config and predicate context, then dynamically imports tool modules
48+
- `registerResources()` loads resource manifests, filters by predicates, and dynamically imports resource modules
49+
- Both systems share the same `PredicateContext` for visibility filtering
50+
- If `XCODEBUILDMCP_ENABLED_WORKFLOWS` is set, only those workflows (plus `session-management`) are registered; `workflow-discovery` is only auto-included when `XCODEBUILDMCP_EXPERIMENTAL_WORKFLOW_DISCOVERY=true`
51+
52+
5. **Tool & Resource Registration**
53+
- Tools are registered via `server.registerTool()` after manifest-driven workflow selection
54+
- Resources are registered via `server.resource()` after manifest-driven predicate filtering
5555
- Environment variables control workflow selection behavior
5656

5757
5. **Request Handling**

0 commit comments

Comments
 (0)