Skip to content

Commit d6ac9df

Browse files
committed
Remove tool filtering and update docs
1 parent 632cb66 commit d6ac9df

13 files changed

Lines changed: 479 additions & 4389 deletions

README.md

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ A Model Context Protocol (MCP) server that provides Xcode-related tools for inte
2020
- [Getting started](#getting-started)
2121
- [Prerequisites](#prerequisites)
2222
- [Configure your MCP client](#configure-your-mcp-client)
23-
- [MCP Feature Compatibility](#mcp-feature-compatibility)
2423
- [Quick install](#quick-install)
2524
- [Manual installation](#manual-installation)
2625
- [Alternative installation method using mise](#alternative-installation-method-using-mise)
2726
- [Installing via Smithery](#installing-via-smithery)
27+
- [MCP Compatibility](#mcp-compatibility)
2828
- [Incremental build support](#incremental-build-support)
2929
- [Code Signing for Device Deployment](#code-signing-for-device-deployment)
3030
- [Troubleshooting](#troubleshooting)
@@ -97,11 +97,9 @@ The XcodeBuildMCP server provides the following tool capabilities:
9797

9898
### MCP Resources
9999

100-
For clients that support MCP resources (VS Code, Claude Code, Claude Desktop), XcodeBuildMCP provides efficient URI-based data access:
100+
For clients that support MCP resources XcodeBuildMCP provides efficient URI-based data access:
101101

102-
- **Simulators Resource** (`mcp://xcodebuild/simulators`): Direct access to available iOS simulators with UUIDs and states
103-
- **Automatic Fallback**: Clients without resource support automatically use equivalent tool-based APIs
104-
- **Smart Filtering**: Redundant tools are filtered out when resources are available to prevent duplicate functionality
102+
- **Simulators Resource** (`xcodebuildmcp://simulators`): Direct access to available iOS simulators with UUIDs and states
105103

106104
> [!IMPORTANT]
107105
> Please note that XcodeBuildMCP will request xcodebuild to skip macro validation. This is to avoid errors when building projects that use Swift Macros.
@@ -116,24 +114,6 @@ For clients that support MCP resources (VS Code, Claude Code, Claude Desktop), X
116114

117115
### Configure your MCP client
118116

119-
#### MCP Feature Compatibility
120-
121-
XcodeBuildMCP supports both MCP tools and resources. Different editors have varying levels of MCP feature support:
122-
123-
| Editor | Tools | Resources | Notes |
124-
|--------|-------|-----------|-------|
125-
| **VS Code** ||| Full MCP specification support |
126-
| **Cursor** ||| Tools only - resources not supported |
127-
| **Windsurf** ||| Tools and discovery only |
128-
| **Claude Code** ||| Full support for resources, tools, and routes |
129-
| **Claude Desktop** ||| Full support for resources, tools, and prompts |
130-
131-
**Resources vs Tools:**
132-
- **Tools**: Function-based API calls (e.g., `list_sims()` to get simulator list)
133-
- **Resources**: Efficient data access via URIs (e.g., `mcp://xcodebuild/simulators` for simulator data)
134-
135-
XcodeBuildMCP automatically detects your client's capabilities and provides the most appropriate interface. Clients with resource support get efficient URI-based data access, while others fall back to traditional tool calls.
136-
137117
#### Quick install
138118

139119
For a quick install, you can use the following links:
@@ -201,6 +181,18 @@ To install XcodeBuildMCP Server for Claude Desktop automatically via [Smithery](
201181
npx -y @smithery/cli install @cameroncooke/XcodeBuildMCP --client claude
202182
```
203183

184+
#### MCP Compatibility
185+
186+
XcodeBuildMCP supports both MCP tools, resources and sampling. At time of writing the following editors have varying levels of MCP feature support:
187+
188+
| Editor | Tools | Resources | Samplng |
189+
|--------|-------|-----------|---------|
190+
| **VS Code** ||||
191+
| **Cursor** ||||
192+
| **Windsurf** ||||
193+
| **Claude Code** ||||
194+
| **Claude Desktop** ||||
195+
204196
## Incremental build support
205197

206198
XcodeBuildMCP includes experimental support for incremental builds. This feature is disabled by default and can be enabled by setting the `INCREMENTAL_BUILDS_ENABLED` environment variable to `true`:

docs/ARCHITECTURE.md

Lines changed: 50 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,26 @@ XcodeBuildMCP is a Model Context Protocol (MCP) server that exposes Xcode operat
3030

3131
```
3232
┌────────────────────────────────────────────────────────────┐
33-
│ Presentation / Transport Layer
33+
│ Presentation / Transport Layer │
3434
│ • src/server/server.ts – MCP server creation & transport │
3535
│ • src/index.ts – process entry, Sentry boot, │
36-
│ plugin loading, lifecycle
36+
│ plugin loading, lifecycle │
3737
└────────────────────────────────────────────────────────────┘
3838
┌────────────────────────────────────────────────────────────┐
3939
│ Plugin Discovery & Registration Layer │
4040
│ • src/core/plugin-registry.ts – automatic plugin loading │
41-
│ • src/core/plugin-types.ts – plugin type definitions │
42-
│ • plugins/**/ – self-contained plugins
41+
│ • src/core/plugin-types.ts – plugin type definitions
42+
│ • plugins/**/ – self-contained plugins │
4343
└────────────────────────────────────────────────────────────┘
4444
┌────────────────────────────────────────────────────────────┐
4545
│ MCP Resources Layer │
4646
│ • src/core/resources.ts – resource management │
4747
│ • src/resources/**/ – MCP resource handlers │
48-
│ • Client capability detection – automatic tool filtering │
4948
└────────────────────────────────────────────────────────────┘
5049
┌────────────────────────────────────────────────────────────┐
5150
│ Plugin Implementation Layer │
52-
│ • plugins/**/**.js – one file per tool capability │
53-
│ • Common patterns:
51+
│ • plugins/**/**.js – one file per tool capability
52+
│ • Common patterns: │
5453
│ – Standardized plugin exports (name, schema, handler) │
5554
│ – Zod schemas for param validation │
5655
│ – Uniform ToolResponse payloads │
@@ -259,29 +258,56 @@ export function supportsResources(server?: unknown): boolean {
259258
}
260259
```
261260

262-
#### Smart Tool Filtering
263-
264-
When resources are available, redundant tools are automatically filtered:
265-
266-
- **Resource-supported clients**: Get `mcp://xcodebuild/simulators` resource
267-
- **Tool-only clients**: Keep `list_sims` tool for compatibility
268-
- **Automatic detection**: No client configuration required
269-
270261
#### Resource Implementation Pattern
271262

272-
Resources reuse existing tool logic for consistency:
263+
Resources can reuse existing tool logic for consistency:
273264

274265
```typescript
275-
// src/resources/simulators.ts
266+
// src/resources/some_resource.ts
276267
export default {
277-
uri: 'mcp://xcodebuild/simulators',
278-
description: 'Available iOS simulators with UUIDs and states',
268+
uri: 'xcodebuildmcp://some_resource',
269+
name: 'some_resource',
270+
description: 'Returns some resource information',
279271
mimeType: 'text/plain',
280-
async handler(executor = getDefaultCommandExecutor()) {
281-
// Reuses list_simsLogic for consistency
282-
const result = await list_simsLogic({}, executor);
283-
return { contents: [{ type: 'text', text: result.content[0].text }] };
284-
}
272+
async handler(
273+
uri: URL,
274+
executor: CommandExecutor = getDefaultCommandExecutor(),
275+
): Promise<{ contents: Array<{ text: string }> }> {
276+
try {
277+
log('info', 'Processing simulators resource request');
278+
279+
const result = await getSomeResource({}, executor);
280+
281+
if (result.isError) {
282+
const errorText = result.content[0]?.text;
283+
throw new Error(
284+
typeof errorText === 'string' ? errorText : 'Failed to retrieve some resource data',
285+
);
286+
}
287+
288+
return {
289+
contents: [
290+
{
291+
text:
292+
typeof result.content[0]?.text === 'string'
293+
? result.content[0].text
294+
: 'No data for that resource is available',
295+
},
296+
],
297+
};
298+
} catch (error) {
299+
const errorMessage = error instanceof Error ? error.message : String(error);
300+
log('error', `Error in some_resource resource handler: ${errorMessage}`);
301+
302+
return {
303+
contents: [
304+
{
305+
text: `Error retrieving resource data: ${errorMessage}`,
306+
},
307+
],
308+
};
309+
}
310+
},
285311
};
286312
```
287313

0 commit comments

Comments
 (0)