-
-
Notifications
You must be signed in to change notification settings - Fork 195
Add legacy session-aware opt-out mode #148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughAdds an environment-driven opt-out for session-aware tool schemas, a helper to select session-aware or legacy Zod shapes at runtime, message formatting for missing-parameter errors, tests, README updates, and migrates ~40 tool modules to use the new schema selector; also adds an Xcode test target and a stub Swift test. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Client
participant Tool as "Tool module"
participant Factory as "typed-tool-factory\n(getSessionAwareToolSchemaShape)"
participant Env as "environment\nenv helper"
participant Zod as "Zod schema (session/legacy)"
Client->>Tool: invoke tool with params
Tool->>Factory: request schema for tool
Factory->>Env: check XCODEBUILDMCP_DISABLE_SESSION_DEFAULTS
Env-->>Factory: opt-out flag (true/false)
alt opt-out disabled
Factory->>Zod: return session-aware combined shape
else opt-out enabled
Factory->>Zod: return legacy full shape
end
Factory-->>Tool: schema shape
Tool->>Zod: validate params
alt validation fails
Zod-->>Tool: validation errors
Tool->>Client: formatted error (may include session-defaults tip)
else validation passes
Zod-->>Tool: validated params
Tool->>Client: execute handler and return result
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (2)**/*.{test,spec}.ts📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.ts📄 CodeRabbit inference engine (AGENTS.md)
Files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/utils/environment.ts (1)
70-80: Session-defaults opt-out helper logic looks soundThe normalization and accepted truthy values for
XCODEBUILDMCP_DISABLE_SESSION_DEFAULTSmatch the function name and intended “opt-out enabled” semantics; I don’t see any logic issues here. You may just want to ensure the README’s legacy opt-out section explicitly lists these accepted values so behavior is fully transparent to users.example_projects/macOS/MCPTest.xcodeproj/project.pbxproj (1)
128-137: Xcode version metadata from beta toolchain.
LastSwiftUpdateCheck = 2600andCreatedOnToolsVersion = 26.0indicate this was generated by an Xcode 26 beta. While these metadata values don't affect builds directly, they may cause warnings when opening in released Xcode versions. Consider regenerating the test target with a released Xcode version if compatibility with stable Xcode is desired.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (49)
README.md(2 hunks)example_projects/macOS/MCPTest.xcodeproj/project.pbxproj(10 hunks)example_projects/macOS/MCPTest.xcodeproj/xcshareddata/xcschemes/MCPTest.xcscheme(1 hunks)example_projects/macOS/MCPTestTests/MCPTestTests.swift(1 hunks)src/mcp/tools/device/build_device.ts(3 hunks)src/mcp/tools/device/get_device_app_path.ts(3 hunks)src/mcp/tools/device/install_app_device.ts(3 hunks)src/mcp/tools/device/launch_app_device.ts(3 hunks)src/mcp/tools/device/stop_app_device.ts(3 hunks)src/mcp/tools/device/test_device.ts(3 hunks)src/mcp/tools/logging/start_device_log_cap.ts(3 hunks)src/mcp/tools/logging/start_sim_log_cap.ts(2 hunks)src/mcp/tools/macos/build_macos.ts(2 hunks)src/mcp/tools/macos/build_run_macos.ts(2 hunks)src/mcp/tools/macos/get_mac_app_path.ts(2 hunks)src/mcp/tools/macos/test_macos.ts(2 hunks)src/mcp/tools/project-discovery/list_schemes.ts(2 hunks)src/mcp/tools/project-discovery/show_build_settings.ts(2 hunks)src/mcp/tools/session-management/session_set_defaults.ts(1 hunks)src/mcp/tools/simulator-management/erase_sims.ts(2 hunks)src/mcp/tools/simulator-management/reset_sim_location.ts(2 hunks)src/mcp/tools/simulator-management/set_sim_appearance.ts(2 hunks)src/mcp/tools/simulator-management/set_sim_location.ts(2 hunks)src/mcp/tools/simulator-management/sim_statusbar.ts(2 hunks)src/mcp/tools/simulator/boot_sim.ts(2 hunks)src/mcp/tools/simulator/build_run_sim.ts(2 hunks)src/mcp/tools/simulator/build_sim.ts(2 hunks)src/mcp/tools/simulator/get_sim_app_path.ts(2 hunks)src/mcp/tools/simulator/install_app_sim.ts(2 hunks)src/mcp/tools/simulator/launch_app_logs_sim.ts(2 hunks)src/mcp/tools/simulator/launch_app_sim.ts(2 hunks)src/mcp/tools/simulator/record_sim_video.ts(2 hunks)src/mcp/tools/simulator/stop_app_sim.ts(2 hunks)src/mcp/tools/simulator/test_sim.ts(2 hunks)src/mcp/tools/ui-testing/button.ts(2 hunks)src/mcp/tools/ui-testing/describe_ui.ts(2 hunks)src/mcp/tools/ui-testing/gesture.ts(2 hunks)src/mcp/tools/ui-testing/key_press.ts(2 hunks)src/mcp/tools/ui-testing/key_sequence.ts(2 hunks)src/mcp/tools/ui-testing/long_press.ts(2 hunks)src/mcp/tools/ui-testing/screenshot.ts(2 hunks)src/mcp/tools/ui-testing/swipe.ts(2 hunks)src/mcp/tools/ui-testing/tap.ts(4 hunks)src/mcp/tools/ui-testing/touch.ts(2 hunks)src/mcp/tools/ui-testing/type_text.ts(2 hunks)src/mcp/tools/utilities/clean.ts(2 hunks)src/utils/__tests__/session-aware-tool-factory.test.ts(1 hunks)src/utils/environment.ts(1 hunks)src/utils/typed-tool-factory.ts(5 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.ts
📄 CodeRabbit inference engine (AGENTS.md)
**/*.ts: Use .ts extensions for all internal relative imports (e.g., import { tool } from './tool.ts')
Use .ts extensions in re-exports for internal files (e.g., export { default } from '../shared/tool.ts')
Use .js extension only for external package entry points (e.g., import ... from '@scope/pkg/file.js')
Never import internal project files using .js extensions
Files:
src/mcp/tools/ui-testing/describe_ui.tssrc/mcp/tools/macos/build_run_macos.tssrc/mcp/tools/simulator/test_sim.tssrc/mcp/tools/simulator-management/set_sim_appearance.tssrc/utils/__tests__/session-aware-tool-factory.test.tssrc/mcp/tools/simulator/build_run_sim.tssrc/mcp/tools/utilities/clean.tssrc/mcp/tools/ui-testing/button.tssrc/mcp/tools/simulator-management/sim_statusbar.tssrc/mcp/tools/device/get_device_app_path.tssrc/mcp/tools/project-discovery/list_schemes.tssrc/mcp/tools/simulator-management/erase_sims.tssrc/mcp/tools/simulator-management/set_sim_location.tssrc/utils/typed-tool-factory.tssrc/mcp/tools/ui-testing/screenshot.tssrc/mcp/tools/simulator/build_sim.tssrc/mcp/tools/ui-testing/key_press.tssrc/mcp/tools/macos/get_mac_app_path.tssrc/mcp/tools/simulator/record_sim_video.tssrc/mcp/tools/ui-testing/key_sequence.tssrc/mcp/tools/ui-testing/long_press.tssrc/mcp/tools/simulator/launch_app_sim.tssrc/mcp/tools/macos/test_macos.tssrc/utils/environment.tssrc/mcp/tools/device/install_app_device.tssrc/mcp/tools/logging/start_sim_log_cap.tssrc/mcp/tools/ui-testing/type_text.tssrc/mcp/tools/simulator/stop_app_sim.tssrc/mcp/tools/ui-testing/swipe.tssrc/mcp/tools/project-discovery/show_build_settings.tssrc/mcp/tools/simulator/install_app_sim.tssrc/mcp/tools/device/launch_app_device.tssrc/mcp/tools/ui-testing/gesture.tssrc/mcp/tools/ui-testing/touch.tssrc/mcp/tools/ui-testing/tap.tssrc/mcp/tools/device/stop_app_device.tssrc/mcp/tools/simulator-management/reset_sim_location.tssrc/mcp/tools/simulator/get_sim_app_path.tssrc/mcp/tools/macos/build_macos.tssrc/mcp/tools/device/test_device.tssrc/mcp/tools/simulator/launch_app_logs_sim.tssrc/mcp/tools/logging/start_device_log_cap.tssrc/mcp/tools/simulator/boot_sim.tssrc/mcp/tools/session-management/session_set_defaults.tssrc/mcp/tools/device/build_device.ts
**/*.{test,spec}.ts
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{test,spec}.ts: Do not use Vitest mocking APIs in tests (no vi.mock, vi.fn, vi.spyOn, etc.)
In tests, import the core ...Logic function from the tool and use createMockExecutor/createMockFileSystemExecutor to simulate outcomes
Files:
src/utils/__tests__/session-aware-tool-factory.test.ts
🧠 Learnings (3)
📚 Learning: 2025-09-21T19:27:22.795Z
Learnt from: CR
Repo: cameroncooke/XcodeBuildMCP PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-21T19:27:22.795Z
Learning: Applies to **/*.{test,spec}.ts : In tests, import the core ...Logic function from the tool and use createMockExecutor/createMockFileSystemExecutor to simulate outcomes
Applied to files:
src/mcp/tools/macos/build_run_macos.tssrc/mcp/tools/simulator/test_sim.tssrc/utils/__tests__/session-aware-tool-factory.test.tssrc/mcp/tools/simulator/build_run_sim.tssrc/mcp/tools/utilities/clean.tssrc/mcp/tools/device/get_device_app_path.tssrc/mcp/tools/project-discovery/list_schemes.tssrc/mcp/tools/simulator-management/erase_sims.tssrc/mcp/tools/simulator-management/set_sim_location.tssrc/utils/typed-tool-factory.tssrc/mcp/tools/ui-testing/screenshot.tssrc/mcp/tools/simulator/build_sim.tssrc/mcp/tools/macos/get_mac_app_path.tssrc/mcp/tools/simulator/record_sim_video.tssrc/mcp/tools/simulator/launch_app_sim.tssrc/mcp/tools/macos/test_macos.tssrc/mcp/tools/device/install_app_device.tssrc/mcp/tools/logging/start_sim_log_cap.tssrc/mcp/tools/ui-testing/type_text.tssrc/mcp/tools/simulator/stop_app_sim.tssrc/mcp/tools/project-discovery/show_build_settings.tssrc/mcp/tools/simulator/install_app_sim.tssrc/mcp/tools/device/launch_app_device.tssrc/mcp/tools/ui-testing/touch.tssrc/mcp/tools/device/stop_app_device.tssrc/mcp/tools/simulator-management/reset_sim_location.tssrc/mcp/tools/simulator/get_sim_app_path.tssrc/mcp/tools/macos/build_macos.tssrc/mcp/tools/device/test_device.tssrc/mcp/tools/simulator/launch_app_logs_sim.tssrc/mcp/tools/logging/start_device_log_cap.tssrc/mcp/tools/simulator/boot_sim.tssrc/mcp/tools/device/build_device.ts
📚 Learning: 2025-09-21T19:27:22.795Z
Learnt from: CR
Repo: cameroncooke/XcodeBuildMCP PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-21T19:27:22.795Z
Learning: Applies to **/*.ts : Use .ts extensions in re-exports for internal files (e.g., export { default } from '../shared/tool.ts')
Applied to files:
src/mcp/tools/ui-testing/touch.tssrc/mcp/tools/device/test_device.ts
📚 Learning: 2025-09-21T19:27:22.795Z
Learnt from: CR
Repo: cameroncooke/XcodeBuildMCP PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-21T19:27:22.795Z
Learning: Applies to **/*.ts : Use .ts extensions for all internal relative imports (e.g., import { tool } from './tool.ts')
Applied to files:
src/mcp/tools/ui-testing/touch.ts
🧬 Code graph analysis (42)
src/mcp/tools/ui-testing/describe_ui.ts (1)
src/utils/typed-tool-factory.ts (1)
getSessionAwareToolSchemaShape(89-94)
src/mcp/tools/macos/build_run_macos.ts (1)
src/utils/typed-tool-factory.ts (1)
getSessionAwareToolSchemaShape(89-94)
src/mcp/tools/simulator/test_sim.ts (1)
src/utils/typed-tool-factory.ts (1)
getSessionAwareToolSchemaShape(89-94)
src/mcp/tools/simulator-management/set_sim_appearance.ts (1)
src/utils/typed-tool-factory.ts (1)
getSessionAwareToolSchemaShape(89-94)
src/mcp/tools/simulator/build_run_sim.ts (1)
src/utils/typed-tool-factory.ts (1)
getSessionAwareToolSchemaShape(89-94)
src/mcp/tools/utilities/clean.ts (1)
src/utils/typed-tool-factory.ts (1)
getSessionAwareToolSchemaShape(89-94)
src/mcp/tools/ui-testing/button.ts (1)
src/utils/typed-tool-factory.ts (1)
getSessionAwareToolSchemaShape(89-94)
src/mcp/tools/simulator-management/sim_statusbar.ts (1)
src/utils/typed-tool-factory.ts (1)
getSessionAwareToolSchemaShape(89-94)
src/mcp/tools/device/get_device_app_path.ts (1)
src/utils/typed-tool-factory.ts (1)
getSessionAwareToolSchemaShape(89-94)
src/mcp/tools/project-discovery/list_schemes.ts (1)
src/utils/typed-tool-factory.ts (1)
getSessionAwareToolSchemaShape(89-94)
src/mcp/tools/simulator-management/erase_sims.ts (1)
src/utils/typed-tool-factory.ts (1)
getSessionAwareToolSchemaShape(89-94)
src/mcp/tools/simulator-management/set_sim_location.ts (1)
src/utils/typed-tool-factory.ts (1)
getSessionAwareToolSchemaShape(89-94)
src/utils/typed-tool-factory.ts (2)
src/utils/environment.ts (1)
isSessionDefaultsSchemaOptOutEnabled(74-80)src/utils/errors.ts (1)
createErrorResponse(111-122)
src/mcp/tools/ui-testing/screenshot.ts (1)
src/utils/typed-tool-factory.ts (1)
getSessionAwareToolSchemaShape(89-94)
src/mcp/tools/simulator/build_sim.ts (1)
src/utils/typed-tool-factory.ts (1)
getSessionAwareToolSchemaShape(89-94)
src/mcp/tools/ui-testing/key_press.ts (1)
src/utils/typed-tool-factory.ts (1)
getSessionAwareToolSchemaShape(89-94)
src/mcp/tools/macos/get_mac_app_path.ts (1)
src/utils/typed-tool-factory.ts (1)
getSessionAwareToolSchemaShape(89-94)
src/mcp/tools/simulator/record_sim_video.ts (1)
src/utils/typed-tool-factory.ts (1)
getSessionAwareToolSchemaShape(89-94)
src/mcp/tools/ui-testing/key_sequence.ts (1)
src/utils/typed-tool-factory.ts (1)
getSessionAwareToolSchemaShape(89-94)
src/mcp/tools/ui-testing/long_press.ts (1)
src/utils/typed-tool-factory.ts (1)
getSessionAwareToolSchemaShape(89-94)
src/mcp/tools/simulator/launch_app_sim.ts (1)
src/utils/typed-tool-factory.ts (1)
getSessionAwareToolSchemaShape(89-94)
src/mcp/tools/macos/test_macos.ts (1)
src/utils/typed-tool-factory.ts (1)
getSessionAwareToolSchemaShape(89-94)
src/mcp/tools/device/install_app_device.ts (1)
src/utils/typed-tool-factory.ts (1)
getSessionAwareToolSchemaShape(89-94)
src/mcp/tools/logging/start_sim_log_cap.ts (1)
src/utils/typed-tool-factory.ts (1)
getSessionAwareToolSchemaShape(89-94)
src/mcp/tools/ui-testing/type_text.ts (1)
src/utils/typed-tool-factory.ts (1)
getSessionAwareToolSchemaShape(89-94)
src/mcp/tools/simulator/stop_app_sim.ts (1)
src/utils/typed-tool-factory.ts (1)
getSessionAwareToolSchemaShape(89-94)
src/mcp/tools/ui-testing/swipe.ts (1)
src/utils/typed-tool-factory.ts (1)
getSessionAwareToolSchemaShape(89-94)
src/mcp/tools/project-discovery/show_build_settings.ts (1)
src/utils/typed-tool-factory.ts (1)
getSessionAwareToolSchemaShape(89-94)
src/mcp/tools/simulator/install_app_sim.ts (1)
src/utils/typed-tool-factory.ts (1)
getSessionAwareToolSchemaShape(89-94)
src/mcp/tools/device/launch_app_device.ts (1)
src/utils/typed-tool-factory.ts (1)
getSessionAwareToolSchemaShape(89-94)
src/mcp/tools/ui-testing/gesture.ts (1)
src/utils/typed-tool-factory.ts (1)
getSessionAwareToolSchemaShape(89-94)
src/mcp/tools/ui-testing/touch.ts (1)
src/utils/typed-tool-factory.ts (1)
getSessionAwareToolSchemaShape(89-94)
src/mcp/tools/ui-testing/tap.ts (2)
src/utils/logger.ts (1)
log(142-162)src/utils/typed-tool-factory.ts (1)
getSessionAwareToolSchemaShape(89-94)
src/mcp/tools/device/stop_app_device.ts (1)
src/utils/typed-tool-factory.ts (1)
getSessionAwareToolSchemaShape(89-94)
src/mcp/tools/simulator-management/reset_sim_location.ts (1)
src/utils/typed-tool-factory.ts (1)
getSessionAwareToolSchemaShape(89-94)
src/mcp/tools/simulator/get_sim_app_path.ts (1)
src/utils/typed-tool-factory.ts (1)
getSessionAwareToolSchemaShape(89-94)
src/mcp/tools/macos/build_macos.ts (1)
src/utils/typed-tool-factory.ts (1)
getSessionAwareToolSchemaShape(89-94)
src/mcp/tools/device/test_device.ts (1)
src/utils/typed-tool-factory.ts (1)
getSessionAwareToolSchemaShape(89-94)
src/mcp/tools/simulator/launch_app_logs_sim.ts (1)
src/utils/typed-tool-factory.ts (1)
getSessionAwareToolSchemaShape(89-94)
src/mcp/tools/logging/start_device_log_cap.ts (1)
src/utils/typed-tool-factory.ts (1)
getSessionAwareToolSchemaShape(89-94)
src/mcp/tools/simulator/boot_sim.ts (1)
src/utils/typed-tool-factory.ts (1)
getSessionAwareToolSchemaShape(89-94)
src/mcp/tools/device/build_device.ts (1)
src/utils/typed-tool-factory.ts (1)
getSessionAwareToolSchemaShape(89-94)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Cursor Bugbot
🔇 Additional comments (77)
src/mcp/tools/session-management/session_set_defaults.ts (1)
51-56: Updated tool description is clear and consistent with schema behaviorThe new description accurately reflects how this tool is used, encourages batching defaults in a single call, and the example keys match the defined schema. No changes needed.
src/mcp/tools/utilities/clean.ts (2)
9-12: LGTM!The import correctly uses
.tsextension for internal imports and properly imports bothcreateSessionAwareToolandgetSessionAwareToolSchemaShapefrom the typed-tool-factory module.
162-165: LGTM!The schema is correctly updated to use
getSessionAwareToolSchemaShape, passingpublicSchemaObject(which omits session-managed fields likeprojectPath,workspacePath,scheme,configuration) as the session-aware schema, andbaseSchemaObject(full schema) as the legacy fallback. This aligns with the PR's session-aware opt-out pattern.example_projects/macOS/MCPTestTests/MCPTestTests.swift (1)
10-15: Test scaffolding looks good.The Swift Testing framework setup is correct. The placeholder test method is appropriate for establishing the test target infrastructure. Consider adding actual test cases when functionality is ready to be tested.
src/mcp/tools/ui-testing/touch.ts (2)
20-23: LGTM!Import correctly updated to include
getSessionAwareToolSchemaShapewith proper.tsextension for internal imports.
119-122: LGTM!Schema correctly updated to use
getSessionAwareToolSchemaShapewithpublicSchemaObject(omitssimulatorId) as the session-aware schema andtouchSchema(full schema) as the legacy fallback. This follows the established pattern across the codebase.src/mcp/tools/ui-testing/key_sequence.ts (2)
24-27: LGTM!Import correctly updated with
.tsextension, following coding guidelines for internal imports.
98-101: LGTM!Schema correctly updated to use
getSessionAwareToolSchemaShape, consistent with the pattern applied across other UI testing tools in this PR.example_projects/macOS/MCPTest.xcodeproj/xcshareddata/xcschemes/MCPTest.xcscheme (1)
32-44: LGTM!The Testables block correctly wires the new
MCPTestTeststarget into the scheme's TestAction. The configuration is appropriate withparallelizable="YES"for efficient test execution andskipped="NO"to include tests in the default test run.src/utils/typed-tool-factory.ts (6)
17-17: LGTM!Import correctly uses
.tsextension for the internalenvironment.tsmodule.
75-87: Clean error formatting abstraction.The
formatRequirementErrorhelper nicely centralizes the logic for generating context-aware error messages. When opt-out is enabled, it shows generic "Missing required parameters" without session-specific hints; otherwise, it includes the helpfulsetHintfor guiding users to set session defaults.
89-94: LGTM!The
getSessionAwareToolSchemaShapehelper is well-designed with proper generic constraints. It cleanly encapsulates the schema selection logic: returning the legacy schema's shape when opt-out is enabled, and the session-aware schema's shape otherwise. This enables consistent behavior across 40+ tool files.
157-165: LGTM!The
allOfrequirement error handling now correctly usesformatRequirementErrorto produce context-appropriate error messages based on the opt-out state.
174-179: LGTM!The
oneOfrequirement error handling is consistently updated to use the sameformatRequirementErrorpattern.
193-198: LGTM!The ZodError handling correctly suppresses the session defaults tip when opt-out is enabled, providing cleaner error messages in legacy mode.
src/mcp/tools/ui-testing/type_text.ts (1)
20-23: type_text schema correctly integrated with the session-aware helperThe new import and use of
getSessionAwareToolSchemaShape({ sessionAware: publicSchemaObject, legacy: typeTextSchema })keep this tool aligned with the global session-defaults behavior while preserving existing validation viatypeTextSchemain the handler. Thetyped-tool-factory.tsimport also respects the internal.tsimport guideline.Also applies to: 91-95
src/mcp/tools/project-discovery/list_schemes.ts (1)
14-17: Session-aware schema wrapper for list_schemes is consistent with the unified patternHooking the exported
schemathroughgetSessionAwareToolSchemaShape({ sessionAware: publicSchemaObject, legacy: baseSchemaObject })matches the pattern used elsewhere and should respect the global session-defaults opt-out without changing the existing XOR validations inlistSchemesSchema.Also applies to: 123-126
src/mcp/tools/ui-testing/swipe.ts (1)
19-22: swipe tool’s session-aware schema wiring looks correctUsing
getSessionAwareToolSchemaShapewithpublicSchemaObject(withoutsimulatorId) as the session-aware shape andswipeSchemaas the legacy shape cleanly aligns this tool with the session-defaults mechanism while leaving the coreswipeLogicand validation behavior intact.Also applies to: 129-132
src/mcp/tools/simulator/test_sim.ts (1)
17-20: test_sim schema export now follows the shared session-aware patternThe new
getSessionAwareToolSchemaShape({ sessionAware: publicSchemaObject, legacy: baseSchemaObject })usage mirrors other unified tools and should integrate cleanly with the global opt-out, while existing XOR rules andtest_simLogiccontinue to operate on the fulltestSimulatorSchema.Also applies to: 134-137
src/mcp/tools/simulator/stop_app_sim.ts (1)
7-10: stop_app_sim adopts the session-aware schema helper without changing semanticsThe schema now routed through
getSessionAwareToolSchemaShapecorrectly treats the simulator identifiers as session-managed fields (viapublicSchemaObject) while preserving the fullbaseSchemaObjectfor legacy/opt-out mode; the stop logic and XOR validation remain unaffected.Also applies to: 160-163
src/mcp/tools/ui-testing/long_press.ts (1)
25-28: long_press schema wiring is consistent with other session-aware UI toolsWrapping
publicSchemaObjectandlongPressSchemawithgetSessionAwareToolSchemaShapekeeps simulator identity session-managed by default while allowing a full legacy schema when opt-out is enabled, without impacting the existing long-press execution logic.Also applies to: 118-121
src/mcp/tools/simulator-management/sim_statusbar.ts (1)
5-8: sim_statusbar session-aware schema change looks goodThe new
getSessionAwareToolSchemaShapeusage correctly exposes a session-managed variant (withoutsimulatorId) by default while retaining the fullsimStatusbarSchemafor opt-out mode, and the updated import fromtyped-tool-factory.tscomplies with the internal.tsimport guideline.Also applies to: 100-103
src/mcp/tools/ui-testing/describe_ui.ts (2)
13-16: LGTM!Import correctly adds
getSessionAwareToolSchemaShapewith proper.tsextension for internal imports.
118-121: LGTM!Schema correctly configured with
publicSchemaObject(omittingsimulatorId) as the session-aware schema anddescribeUiSchema(full schema) as legacy fallback. This aligns with the session-aware opt-out pattern.src/mcp/tools/macos/test_macos.ts (2)
24-27: LGTM!Import correctly adds
getSessionAwareToolSchemaShapewith proper.tsextension.
332-335: LGTM!Schema correctly pairs
publicSchemaObject(omittingprojectPath,workspacePath,scheme,configuration) as session-aware withbaseSchemaObject(full schema) as legacy. Consistent with the project-wide session-aware schema pattern.src/mcp/tools/ui-testing/screenshot.ts (2)
16-19: LGTM!Import correctly adds
getSessionAwareToolSchemaShapewith proper.tsextension.
149-152: LGTM!Schema correctly configured with
publicSchemaObject(omittingsimulatorId) as session-aware andscreenshotSchema(full schema) as legacy fallback.src/mcp/tools/macos/build_run_macos.ts (2)
15-18: LGTM!Import correctly adds
getSessionAwareToolSchemaShapewith proper.tsextension.
222-225: LGTM!Schema correctly pairs
publicSchemaObject(omittingprojectPath,workspacePath,scheme,configuration,arch) as session-aware withbaseSchemaObject(full schema) as legacy. Consistent with the project-wide pattern.src/mcp/tools/simulator/install_app_sim.ts (2)
7-10: LGTM!Import correctly adds
getSessionAwareToolSchemaShapewith proper.tsextension.
102-105: LGTM!Schema correctly configured with
publicSchemaObject(omittingsimulatorId) as session-aware andinstallAppSimSchemaObject(full schema) as legacy fallback.src/mcp/tools/simulator/boot_sim.ts (2)
6-9: LGTM!Import correctly adds
getSessionAwareToolSchemaShapewith proper.tsextension.
74-77: LGTM!Schema correctly configured with
publicSchemaObject(omittingsimulatorId) as session-aware andbootSimSchemaObject(full schema) as legacy fallback. Pattern is consistent with other tools in this PR.src/mcp/tools/project-discovery/show_build_settings.ts (2)
14-17: LGTM!Import correctly updated to include
getSessionAwareToolSchemaShapealongsidecreateSessionAwareTool.
117-120: Session-aware schema correctly applied.The schema wrapper follows the established pattern. Note that
publicSchemaObjectomits all fields (projectPath,workspacePath,scheme), resulting in an empty schema for session-aware mode—this appears intentional given that all parameters would be provided via session defaults.src/mcp/tools/ui-testing/gesture.ts (2)
25-28: LGTM!Import correctly updated to include
getSessionAwareToolSchemaShape.
162-165: Session-aware schema correctly applied.The wrapper properly provides
publicSchemaObject(withoutsimulatorId) for session-aware mode and the fullgestureSchemafor legacy mode.src/mcp/tools/ui-testing/tap.ts (4)
13-16: LGTM!Import correctly updated to include
getSessionAwareToolSchemaShape.
92-94: Good improvement to error handling.Typing
errorasunknownand extracting the message before logging is proper TypeScript practice. This ensures type safety and consistent error message formatting.
118-121: Session-aware schema correctly applied.The wrapper properly provides
publicSchemaObject(withoutsimulatorId) for session-aware mode and the fulltapSchemafor legacy mode.
179-179: LGTM!Consistent with the error handling improvement in the outer function.
src/mcp/tools/ui-testing/key_press.ts (2)
18-21: LGTM!Import correctly updated to include
getSessionAwareToolSchemaShape.
90-93: Session-aware schema correctly applied.The wrapper properly provides
publicSchemaObject(withoutsimulatorId) for session-aware mode and the fullkeyPressSchemafor legacy mode.example_projects/macOS/MCPTest.xcodeproj/project.pbxproj (1)
375-416: InvalidMACOSX_DEPLOYMENT_TARGETwill break builds.The test target's
MACOSX_DEPLOYMENT_TARGET = 26.0is not a valid macOS version (macOS versions are like 14.x, 15.x). This appears to be auto-generated by an Xcode beta. The main target uses15.2which is correct.Additionally,
DEVELOPMENT_TEAM = BR6WD3M6ZDis a hardcoded personal team ID that should be cleared for example projects.Apply this diff to fix the build configuration:
8BCB4E2D2EF00E2600D60AD2 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = BR6WD3M6ZD; + DEVELOPMENT_TEAM = ""; GENERATE_INFOPLIST_FILE = YES; - MACOSX_DEPLOYMENT_TARGET = 26.0; + MACOSX_DEPLOYMENT_TARGET = 15.2;8BCB4E2E2EF00E2600D60AD2 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = BR6WD3M6ZD; + DEVELOPMENT_TEAM = ""; GENERATE_INFOPLIST_FILE = YES; - MACOSX_DEPLOYMENT_TARGET = 26.0; + MACOSX_DEPLOYMENT_TARGET = 15.2;⛔ Skipped due to learnings
Learnt from: CR Repo: cameroncooke/XcodeBuildMCP PR: 0 File: example_projects/iOS/.cursor/rules/errors.mdc:0-0 Timestamp: 2025-07-22T19:54:12.588Z Learning: Please don't fix any code errors unless reported by XcodeBuildMCP server tool responses.src/utils/__tests__/session-aware-tool-factory.test.ts (1)
101-119: LGTM! Well-structured opt-out test.The test properly verifies the opt-out behavior by setting the environment variable, asserting the correct error messaging, and cleaning up the environment state in a finally block. Good adherence to testing best practices.
README.md (1)
294-310: LGTM! Clear documentation of the opt-out feature.The section effectively explains the session-aware default behavior and the rationale (context bloat reduction), provides the opt-out mechanism, and includes a practical configuration example. The guidance is clear and helpful.
src/mcp/tools/macos/build_macos.ts (1)
14-17: LGTM! Consistent session-aware schema integration.The changes properly integrate the session-aware wrapper using the standard pattern, with correct import extensions and appropriate schema composition.
Also applies to: 104-107
src/mcp/tools/logging/start_sim_log_cap.ts (1)
11-14: LGTM! Consistent session-aware schema integration.The schema wrapper implementation follows the established pattern correctly, enabling session-aware behavior with proper fallback to legacy schema.
Also applies to: 67-70
src/mcp/tools/simulator-management/reset_sim_location.ts (1)
5-8: LGTM! Consistent session-aware schema integration.The implementation correctly adopts the session-aware schema wrapper pattern with appropriate schema composition.
Also applies to: 98-101
src/mcp/tools/simulator-management/set_sim_location.ts (1)
5-8: LGTM! Consistent session-aware schema integration.The changes properly integrate the session-aware wrapper following the established pattern.
Also applies to: 126-129
src/mcp/tools/simulator/record_sim_video.ts (1)
18-21: LGTM! Consistent session-aware schema integration.The schema wrapper implementation correctly follows the project-wide pattern for session-aware tooling.
Also applies to: 229-232
src/mcp/tools/simulator-management/erase_sims.ts (1)
5-8: LGTM! Consistent session-aware schema integration.The implementation properly adopts the session-aware schema wrapper, completing the consistent pattern across all reviewed tool files.
Also applies to: 89-92
src/mcp/tools/ui-testing/button.ts (1)
13-16: LGTM!The session-aware schema integration is correctly implemented. The import uses
.tsextension per coding guidelines, and the schema composition correctly mapspublicSchemaObject(omittingsimulatorId) for session-aware mode and the fullbuttonSchemafor legacy mode.Also applies to: 85-88
src/mcp/tools/macos/get_mac_app_path.ts (1)
13-16: LGTM!The session-aware schema wrapper is correctly integrated. The
publicSchemaObjectappropriately omits session-managed fields (projectPath,workspacePath,scheme,configuration,arch), while the legacy mode exposes the fullbaseSchemaObject.Also applies to: 194-197
src/mcp/tools/simulator/build_run_sim.ts (1)
13-16: LGTM!The session-aware schema integration correctly exposes only non-session-managed fields (
derivedDataPath,extraArgs,preferXcodebuild) in session-aware mode, while legacy mode retains the full schema including project paths and simulator identifiers.Also applies to: 509-512
src/mcp/tools/device/build_device.ts (1)
13-16: LGTM!The newly introduced
publicSchemaObjectand session-aware schema wrapper follow the established pattern. The public schema correctly omits session-managed fields while preserving optional build parameters (derivedDataPath,extraArgs,preferXcodebuild).Also applies to: 42-47, 77-80
src/mcp/tools/simulator-management/set_sim_appearance.ts (1)
5-8: LGTM!The session-aware schema wrapper is correctly applied. The
publicSchemaObjectexposes only themodeparameter in session-aware mode (sincesimulatorIdcomes from session defaults), while legacy mode exposes the complete schema.Also applies to: 98-101
src/mcp/tools/simulator/build_sim.ts (2)
15-18: LGTM!The import correctly includes
getSessionAwareToolSchemaShapealongsidecreateSessionAwareTool, and uses the.tsextension as per coding guidelines.
156-159: LGTM!The schema property now correctly uses the session-aware wrapper, allowing dynamic schema selection between the reduced
publicSchemaObject(session-aware mode) and fullbaseSchemaObject(legacy mode) based on the environment configuration.src/mcp/tools/simulator/launch_app_sim.ts (2)
7-10: LGTM!Import correctly updated with
.tsextension and includes bothcreateSessionAwareToolandgetSessionAwareToolSchemaShape.
206-209: LGTM!The session-aware schema wrapper is correctly applied, maintaining consistency with the pattern used across other tool files.
src/mcp/tools/simulator/launch_app_logs_sim.ts (2)
7-10: LGTM!Import correctly structured with
.tsextension.
73-76: LGTM!Session-aware schema wrapper correctly applied with
publicSchemaObjectas the reduced schema andlaunchAppLogsSimSchemaObjectas the legacy full schema.src/mcp/tools/device/get_device_app_path.ts (3)
14-17: LGTM!Import correctly updated with
.tsextension.
49-54: LGTM!The
publicSchemaObjectcorrectly omits session-managed fields (projectPath,workspacePath,scheme,configuration), leaving onlyplatformas the user-provided parameter in session-aware mode.
160-163: LGTM!Session-aware schema wrapper correctly applied, enabling dynamic schema selection.
src/mcp/tools/device/install_app_device.ts (3)
13-16: LGTM!Import correctly structured with
.tsextension as per coding guidelines.
29-30: LGTM!The
publicSchemaObjectcorrectly omits onlydeviceId(the session-managed field), preservingappPathas required user input.
91-94: LGTM!Session-aware schema wrapper correctly applied.
src/mcp/tools/device/launch_app_device.ts (3)
13-16: LGTM!Import correctly structured with
.tsextension.
38-39: LGTM!The
publicSchemaObjectcorrectly omitsdeviceId(session-managed), preservingbundleIdas required user input.
150-153: LGTM!Session-aware schema wrapper correctly applied, completing the consistent pattern across all device tools.
src/mcp/tools/device/stop_app_device.ts (1)
13-16: LGTM! Clean session-aware schema implementation.The session-aware schema pattern is correctly implemented:
publicSchemaObjectomitsdeviceIdfor session-aware modegetSessionAwareToolSchemaShapedynamically selects between session-aware and legacy schemas based on opt-out flag- Maintains backward compatibility while supporting session defaults
Also applies to: 27-27, 93-96
src/mcp/tools/simulator/get_sim_app_path.ts (1)
15-18: LGTM! Consistent session-aware schema integration.The implementation correctly wraps the existing
publicSchemaObjectwithgetSessionAwareToolSchemaShape, maintaining the pattern where session-aware mode omits fields that would be provided via session defaults (projectPath, workspacePath, scheme, simulatorId, simulatorName, configuration, useLatestOS, arch).Also applies to: 309-312
src/mcp/tools/logging/start_device_log_cap.ts (1)
17-20: LGTM! Session-aware pattern correctly applied.The changes follow the established pattern:
publicSchemaObjectomitsdeviceIdfor session-aware modegetSessionAwareToolSchemaShapeprovides runtime schema selection- Maintains backward compatibility with legacy mode
Also applies to: 638-638, 687-690
src/mcp/tools/device/test_device.ts (1)
24-27: LGTM! Well-implemented session-aware schema pattern.The implementation correctly:
- Creates
publicSchemaObjectomitting session-provided fields (projectPath, workspacePath, scheme, deviceId, configuration)- Uses
baseSchemaObjectas the legacy schema (before XOR validation)- Maintains internal use of
testDeviceSchemawith full validation in the handler- Follows the consistent pattern across all tools in this PR
Also applies to: 64-70, 290-292
commit: |
| CURRENT_PROJECT_VERSION = 1; | ||
| DEVELOPMENT_TEAM = BR6WD3M6ZD; | ||
| GENERATE_INFOPLIST_FILE = YES; | ||
| MACOSX_DEPLOYMENT_TARGET = 26.0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Example project test target requires non-existent macOS 26
The newly added MCPTestTests test target has MACOSX_DEPLOYMENT_TARGET = 26.0 in both Debug and Release configurations. macOS 26.0 doesn't exist - current macOS versions are around 14-15 (Sonoma/Sequoia). The main app target correctly uses 15.2. This configuration will prevent anyone from building the example project's test target on any real macOS system, as the specified deployment target is invalid.
Additional Locations (1)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact macOS 26 does exist it's just before your training data cut-off, it was released in July 2025, apple decided to rebrand to use years so in 2025 Apple released macOS 26, in 2026 they will release macOS 27 and so on.
Summary
Testing
Note
Introduce env-driven opt-out of session-aware schemas and roll it out across all tools, with updated validation/messages, docs, and example macOS test target.
isSessionDefaultsSchemaOptOutEnabledandgetSessionAwareToolSchemaShape; updatecreateSessionAwareToolto switch schemas and adjust errors whenXCODEBUILDMCP_DISABLE_SESSION_DEFAULTSis set.scheme, project/workspace XOR; simulator/device IDs).session-set-defaultsdescription to encourage setting all defaults in one call.session-set-defaultsdescription.Written by Cursor Bugbot for commit 2086d3c. This will update automatically on new commits. Configure here.
Summary by CodeRabbit
New Features
XCODEBUILDMCP_DISABLE_SESSION_DEFAULTSenvironment variable to restore per-call parameter requirements when neededTesting
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.