xcode-cli 1.0.6 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -3
- package/package.json +1 -1
- package/src/xcode-mcp.ts +7 -3
- package/src/xcode.ts +3 -0
package/README.md
CHANGED
|
@@ -45,9 +45,7 @@ Raw MCP server integration is available, but it is not the recommended default.
|
|
|
45
45
|
|
|
46
46
|
```bash
|
|
47
47
|
# 1. Install from npm
|
|
48
|
-
npm install -g xcode-cli
|
|
49
|
-
# To update to the latest version:
|
|
50
|
-
# npm install -g xcode-cli@latest
|
|
48
|
+
npm install -g xcode-cli@latest
|
|
51
49
|
|
|
52
50
|
# 2. Install and start the local bridge service
|
|
53
51
|
xcode-cli-ctl install
|
package/package.json
CHANGED
package/src/xcode-mcp.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
function log(msg: string) {
|
|
2
|
+
console.error(`[${new Date().toISOString()}] ${msg}`);
|
|
3
|
+
}
|
|
4
|
+
|
|
1
5
|
import http from 'node:http';
|
|
2
6
|
import { URL } from 'node:url';
|
|
3
7
|
import { randomUUID } from 'node:crypto';
|
|
@@ -49,7 +53,7 @@ export async function startMcpBridge(options: McpBridgeStartOptions): Promise<vo
|
|
|
49
53
|
});
|
|
50
54
|
|
|
51
55
|
upstream.onerror = (error) => {
|
|
52
|
-
|
|
56
|
+
log(`Upstream stdio MCP error: ${error.message}`);
|
|
53
57
|
};
|
|
54
58
|
|
|
55
59
|
try {
|
|
@@ -193,8 +197,8 @@ export async function startMcpBridge(options: McpBridgeStartOptions): Promise<vo
|
|
|
193
197
|
await new Promise<void>((resolve, reject) => {
|
|
194
198
|
server.once('error', reject);
|
|
195
199
|
server.listen(options.port, options.host, () => {
|
|
196
|
-
|
|
197
|
-
|
|
200
|
+
log(`MCP bridge listening on ${endpoint.toString()}`);
|
|
201
|
+
log('Upstream stdio: xcrun mcpbridge');
|
|
198
202
|
resolve();
|
|
199
203
|
});
|
|
200
204
|
});
|
package/src/xcode.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { execFile } from 'node:child_process';
|
|
3
3
|
import { promisify } from 'node:util';
|
|
4
|
+
import { createRequire } from 'node:module';
|
|
4
5
|
import { Command } from 'commander';
|
|
5
6
|
import { createRuntime, createServerProxy, describeConnectionIssue } from 'mcporter';
|
|
6
7
|
import type { CallResult } from 'mcporter';
|
|
@@ -12,6 +13,7 @@ import { parseTestSpecifier, type ParsedTestSpecifier } from './xcode-test.ts';
|
|
|
12
13
|
import { renderLsTree } from './xcode-tree.ts';
|
|
13
14
|
import type { CommonOpts, ClientContext } from './xcode-types.ts';
|
|
14
15
|
|
|
16
|
+
const { version } = createRequire(import.meta.url)('../package.json');
|
|
15
17
|
const SERVER_NAME = 'xcode-tools';
|
|
16
18
|
const DEFAULT_PORT = '48321';
|
|
17
19
|
const DEFAULT_URL = `http://localhost:${DEFAULT_PORT}/mcp`;
|
|
@@ -20,6 +22,7 @@ const program = new Command();
|
|
|
20
22
|
program
|
|
21
23
|
.name('xcode-cli')
|
|
22
24
|
.description('Friendly Xcode MCP CLI for browsing, editing, building, and testing projects.')
|
|
25
|
+
.version(version, '-v, --version')
|
|
23
26
|
.option('--url <url>', `MCP endpoint (default: ${DEFAULT_URL})`)
|
|
24
27
|
.option('--tab <tabIdentifier>', 'Default tab identifier for commands that need it')
|
|
25
28
|
.option('-t, --timeout <ms>', 'Call timeout in milliseconds', '60000')
|