Skip to content

Commit fab835d

Browse files
cameroncookeclaude
andcommitted
perf(xcode-ide): Add gateway tools and unblock MCP handshake
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>
1 parent 57ecc7f commit fab835d

26 files changed

Lines changed: 531 additions & 134 deletions

CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Changelog
22

3+
## [Unreleased]
4+
5+
### Changed
6+
7+
- Changed MCP `xcode-ide` integration to expose manifest-managed gateway tools (`xcode_ide_list_tools`, `xcode_ide_call_tool`) while keeping CLI dynamic `xcode_tools_*` behavior unchanged ([#210](https://github.com/getsentry/XcodeBuildMCP/issues/210))
8+
- Deferred non-critical Xcode IDE state synchronization and Sentry enrichment work until after MCP connect to reduce handshake-path latency ([#210](https://github.com/getsentry/XcodeBuildMCP/issues/210))
9+
10+
### Fixed
11+
12+
- Removed startup dependency on handshake-time Xcode bridge `tools/list` sync for MCP tool registration, preventing bridge list latency from delaying initial connect ([#210](https://github.com/getsentry/XcodeBuildMCP/issues/210))
13+
314
## [2.0.7]
415

516
### Changed
@@ -273,4 +284,3 @@ Please note that the UI automation features are an early preview and currently i
273284
- Initial release of XcodeBuildMCP
274285
- Basic support for building iOS and macOS applications
275286

276-

docs/CONFIGURATION.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ enabledWorkflows: ["simulator", "ui-automation", "debugging"]
147147

148148
See [TOOLS.md](TOOLS.md) for available workflows and their tools.
149149

150-
To proxy Xcode IDE tools (Xcode 26+ `xcrun mcpbridge`), enable `xcode-ide`. See [XCODE_IDE_MCPBRIDGE.md](XCODE_IDE_MCPBRIDGE.md).
150+
To access Xcode IDE tools (Xcode 26+ `xcrun mcpbridge`), enable `xcode-ide`. This workflow exposes `xcode_ide_list_tools` and `xcode_ide_call_tool` for MCP clients. See [XCODE_IDE_MCPBRIDGE.md](XCODE_IDE_MCPBRIDGE.md).
151151

152152
### Experimental workflow discovery
153153

docs/TOOLS-CLI.md

Lines changed: 7 additions & 5 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 71 canonical tools organized into 13 workflow groups.
5+
XcodeBuildMCP provides 73 canonical tools organized into 13 workflow groups.
66

77
## Workflow Groups
88

@@ -171,20 +171,22 @@ XcodeBuildMCP provides 71 canonical tools organized into 13 workflow groups.
171171

172172

173173
### Xcode IDE Integration (`xcode-ide`)
174-
**Purpose**: Bridge tools for connecting to Xcode's built-in MCP server (mcpbridge) to access IDE-specific functionality. (3 tools)
174+
**Purpose**: Bridge tools for connecting to Xcode's built-in MCP server (mcpbridge) to access IDE-specific functionality. (5 tools)
175175

176176
- `bridge-disconnect` - Disconnect bridge and unregister proxied `xcode_tools_*` tools.
177177
- `bridge-status` - Show xcrun mcpbridge availability and proxy tool sync status.
178178
- `bridge-sync` - One-shot connect + tools/list sync (manual retry; avoids background prompt spam).
179+
- `xcode-ide-call-tool` - Call a remote Xcode IDE MCP tool through mcpbridge.
180+
- `xcode-ide-list-tools` - List remote Xcode IDE MCP tools available through mcpbridge.
179181

180182

181183

182184
## Summary Statistics
183185

184-
- **Canonical Tools**: 71
185-
- **Total Tools**: 95
186+
- **Canonical Tools**: 73
187+
- **Total Tools**: 97
186188
- **Workflow Groups**: 13
187189

188190
---
189191

190-
*This documentation is automatically generated by `scripts/update-tools-docs.ts` from the tools manifest. Last updated: 2026-02-08T12:09:33.648Z UTC*
192+
*This documentation is automatically generated by `scripts/update-tools-docs.ts` from the tools manifest. Last updated: 2026-02-13T23:22:09.102Z UTC*

docs/TOOLS.md

Lines changed: 7 additions & 5 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 76 canonical tools organized into 15 workflow groups for comprehensive Apple development workflows.
3+
This document lists MCP tool names as exposed to MCP clients. XcodeBuildMCP provides 78 canonical tools organized into 15 workflow groups for comprehensive Apple development workflows.
44

55
## Workflow Groups
66

@@ -186,8 +186,10 @@ This document lists MCP tool names as exposed to MCP clients. XcodeBuildMCP prov
186186

187187

188188
### Xcode IDE Integration (`xcode-ide`)
189-
**Purpose**: Bridge tools for connecting to Xcode's built-in MCP server (mcpbridge) to access IDE-specific functionality. (3 tools)
189+
**Purpose**: Bridge tools for connecting to Xcode's built-in MCP server (mcpbridge) to access IDE-specific functionality. (5 tools)
190190

191+
- `xcode_ide_call_tool` - Call a remote Xcode IDE MCP tool through mcpbridge.
192+
- `xcode_ide_list_tools` - List remote Xcode IDE MCP tools available through mcpbridge.
191193
- `xcode_tools_bridge_disconnect` - Disconnect bridge and unregister proxied `xcode_tools_*` tools.
192194
- `xcode_tools_bridge_status` - Show xcrun mcpbridge availability and proxy tool sync status.
193195
- `xcode_tools_bridge_sync` - One-shot connect + tools/list sync (manual retry; avoids background prompt spam).
@@ -196,10 +198,10 @@ This document lists MCP tool names as exposed to MCP clients. XcodeBuildMCP prov
196198

197199
## Summary Statistics
198200

199-
- **Canonical Tools**: 76
200-
- **Total Tools**: 100
201+
- **Canonical Tools**: 78
202+
- **Total Tools**: 102
201203
- **Workflow Groups**: 15
202204

203205
---
204206

205-
*This documentation is automatically generated by `scripts/update-tools-docs.ts` from the tools manifest. Last updated: 2026-02-08T12:09:33.648Z UTC*
207+
*This documentation is automatically generated by `scripts/update-tools-docs.ts` from the tools manifest. Last updated: 2026-02-13T23:22:09.102Z UTC*

docs/XCODE_IDE_MCPBRIDGE.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,16 @@ enabledWorkflows: ["simulator", "debugging", "xcode-ide"]
1515
1616
If the workflow is not enabled, XcodeBuildMCP does not start the bridge.
1717
18-
## Tool naming
18+
## MCP tools in `xcode-ide` workflow
1919

20-
Proxied tools are registered dynamically, based on whatever Xcode advertises via `tools/list`:
20+
When `xcode-ide` is enabled and `mcpbridge` is available, XcodeBuildMCP exposes two gateway tools:
2121

22-
- Remote: `XcodeListWindows`
23-
- Local proxy: `xcode_tools_XcodeListWindows`
22+
- `xcode_ide_list_tools`: Lists remote tools from Xcode's MCP server (name, description, schemas).
23+
- `xcode_ide_call_tool`: Calls a remote Xcode tool by name with a JSON argument payload.
24+
25+
These tools are stable and manifest-managed. They are shown only when `mcpbridge` is available.
26+
27+
CLI behavior is unchanged and continues to use dynamic `xcode_tools_*` proxy naming.
2428

2529
## Bridge debug tools
2630

@@ -38,7 +42,7 @@ Recommended flow:
3842

3943
1. Launch Xcode.
4044
2. Start XcodeBuildMCP with `xcode-ide` enabled.
41-
3. If you don’t see any `xcode_tools_*` tools, temporarily set `debug: true` and call `xcode_tools_bridge_sync` after approving any prompts.
45+
3. If `xcode_ide_list_tools` fails, temporarily set `debug: true` and call `xcode_tools_bridge_status` to inspect bridge health, then retry after approving prompts.
4246

4347
## Targeting a specific Xcode instance (optional)
4448

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
id: xcode_ide_call_tool
2+
module: mcp/tools/xcode-ide/xcode_ide_call_tool
3+
names:
4+
mcp: xcode_ide_call_tool
5+
cli: xcode-ide-call-tool
6+
description: Call a remote Xcode IDE MCP tool through mcpbridge.
7+
predicates:
8+
- mcpRuntimeOnly
9+
annotations:
10+
title: Call Xcode IDE Tool
11+
readOnlyHint: false
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
id: xcode_ide_list_tools
2+
module: mcp/tools/xcode-ide/xcode_ide_list_tools
3+
names:
4+
mcp: xcode_ide_list_tools
5+
cli: xcode-ide-list-tools
6+
description: List remote Xcode IDE MCP tools available through mcpbridge.
7+
predicates:
8+
- mcpRuntimeOnly
9+
annotations:
10+
title: List Xcode IDE Tools
11+
readOnlyHint: true

manifests/workflows/xcode-ide.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ description: Bridge tools for connecting to Xcode's built-in MCP server (mcpbrid
44
availability:
55
cli: false
66
predicates:
7-
- xcodeToolsAvailable
87
- hideWhenXcodeAgentMode
98
tools:
9+
- xcode_ide_list_tools
10+
- xcode_ide_call_tool
1011
- xcode_tools_bridge_status
1112
- xcode_tools_bridge_sync
1213
- xcode_tools_bridge_disconnect

src/cli.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ async function main(): Promise<void> {
6363
excludeWorkflows: ['session-management', 'workflow-discovery'],
6464
});
6565
const topLevelCommand = findTopLevelCommand(process.argv.slice(2));
66-
const discoveryMode =
67-
topLevelCommand === 'xcode-ide' || topLevelCommand === 'tools' ? 'quick' : 'none';
66+
const discoveryMode = topLevelCommand === 'xcode-ide' ? 'quick' : 'none';
6867

6968
// CLI uses a manifest-resolved catalog plus daemon-backed xcode-ide dynamic tools.
7069
const catalog = await buildCliToolCatalog({

src/cli/cli-tool-catalog.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ function createCliXcodeProxyTool(remoteTool: DynamicBridgeTool): ToolDefinition
8585
const cliSchema = jsonSchemaToToolSchemaShape(remoteTool.inputSchema);
8686

8787
return {
88-
cliName: `xcode-ide-${toKebabCase(remoteTool.name)}`,
88+
cliName: toKebabCase(remoteTool.name),
8989
mcpName: toLocalToolName(remoteTool.name),
9090
workflow: 'xcode-ide',
9191
description: remoteTool.description ?? '',

0 commit comments

Comments
 (0)