MCPcopy Index your code
hub / github.com/getsentry/XcodeBuildMCP / main

Function main

scripts/probe-xcode-mcpbridge.ts:46–82  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

44}
45
46async function main(): Promise<void> {
47 const { limit, callWindows } = parseArgs(process.argv);
48
49 const transport = new StdioClientTransport({
50 command: 'xcrun',
51 args: ['mcpbridge'],
52 stderr: 'inherit',
53 env: mapXcodeEnvForMcpBridge(process.env),
54 });
55
56 const client = new Client({ name: 'xcodebuildmcp-probe', version: '0.0.0' });
57 await client.connect(transport, { timeout: 15_000 });
58
59 const serverInfo = client.getServerVersion();
60 const capabilities = client.getServerCapabilities();
61
62 console.log('serverInfo:', serverInfo);
63 console.log('capabilities.tools.listChanged:', capabilities?.tools?.listChanged ?? false);
64
65 const toolsResult = await client.listTools(undefined, { timeout: 15_000 });
66 console.log(`tools: ${toolsResult.tools.length}`);
67 console.log(
68 'first tools:',
69 toolsResult.tools.slice(0, limit).map((t) => t.name),
70 );
71
72 if (callWindows) {
73 const windows = await client.request(
74 { method: 'tools/call', params: { name: 'XcodeListWindows', arguments: {} } },
75 CompatibilityCallToolResultSchema,
76 { timeout: 15_000 },
77 );
78 console.log('XcodeListWindows:', windows);
79 }
80
81 await client.close();
82}
83
84main().catch((error) => {
85 console.error(error);

Callers 1

Calls 5

parseArgsFunction · 0.70
mapXcodeEnvForMcpBridgeFunction · 0.70
closeMethod · 0.65
listToolsMethod · 0.45
requestMethod · 0.45

Tested by

no test coverage detected