Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 21 additions & 18 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ body:
attributes:
value: |
Thanks for taking the time to report an issue with XcodeBuildMCP!

- type: textarea
id: description
attributes:
Expand All @@ -21,20 +21,23 @@ body:
id: debug
attributes:
label: Debug Output
description: Output from the diagnostic tool, run `mise x npm:xcodebuildmcp@1.3.5 -- xcodebuildmcp-diagnostic` in your terminal (replacing the @ version with the version number you're using) and paste the output here
description: Ask your agent "Run the XcodeBuildMCP `doctor` tool and return the output as markdown verbatim" and then copy paste it here.
placeholder: |
```
Running XcodeBuildMCP Diagnostic Tool (v1.3.5)...
Collecting system information and checking dependencies...

[2025-05-07T10:06:22.737Z] [INFO] [Diagnostic]: Running diagnostic tool
# XcodeBuildMCP Diagnostic Report

XcodeBuildMCP Doctor

Generated: 2025-08-11T17:42:29.812Z
Server Version: 1.11.2

## System Information
- platform: darwin
- release: 25.0.0
- arch: arm64
...
```
```
validations:
required: true
required: true

- type: input
id: editor-client
attributes:
Expand All @@ -43,7 +46,7 @@ body:
placeholder: Cursor 0.49.1
validations:
required: true

- type: input
id: mcp-server-version
attributes:
Expand All @@ -52,7 +55,7 @@ body:
placeholder: 1.2.2
validations:
required: true

- type: input
id: llm
attributes:
Expand All @@ -61,7 +64,7 @@ body:
placeholder: Claude 3.5 Sonnet
validations:
required: true

- type: textarea
id: mcp-config
attributes:
Expand All @@ -76,7 +79,7 @@ body:
}
```
render: json

- type: textarea
id: steps
attributes:
Expand All @@ -88,7 +91,7 @@ body:
3. What failed or didn't work as expected
validations:
required: true

- type: textarea
id: expected
attributes:
Expand All @@ -97,7 +100,7 @@ body:
placeholder: The AI should have been able to...
validations:
required: true

- type: textarea
id: actual
attributes:
Expand All @@ -106,7 +109,7 @@ body:
placeholder: Instead, the AI...
validations:
required: true

- type: textarea
id: error
attributes:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/claude.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
assignee_trigger: "claude-bot"

# Optional: Allow Claude to run specific commands
allowed_tools: "Bash(npm install),Bash(npm run build:*),Bash(npm run test:*),Bash(npm run lint:*),Bash(npm run format:*),Bash(npm run diagnostic)"
allowed_tools: "Bash(npm install),Bash(npm run build:*),Bash(npm run test:*),Bash(npm run lint:*),Bash(npm run format:*),Bash(npm run doctor)"

# Optional: Add custom instructions for Claude to customize its behavior for your project
# custom_instructions: |
Expand Down
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,9 @@
"[jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"chat.mcp.serverSampling": {
"XcodeBuildMCP/.vscode/mcp.json: XcodeBuildMCP-Dev": {
"allowedDuringChat": true
}
},
}
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
}
},
{
"label": "build: dev diagnostics",
"label": "build: dev doctor",
"dependsOn": [
"lint",
"typecheck (watch)"
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ npm run format:check # Prettier code checking
npm run format # Prettier code formatting
npm run typecheck # TypeScript type checking
npm run inspect # Run interactive MCP protocol inspector
npm run diagnostic # Diagnostic CLI
npm run doctor # Doctor CLI
```

### Development with Reloaderoo
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ A Model Context Protocol (MCP) server that provides Xcode-related tools for inte
- [Client Compatibility](#client-compatibility)
- [Code Signing for Device Deployment](#code-signing-for-device-deployment)
- [Troubleshooting](#troubleshooting)
- [Diagnostic Tool](#diagnostic-tool)
- [Doctor Tool](#doctor-tool)
- [Privacy](#privacy)
- [What is sent to Sentry?](#what-is-sent-to-sentry)
- [Opting Out of Sentry](#opting-out-of-sentry)
Expand Down Expand Up @@ -105,7 +105,7 @@ For clients that support MCP resources XcodeBuildMCP provides efficient URI-base

- **Simulators Resource** (`xcodebuildmcp://simulators`): Direct access to available iOS simulators with UUIDs and states
- **Devices Resource** (`xcodebuildmcp://devices`): Direct access to connected physical Apple devices with UDIDs and states
- **Environment Resource** (`xcodebuildmcp://environment`): Direct access to environment information such as Xcode version, macOS version, and Node.js version
- **Doctor Resource** (`xcodebuildmcp://doctor`): Direct access to environment information such as Xcode version, macOS version, and Node.js version

## Getting started

Expand Down Expand Up @@ -294,26 +294,26 @@ For device deployment features to work, code signing must be properly configured

## Troubleshooting

If you encounter issues with XcodeBuildMCP, the diagnostic tool can help identify the problem by providing detailed information about your environment and dependencies.
If you encounter issues with XcodeBuildMCP, the doctor tool can help identify the problem by providing detailed information about your environment and dependencies.

### Diagnostic Tool
### Doctor Tool

The diagnostic tool is a standalone utility that checks your system configuration and reports on the status of all dependencies required by XcodeBuildMCP. It's particularly useful when reporting issues.
The doctor tool is a standalone utility that checks your system configuration and reports on the status of all dependencies required by XcodeBuildMCP. It's particularly useful when reporting issues.

```bash
# Run the diagnostic tool using npx
npx --package xcodebuildmcp@latest xcodebuildmcp-diagnostic
# Run the doctor tool using npx
npx --package xcodebuildmcp@latest xcodebuildmcp-doctor
```

The diagnostic tool will output comprehensive information about:
The doctor tool will output comprehensive information about:

- System and Node.js environment
- Xcode installation and configuration
- Required dependencies (xcodebuild, AXe, etc.)
- Environment variables affecting XcodeBuildMCP
- Feature availability status

When reporting issues on GitHub, please include the full output from the diagnostic tool to help with troubleshooting.
When reporting issues on GitHub, please include the full output from the doctor tool to help with troubleshooting.

## Privacy

Expand Down
13 changes: 6 additions & 7 deletions docs/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ XcodeBuildMCP is a Model Context Protocol (MCP) server that exposes Xcode operat

### High-Level Objectives

- Expose Xcode-related tools (build, test, deploy, diagnostics, UI automation) through MCP
- Expose Xcode-related tools (build, test, deploy, UI automation, etc.) through MCP
- Run as a long-lived stdio-based server for LLM agents, CLIs, or editors
- Enable fine-grained, opt-in activation of individual tools or tool groups
- Support incremental builds via experimental xcodemake with xcodebuild fallback
Expand Down Expand Up @@ -97,8 +97,8 @@ Main server entry point responsible for:
- Process lifecycle management (SIGTERM, SIGINT)
- Error handling and logging

#### `src/diagnostic-cli.ts`
Standalone diagnostic tool for:
#### `src/doctor-cli.ts`
Standalone doctor tool for:
- Environment validation
- Dependency checking
- Configuration verification
Expand Down Expand Up @@ -370,7 +370,7 @@ describe('Tool Name', () => {
- Compiles TypeScript with tsup

2. **Build Configuration** (`tsup.config.ts`)
- Entry points: `index.ts`, `diagnostic-cli.ts`
- Entry points: `index.ts`, `doctor-cli.ts`
- Output format: ESM
- Target: Node 18+
- Source maps enabled
Expand All @@ -379,7 +379,7 @@ describe('Tool Name', () => {
```
build/
├── index.js # Main server executable
├── diagnostic-cli.js # Diagnostic tool
├── doctor-cli.js # Doctor tool
└── *.js.map # Source maps
```

Expand All @@ -388,7 +388,7 @@ describe('Tool Name', () => {
- **Name**: `xcodebuildmcp`
- **Executables**:
- `xcodebuildmcp` → Main server
- `xcodebuildmcp-diagnostic` → Diagnostic tool
- `xcodebuildmcp-doctor` → Doctor tool
- **Dependencies**: Minimal runtime dependencies
- **Platform**: macOS only (due to Xcode requirement)

Expand Down Expand Up @@ -439,7 +439,6 @@ The guide covers:
1. **Use Tool Groups**: Enable only needed workflows
2. **Enable Incremental Builds**: Set `INCREMENTAL_BUILDS_ENABLED=true`
3. **Limit Log Capture**: Use structured logging when possible
4. **Profile Performance**: Use diagnostic tool for bottleneck identification

## Security Considerations

Expand Down
18 changes: 7 additions & 11 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,19 +195,15 @@ XCODEBUILDMCP_DYNAMIC_TOOLS=true reloaderoo inspect mcp -- node build/index.js
- **Dynamic Mode**: Only 1 tool (`discover_tools`) available initially
- **Dynamic Discovery**: After calling `discover_tools`, additional workflow tools become available

#### Using the diagnostic tool
#### Using XcodeBuildMCP doctor tool

Running the XcodeBuildMCP server with the environmental variable `XCODEBUILDMCP_DEBUG=true` will expose a new diagnostic tool which you can run using MCP Inspector:
Running the XcodeBuildMCP server with the environmental variable `XCODEBUILDMCP_DEBUG=true` will expose a new doctor MCP tool called `doctor` which your agent can call to get information about the server's environment, available tools, and configuration status.

```bash
XCODEBUILDMCP_DEBUG=true npm run inspect
```

Alternatively, you can run the diagnostic tool directly:

```bash
node build/diagnostic-cli.js
```
> [!NOTE]
> You can also call the doctor tool directly using the following command but be advised that the output may vary from that of the MCP tool call due to environmental differences:
> ```bash
> npm run doctor
> ```

#### Development Workflow with Reloaderoo

Expand Down
20 changes: 10 additions & 10 deletions docs/MANUAL_TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ Black Box Testing means testing ONLY through external interfaces without any kno

// ❌ FORBIDDEN - Using tools as native functions
const devices = await list_devices();
const result = await diagnostic();
const result = await doctor();

// ✅ CORRECT - Only through Reloaderoo inspect
npx reloaderoo@latest inspect call-tool "list_devices" --params '{}' -- node build/index.js
npx reloaderoo@latest inspect call-tool "diagnostic" --params '{}' -- node build/index.js
npx reloaderoo@latest inspect call-tool "doctor" --params '{}' -- node build/index.js
```

**WHY RELOADEROO INSPECT IS MANDATORY:**
Expand Down Expand Up @@ -150,7 +150,7 @@ grep "^ • " /tmp/tools_detailed.txt | sed 's/^ • //' > /tmp/tool_names.t
# Create individual todo items for each tool discovered
# Use the actual tool count from step 1
# Example for first few tools:
# 1. [ ] Test tool: diagnostic
# 1. [ ] Test tool: doctor
# 2. [ ] Test tool: list_devices
# 3. [ ] Test tool: list_sims
# ... (continue for ALL $TOTAL_TOOLS tools)
Expand Down Expand Up @@ -238,7 +238,7 @@ fi
**CRITICAL: Tools must be tested in dependency order:**

1. **Foundation Tools** (provide data for other tools):
- `diagnostic` - System info
- `doctor` - System info
- `list_devices` - Device UUIDs
- `list_sims` - Simulator UUIDs
- `discover_projs` - Project/workspace paths
Expand Down Expand Up @@ -467,9 +467,9 @@ done < /tmp/resource_uris.txt
```bash
echo "=== FOUNDATION TOOL TESTING & DATA COLLECTION ==="

# 1. Test diagnostic (no dependencies)
echo "Testing diagnostic..."
npx reloaderoo@latest inspect call-tool "diagnostic" --params '{}' -- node build/index.js 2>/dev/null
# 1. Test doctor (no dependencies)
echo "Testing doctor..."
npx reloaderoo@latest inspect call-tool "doctor" --params '{}' -- node build/index.js 2>/dev/null

# 2. Collect device data
echo "Collecting device UUIDs..."
Expand Down Expand Up @@ -543,7 +543,7 @@ done < /tmp/workspace_paths.txt
```bash
# STEP 1: Test foundation tools (no parameters required)
# Execute each command individually, wait for response, verify manually
npx reloaderoo@latest inspect call-tool "diagnostic" --params '{}' -- node build/index.js
npx reloaderoo@latest inspect call-tool "doctor" --params '{}' -- node build/index.js
# [Wait for response, read output, mark tool complete in task list]

npx reloaderoo@latest inspect call-tool "list_devices" --params '{}' -- node build/index.js
Expand Down Expand Up @@ -616,8 +616,8 @@ npx reloaderoo@latest inspect call-tool "build_sim_id_proj" --params '{"projectP
**VALID TESTING SEQUENCE EXAMPLE:**
```bash
# ✅ CORRECT - Step-by-step manual execution via Reloaderoo
# Tool 1: Test diagnostic
npx reloaderoo@latest inspect call-tool "diagnostic" --params '{}' -- node build/index.js
# Tool 1: Test doctor
npx reloaderoo@latest inspect call-tool "doctor" --params '{}' -- node build/index.js
# [Read response, verify, mark complete in TodoWrite]

# Tool 2: Test list_devices
Expand Down
2 changes: 1 addition & 1 deletion docs/PLUGIN_DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ src/mcp/tools/
├── ui-testing/ # UI automation tools
├── project-discovery/ # Project analysis tools
├── utilities/ # General utilities
├── diagnostics/ # Diagnostic tools
├── doctor/ # System health check tools
├── logging/ # Log capture tools
└── discovery/ # Dynamic tool discovery
```
Expand Down
10 changes: 5 additions & 5 deletions docs/RELOADEROO.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ npx reloaderoo@latest inspect ping -- node build/index.js
# List connected devices
npx reloaderoo@latest inspect call-tool list_devices --params '{}' -- node build/index.js

# Get diagnostic information
npx reloaderoo@latest inspect call-tool diagnostic --params '{}' -- node build/index.js
# Get doctor information
npx reloaderoo@latest inspect call-tool doctor --params '{}' -- node build/index.js

# List iOS simulators
npx reloaderoo@latest inspect call-tool list_sims --params '{}' -- node build/index.js
Expand Down Expand Up @@ -209,7 +209,7 @@ Options:

Examples:
npx reloaderoo@latest info # Show basic system information
npx reloaderoo@latest info --verbose # Show detailed diagnostics
npx reloaderoo@latest info --verbose # Show detailed system information
```

### Response Format
Expand Down Expand Up @@ -355,7 +355,7 @@ npx reloaderoo@latest proxy --log-level debug -- node build/index.js

**JSON parsing errors:**
```bash
# Check server information for diagnostics
# Check server information for troubleshooting
npx reloaderoo@latest inspect server-info -- node build/index.js

# Ensure your server outputs valid JSON
Expand Down Expand Up @@ -386,7 +386,7 @@ npx reloaderoo@latest inspect call-tool list_devices --params '{}' -- node build
npx reloaderoo@latest proxy --debug -- node build/index.js # For proxy mode
npx reloaderoo@latest proxy --log-level debug -- node build/index.js # For detailed proxy logging

# View system diagnostics
# View system information
npx reloaderoo@latest info --verbose
```

Expand Down
Loading