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
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ jobs:
- name: Restore source modification times
run: ./scripts/restore-source-mtimes.sh

- name: Verify proxy target boundaries
run: ./scripts/verify-proxy-target-boundaries.sh
- name: Verify server target boundaries
run: ./scripts/verify-server-target-boundaries.sh

- name: Build package tests
run: swift build --build-tests -Xswiftc -strict-concurrency=minimal
Expand All @@ -103,8 +103,8 @@ jobs:
fail-fast: false
matrix:
shard:
- XcodeMCPProxyRuntimeTests
- ProxyIntegrationTests
- XcodeMCPServerRuntimeTests
- ServerIntegrationTests
- remaining
steps:
- name: Checkout
Expand Down Expand Up @@ -155,7 +155,7 @@ jobs:
./scripts/ci-test-watchdog.sh swift test \
--skip-build \
--no-parallel \
--skip 'XcodeMCPProxyRuntimeTests|ProxyIntegrationTests' \
--skip 'XcodeMCPServerRuntimeTests|ServerIntegrationTests' \
-Xswiftc -strict-concurrency=minimal
exit 0
;;
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ jobs:
python3 scripts/package_release.py verify --version "$VERSION" \
--release-dir release --checksums-sha256 "$CHECKSUMS_SHA256"

- name: Build, bottle, reinstall and exercise the native helper and proxy
- name: Build, bottle, reinstall and exercise the native helper and server
run: scripts/test-homebrew.sh release

tap-status:
Expand Down Expand Up @@ -399,7 +399,7 @@ jobs:
if not installed["poured_from_bottle"]:
sys.exit("Published tap verification expected a bottle installation.")
'
installed_binary="$(brew --prefix "$formula")/bin/xcode-mcp-proxy-server"
installed_binary="$(brew --prefix "$formula")/bin/xcode-mcp-server"
test "$("$installed_binary" --version)" = "$VERSION"
brew test "$formula"
"$(brew --prefix python@3.14)/bin/python3.14" \
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ DerivedData/
.codex/tmp/
/dist
/release
/ProxyToolVerifierOutput/
/ToolVerifierOutput/
__pycache__/
.vscode/
4 changes: 2 additions & 2 deletions Docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
## Use the Swift libraries

- [XcodeMCPKit](../Sources/XcodeMCPKit/README.md): discover and call MCP tools.
- [XcodeMCPProxyKit](../Sources/XcodeMCPProxyKit/README.md): embed the server.
- [XcodeMCPServerKit](../Sources/XcodeMCPServerKit/README.md): embed the server.
- [XcodeMCPKitTesting](../Sources/XcodeMCPKitTesting/README.md): use the client API with an in-memory runtime.

## Maintain the project

- [Architecture](architecture.md): public contracts, routing, sessions, and HTTP delivery.
- [Maintainer guide](maintainer-architecture.md): module ownership, native integration constraints, and verification.
- [Live tool verifier](../Sources/XcodeMCPProxyToolVerifier/README.md): disposable fixtures and preview comparisons.
- [Live tool verifier](../Sources/XcodeMCPToolVerifier/README.md): disposable fixtures and preview comparisons.
- [Homebrew distribution](../Homebrew/README.md): release approval, publication, and recovery.
16 changes: 8 additions & 8 deletions Docs/architecture.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# Architecture

`xcode-mcp-proxy-server` exposes one public MCP tool contract over Streamable
`xcode-mcp-server` exposes one public MCP tool contract over Streamable
HTTP. Workspace and device-session handles retain their owned headless execution
context across requests.

## Request routing

```mermaid
flowchart LR
client["MCP client"] -->|"Streamable HTTP"| proxy["Public tool contract"]
proxy --> handles["Workspace and session handles"]
client["MCP client"] -->|"Streamable HTTP"| server["Public tool contract"]
server --> handles["Workspace and session handles"]
handles --> headless["Owned native host"]
headless --> saved["Saved workspace models"]
proxy -->|"Native crash tools / GUI tab IDs"| bridge["Apple mcpbridge"]
server -->|"Native crash tools / GUI tab IDs"| bridge["Apple mcpbridge"]
bridge --> gui["Running GUI Xcode"]
headless -->|"Explicit Organizer tools"| gui
```

`XcodeListWorkspaces` returns proxy identifiers for loaded headless models.
`XcodeListWorkspaces` returns server identifiers for loaded headless models.
A handle binds one native workspace to its host. The public input is
`workspaceIdentifier`; adapters supply the owning backend's selector.
Workspace and device operations use owned headless hosts. The standard crash
Expand All @@ -36,7 +36,7 @@ of replaying an operation against another host.

## Public and native catalogs

The proxy owns public tool names and schemas. Its adapters translate arguments
The server owns public tool names and schemas. Its adapters translate arguments
and results at the native boundary, including workspace selectors and device-key
spellings. Public tools remain callable without relying on a client to process
`notifications/tools/list_changed` after a routing change. An unavailable backend
Expand Down Expand Up @@ -82,7 +82,7 @@ deinitialization requests cancellation only.

The server binds `localhost:8765` by default. `--listen`, `--host`, `--port`, and
`LISTEN` / `HOST` / `PORT` select another address. Endpoint discovery uses
`~/Library/Caches/XcodeMCPProxy/endpoint.json` unless overridden.
`~/Library/Caches/XcodeMCPServer/endpoint.json` unless overridden.

The Swift client's default `.server()` transport reads the discovery record and
requires a running server. Explicit standalone `.nativeHost(...)` starts an owned
Expand Down Expand Up @@ -123,7 +123,7 @@ values, and workspace resources. Apple's frameworks remain in the installed
Xcode and are not redistributed.

The optional Accessibility permission monitor approves other agents' direct
connections to GUI Xcode, including the proxy's Apple bridge. It is composed
connections to GUI Xcode, including the server's Apple bridge. It is composed
separately and has no role in tool
routing. See the [maintainer guide](maintainer-architecture.md) for
module boundaries, native corrections, signing, and verification.
20 changes: 10 additions & 10 deletions Docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ a failure after selection does not switch a running host to another installation
The standard `DEVELOPER_DIR` environment variable can prefer an installation:

```bash
DEVELOPER_DIR=/Applications/Xcode_27.0.app/Contents/Developer xcode-mcp-proxy-server
DEVELOPER_DIR=/Applications/Xcode_27.0.app/Contents/Developer xcode-mcp-server
```

To use another installation for a workspace, pass a `hostIdentifier` from
Expand All @@ -46,7 +46,7 @@ retains that host for subsequent operations. See

## Server options

Use `xcode-mcp-proxy-server --help` for CLI usage.
Use `xcode-mcp-server --help` for CLI usage.

| Option | Description |
| --- | --- |
Expand All @@ -57,7 +57,7 @@ Use `xcode-mcp-proxy-server --help` for CLI usage.
| `--share-compilation-cache` | Enable shared compilation caching and Swift/Clang prefix mapping in native hosts. Off by default; see [compilation caching](#compilation-caching). |
| `--auto-approve` | Automatically allow MCP connection dialogs for agents connecting directly to GUI Xcode. Off by default; requires macOS Accessibility access. |
| `--debug-endpoints` | Serve `/debug/hosts` and `/debug/reset` when the listener is loopback. Off by default. |
| `--force-restart` | Terminate an existing `xcode-mcp-proxy-server` on the listen port before starting. |
| `--force-restart` | Terminate an existing `xcode-mcp-server` on the listen port before starting. |
| `--dry-run` | Print the resolved server command without starting it. |

## Crash data storage
Expand All @@ -75,7 +75,7 @@ new content versions are acquired.

When launching the packaged native host directly, use `--crash-cache-root path`
to select a different location. This is a native-host option, not an
`xcode-mcp-proxy-server` option. Its `--artifacts-root` controls request artifacts
`xcode-mcp-server` option. Its `--artifacts-root` controls request artifacts
and does not change the persistent crash cache. See
[crash collection](usage.md#collect-crash-reports) for acquisition and reading.

Expand Down Expand Up @@ -105,8 +105,8 @@ for admission and completion boundaries.
| `XCODE_MCP_NATIVE_HOST_BUNDLE` | Helper bundle override for custom embedded/install layouts. |
| `DEVELOPER_DIR` | Xcode selection for the native host. |
| `MCP_LOG_LEVEL` | `trace`, `debug`, `info`, `notice`, `warning`, `error`, or `critical`. Defaults to `info`; `debug` includes native console output, HTTP access, and routing telemetry. |
| `XCODE_MCP_PROXY_DISCOVERY_FILE` | Discovery file override for isolated local/live test runs. |
| `XCODE_MCP_PROXY_CACHE_ROOT` | Cache root for the discovery path when `XCODE_MCP_PROXY_DISCOVERY_FILE` is unset. |
| `XCODE_MCP_SERVER_DISCOVERY_FILE` | Discovery file override for isolated local/live test runs. |
| `XCODE_MCP_SERVER_CACHE_ROOT` | Cache root for the discovery path when `XCODE_MCP_SERVER_DISCOVERY_FILE` is unset. |

### Logging

Expand All @@ -115,7 +115,7 @@ matches a recognized diagnostic format. The default `info` level hides these
lines. To inspect them, start the server with:

```bash
MCP_LOG_LEVEL=debug xcode-mcp-proxy-server
MCP_LOG_LEVEL=debug xcode-mcp-server
```

The helper marks each line of its own diagnostics with
Expand All @@ -128,7 +128,7 @@ level, and native-host NSLog diagnostics remain errors.

`--auto-approve` monitors running Xcode permission-dialog processes and presses
`Allow` on MCP connection dialogs for agents connecting directly to Xcode
through the proxy's Apple bridge or from external clients. Proxy workspace
through the server's Apple bridge or from external clients. Server workspace
operations run headlessly and do not create these dialogs. Grant macOS Accessibility access to the process hosting
the server when prompted; otherwise dialogs remain for manual approval.

Expand All @@ -145,7 +145,7 @@ Start the server with `--share-compilation-cache` to reuse compatible
compilation results across worktrees:

```bash
xcode-mcp-proxy-server --share-compilation-cache
xcode-mcp-server --share-compilation-cache
```

This opt-in enables compilation caching and Swift/Clang prefix mapping in native
Expand Down Expand Up @@ -223,7 +223,7 @@ to apply a changed setting to an already running native host.
For an explicit override, start the server with the service executable path:

```sh
XCBBUILDSERVICE_PATH=/path/to/SWBBuildServiceBundle xcode-mcp-proxy-server
XCBBUILDSERVICE_PATH=/path/to/SWBBuildServiceBundle xcode-mcp-server
```

When neither environment specifies a service, Swift Build uses the selected
Expand Down
2 changes: 1 addition & 1 deletion Docs/crash-reports.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ coverage. Native results do not identify network versus cache provenance.

The report UI and Markdown are in Japanese. JSON field names are stable English
identifiers. Keep GUI Xcode running with an open workspace and App Store Connect
account access. `--auto-approve` on the proxy can approve its bridge connection.
account access. `--auto-approve` on the server can approve its bridge connection.
Standard acquisition does not operate Organizer.

## Start the report page
Expand Down
34 changes: 17 additions & 17 deletions Docs/maintainer-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
| Module | Responsibility |
| --- | --- |
| `XcodeMCPCore` | Code that the SDK and the server share: clocks, endpoint discovery, native host lookup, SSE framing, and subprocess primitives. Depends only on `XcodeMCPWire`, so the SDK product builds without swift-nio or swift-log. |
| `XcodeMCPInstallation` | Installation discovery and path normalization shared by proxy and native host. |
| `XcodeMCPInstallation` | Installation discovery and path normalization shared by server and native host. |
| `XcodeMCPKit` | Public Swift client and MCP values. `MCPClientSessionAuthority` owns transport identity/recovery; `InitializedMCPClientSession` owns request correlation and progress lanes. |
| `XcodeMCPNativeRuntime` / `XcodeMCPNativeHost` | Xcode framework integration, native actions, headless workspace models, execution queues, and owned preview resources. |
| `XcodeMCPProxyRuntimeContract` | Package request/reply/session values and serving protocols. No execution or I/O state. |
| `XcodeMCPProxyRuntime` | Public tool contract and handle routing (`Broker/`), and one connection per host process with its catalog, request correlation, and recovery (`Host/`). |
| `XcodeMCPProxyHTTP` | Listener, protocol validation, MCP session lifetime (`HTTPSessionStore`), responses, and SSE delivery, including each request's progress on its POST response. Depends on the runtime contract rather than concrete Runtime. |
| `XcodeMCPServerRuntimeContract` | Package request/reply/session values and serving protocols. No execution or I/O state. |
| `XcodeMCPServerRuntime` | Public tool contract and handle routing (`Broker/`), and one connection per host process with its catalog, request correlation, and recovery (`Host/`). |
| `XcodeMCPServerHTTP` | Listener, protocol validation, MCP session lifetime (`HTTPSessionStore`), responses, and SSE delivery, including each request's progress on its POST response. Depends on the runtime contract rather than concrete Runtime. |
| `XcodeMCPPermissionAutomation` | Accessibility dialog recognition and opt-in approval monitor. Independent of native execution and routing. |
| `XcodeMCPProxyKit` | Public server facade, runtime/HTTP composition, discovery, CLI hosting, and installation. |
| `XcodeMCPServerKit` | Public server facade, runtime/HTTP composition, discovery, CLI hosting, and installation. |

Runtime and HTTP use Core rather than importing the public SDK. Internal targets
remain package implementation, not library products. The SDK keeps transport
Expand Down Expand Up @@ -60,15 +60,15 @@ Shutdown stops admission and awaits owned tasks before closing workspace and
transport resources. In the native host, the main task owns shutdown and runs it
once, for whichever comes first: input end, input or output failure, or a failure
that leaves Xcode's state in the process unreliable (such as a failed testable-state
hook). The failing request still gets its reply; the proxy then fails in-flight
hook). The failing request still gets its reply; the server then fails in-flight
requests and starts a new process on the next use. Input framing and preview
product digests run off the main actor, which Xcode's models use. `deinit` is a synchronous cancellation backstop and must not
spawn an unowned task or promise graceful shutdown. Report cleanup failure
alongside the original failure. Do not replay mutations with unknown delivery.

The native host retains a dedicated stdout descriptor for MCP messages and
redirects ordinary stdout to stderr, keeping framework output out of the protocol
stream. The proxy logs stderr lines without a recognized diagnostic format at
stream. The server logs stderr lines without a recognized diagnostic format at
`debug`, including test progress and other console output. The default `info`
level hides them; `MCP_LOG_LEVEL=debug` makes them available for diagnosis.
Each line of the helper's own diagnostics carries
Expand Down Expand Up @@ -315,26 +315,26 @@ and account operations require their own checks.
Run the relevant existing suite with an explicit macOS destination, for example:

```sh
xcodebuild test -workspace XcodeMCPKit.xcworkspace -scheme XcodeMCPProxyRuntimeTests -destination 'platform=macOS'
xcodebuild test -workspace XcodeMCPKit.xcworkspace -scheme XcodeMCPServerRuntimeTests -destination 'platform=macOS'
```

| Test target | Boundary |
| --- | --- |
| `XcodeMCPCoreTests` | Wire/framing, SSE codec, discovery, and native host lookup. |
| `XcodeMCPProcessRuntimeTests` | Process I/O and termination with fake drivers and opt-in live cases. |
| `XcodeMCPNativeRuntimeTests` | Native schemas, workspace/execution lifetime, previews, and documentation assets. |
| `XcodeMCPProxyRuntimeTests` | Public/backend contracts, handle routing, scheduling, and recovery. |
| `XcodeMCPProxyHTTPTests` | HTTP/SSE gateway with a runtime-contract fake. |
| `ProxyIntegrationTests` | Actual HTTP/runtime and configuration composition. |
| `XcodeMCPServerRuntimeTests` | Public/backend contracts, handle routing, scheduling, and recovery. |
| `XcodeMCPServerHTTPTests` | HTTP/SSE gateway with a runtime-contract fake. |
| `ServerIntegrationTests` | Actual HTTP/runtime and configuration composition. |
| `PublicProductContractTests` | Supported library consumers compiled from an external package. |

Core fixtures live in `XcodeMCPCoreTestSupport`, shared proxy fixtures in
`XcodeMCPProxyTestSupport`, and scripted host processes (`FakeHostSession`) in
`XcodeMCPProxyRuntimeTestSupport`. A fixture used by one suite stays with that
Core fixtures live in `XcodeMCPCoreTestSupport`, shared server fixtures in
`XcodeMCPServerTestSupport`, and scripted host processes (`FakeHostSession`) in
`XcodeMCPServerRuntimeTestSupport`. A fixture used by one suite stays with that
suite. Keep deterministic observations at owner boundaries instead of adding
production test hooks or reproducing internal branch order in assertions.

`scripts/verify-proxy-target-boundaries.sh` checks dependency direction;
`scripts/verify-server-target-boundaries.sh` checks dependency direction;
`scripts/check.sh` runs the full local maintainer checks. Package test schemes
can include several targets. Filtering execution does not prove compilation
isolation; inspect `swift build --target <target> -v` when that boundary matters.
Expand All @@ -352,9 +352,9 @@ python3 scripts/benchmark-live-server.py --agents 4 --requests-per-agent 100
It uses persistent sessions against a running server and deletes those sessions
on exit. Non-loopback endpoints require `--allow-non-loopback`.

For live checks, use the [tool verifier](../Sources/XcodeMCPProxyToolVerifier/README.md)
For live checks, use the [tool verifier](../Sources/XcodeMCPToolVerifier/README.md)
and disposable saved projects with an explicit scheme, destination, and test plan.
The legacy `ProxyLiveMCPBridgeTests` suite name remains a test identifier for
The legacy `LiveMCPBridgeTests` suite name remains a test identifier for
owned-host smoke cases. Verify workspace listing and operations with GUI Xcode
both closed and running; neither case may connect to the GUI process or require
its MCP connection approval.
Expand Down
Loading