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

Function selectionToMcpConfigJson

src/cli/commands/setup.ts:967–1016  ·  view source on GitHub ↗
(selection: SetupSelection)

Source from the content-addressed store, hash-verified

965}
966
967function selectionToMcpConfigJson(selection: SetupSelection): string {
968 const env: Record<string, string> = {};
969
970 if (selection.enabledWorkflows.length > 0) {
971 env.XCODEBUILDMCP_ENABLED_WORKFLOWS = selection.enabledWorkflows.join(',');
972 }
973
974 if (selection.debug) {
975 env.XCODEBUILDMCP_DEBUG = 'true';
976 }
977
978 if (selection.sentryDisabled) {
979 env.XCODEBUILDMCP_SENTRY_DISABLED = 'true';
980 }
981
982 if (selection.workspacePath) {
983 env.XCODEBUILDMCP_WORKSPACE_PATH = selection.workspacePath;
984 } else if (selection.projectPath) {
985 env.XCODEBUILDMCP_PROJECT_PATH = selection.projectPath;
986 }
987
988 env.XCODEBUILDMCP_SCHEME = selection.scheme;
989 if (selection.deviceId) {
990 env.XCODEBUILDMCP_DEVICE_ID = selection.deviceId;
991 }
992
993 const derivedPlatform = derivePlatformSessionDefault(selection.platforms);
994 if (derivedPlatform) {
995 env.XCODEBUILDMCP_PLATFORM = derivedPlatform;
996 }
997
998 if (selection.simulatorId) {
999 env.XCODEBUILDMCP_SIMULATOR_ID = selection.simulatorId;
1000 }
1001 if (selection.simulatorName) {
1002 env.XCODEBUILDMCP_SIMULATOR_NAME = selection.simulatorName;
1003 }
1004
1005 const mcpConfig = {
1006 mcpServers: {
1007 XcodeBuildMCP: {
1008 command: 'npx',
1009 args: ['-y', 'xcodebuildmcp@latest', 'mcp'],
1010 env,
1011 },
1012 },
1013 };
1014
1015 return JSON.stringify(mcpConfig, null, 2);
1016}
1017
1018export async function runSetupWizard(deps?: Partial<SetupDependencies>): Promise<SetupRunResult> {
1019 const isTTY = isInteractiveTTY();

Callers 1

runSetupWizardFunction · 0.85

Calls 1

Tested by

no test coverage detected