Skip to content

perf(xcode-ide): switch MCP to gateway tools and unblock handshake#223

Open
cameroncooke wants to merge 3 commits intomainfrom
codex/xcode-ide-gateway-handshake
Open

perf(xcode-ide): switch MCP to gateway tools and unblock handshake#223
cameroncooke wants to merge 3 commits intomainfrom
codex/xcode-ide-gateway-handshake

Conversation

@cameroncooke
Copy link
Collaborator

Switches MCP xcode-ide integration from startup-time proxied tool merging to manifest-managed gateway tools, so server initialization no longer blocks on Xcode bridge tool discovery.

This change keeps runtime manifest loading intact, keeps CLI xcode-ide behavior unchanged, and introduces two MCP tools in the xcode-ide workflow:

  • xcode_ide_list_tools
  • xcode_ide_call_tool

Both tools are predicate-gated with xcodeToolsAvailable (same pattern as existing bridge debug tools), and execute bridge list/call at tool runtime with bounded timeout/error normalization instead of during MCP bootstrap.

To reduce handshake latency further without feature loss, bootstrap also defers non-contract-critical work (Xcode state watcher/sync and Sentry shell-heavy enrichment) until after connect. Startup profiling instrumentation and before/after reports were added, with docs/changelog/test updates reflecting the new MCP contract.

Alternatives considered:

  • Keep startup-time bridge tools/list merge: rejected because it can hang/fail handshake on Xcode approval/connect latency.
  • Aggressive startup timeout race for merge: rejected as nondeterministic and likely to hide proxied tools for many users.

Refs #210

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 13, 2026

Open in StackBlitz

npm i https://pkg.pr.new/getsentry/XcodeBuildMCP/xcodebuildmcp@223

commit: cdd4141

@cameroncooke cameroncooke marked this pull request as ready for review February 13, 2026 22:26
return 'XCODE_SESSION_NOT_READY';
}
return 'XCODE_MCP_UNAVAILABLE';
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicated classifyBridgeError logic across two classes

Low Severity

The classifyBridgeError private method is nearly identical in StandaloneXcodeToolsBridge and XcodeToolsBridgeManager (~25 lines each). The only difference is the manager additionally checks clientStatus.connected for timeout sub-classification. This duplication increases the risk of inconsistent bug fixes to error classification logic. A shared utility function accepting an optional connection-status flag would eliminate the redundancy.

Additional Locations (1)

Fix in Cursor Fix in Web

const clientMocks = {
connectOnce: vi.fn(),
listTools: vi.fn(),
callTool: vi.fn(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New test code uses banned Vitest mocking utilities

Medium Severity

The new test lines add callTool: vi.fn(), clientMocks.callTool.mockReset(), and clientMocks.callTool.mockResolvedValue(...), extending the use of banned Vitest mocking utilities (vi.fn, .mock*). The project testing rules require dependency injection via createMockExecutor / createMockFileSystemExecutor patterns rather than Vitest module mocking.

Additional Locations (2)

Fix in Cursor Fix in Web

Triggered by project rule: Bugbot Review Guide for XcodeBuildMCP

cameroncooke and others added 3 commits February 14, 2026 00:06
Add manifest-managed xcode_ide_list_tools and xcode_ide_call_tool for MCP xcode-ide access. Keep runtime manifest loading and CLI xcode-ide behavior unchanged.

Remove handshake-time bridge tool sync from MCP startup and defer non-critical Xcode state and Sentry enrichment work until after connect to reduce startup latency.

Include before/after profiling reports and startup stage instrumentation to measure handshake-path costs and validate improvements.

Fixes #210

Co-Authored-By: Claude <noreply@anthropic.com>
Ignore the .claude directory and remove tracked .claude files from the repository index so local agent config is no longer versioned.

Refs #210

Co-Authored-By: Claude <noreply@anthropic.com>
@cameroncooke cameroncooke force-pushed the codex/xcode-ide-gateway-handshake branch from edc2527 to cdd4141 Compare February 14, 2026 00:07
Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

const result = await callHandler({ remoteTool: 'toolA', arguments: { foo: 'bar' } });
expect(result.isError).toBe(false);
expect(clientMocks.callTool).toHaveBeenCalledWith('toolA', { foo: 'bar' }, {});
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New gateway tools lack failure path tests

Low Severity

The new xcode_ide_list_tools and xcode_ide_call_tool tools only have happy-path tests. No tests cover bridge failures (e.g., listTools or callTool throwing), unavailable bridge, or timeout scenarios. The project testing checklist requires each tool to have at least one failure-path test.

Fix in Cursor Fix in Web

Triggered by project rule: Bugbot Review Guide for XcodeBuildMCP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant