import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
import { listTool, listSchema } from './tools/list.js';
import { bootTool, bootSchema } from './tools/boot.js';
import { shutdownTool, shutdownSchema } from './tools/shutdown.js';
import { installTool, installSchema } from './tools/install.js';
import { launchTool, launchSchema } from './tools/launch.js';
import { terminateTool, terminateSchema } from './tools/terminate.js';
import { uninstallTool, uninstallSchema } from './tools/uninstall.js';
import { openurlTool, openurlSchema } from './tools/openurl.js';
import { pushTool, pushSchema } from './tools/push.js';
import { locationTool, locationSchema } from './tools/location.js';
import { privacyTool, privacySchema } from './tools/privacy.js';
import { screenshotTool, screenshotSchema } from './tools/screenshot.js';
import { xcodebuildListTool, xcodebuildListSchema } from './tools/xcodebuild-list.js';
import { xcodebuildBuildTool, xcodebuildBuildSchema } from './tools/xcodebuild-build.js';
import { xcodebuildTestTool, xcodebuildTestSchema } from './tools/xcodebuild-test.js';
import { xcodebuildCleanTool, xcodebuildCleanSchema } from './tools/xcodebuild-clean.js';
import { xcodebuildSettingsTool, xcodebuildSettingsSchema } from './tools/xcodebuild-settings.js';
import { wdaStatusTool, wdaStatusSchema } from './tools/wda-status.js';
import { wdaTapTool, wdaTapSchema } from './tools/wda-tap.js';
import { wdaTypeTool, wdaTypeSchema } from './tools/wda-type.js';
import { wdaSwipeTool, wdaSwipeSchema } from './tools/wda-swipe.js';
import { wdaFindTool, wdaFindSchema } from './tools/wda-find.js';
import { wdaSourceTool, wdaSourceSchema } from './tools/wda-source.js';
import { wdaHomeTool, wdaHomeSchema } from './tools/wda-home.js';
import { wdaAlertTool, wdaAlertSchema } from './tools/wda-alert.js';
import { wdaStartTool, wdaStartSchema } from './tools/wda-start.js';
import { wdaStopTool, wdaStopSchema } from './tools/wda-stop.js';
export function createServer(): McpServer {
const server = new McpServer({
name: 'xcode-mcp',
version: '1.0.0',
});
// Register all tools
server.tool(
listTool.name,
listTool.description,
listSchema.shape,
listTool.handler
);
server.tool(
bootTool.name,
bootTool.description,
bootSchema.shape,
bootTool.handler
);
server.tool(
shutdownTool.name,
shutdownTool.description,
shutdownSchema.shape,
shutdownTool.handler
);
server.tool(
installTool.name,
installTool.description,
installSchema.shape,
installTool.handler
);
server.tool(
launchTool.name,
launchTool.description,
launchSchema.shape,
launchTool.handler
);
server.tool(
terminateTool.name,
terminateTool.description,
terminateSchema.shape,
terminateTool.handler
);
server.tool(
uninstallTool.name,
uninstallTool.description,
uninstallSchema.shape,
uninstallTool.handler
);
server.tool(
openurlTool.name,
openurlTool.description,
openurlSchema.shape,
openurlTool.handler
);
server.tool(
pushTool.name,
pushTool.description,
pushSchema.shape,
pushTool.handler
);
server.tool(
locationTool.name,
locationTool.description,
locationSchema.shape,
locationTool.handler
);
server.tool(
privacyTool.name,
privacyTool.description,
privacySchema.shape,
privacyTool.handler
);
server.tool(
screenshotTool.name,
screenshotTool.description,
screenshotSchema.shape,
screenshotTool.handler
);
// xcodebuild tools
server.tool(
xcodebuildListTool.name,
xcodebuildListTool.description,
xcodebuildListSchema.shape,
xcodebuildListTool.handler
);
server.tool(
xcodebuildBuildTool.name,
xcodebuildBuildTool.description,
xcodebuildBuildSchema.shape,
xcodebuildBuildTool.handler
);
server.tool(
xcodebuildTestTool.name,
xcodebuildTestTool.description,
xcodebuildTestSchema.shape,
xcodebuildTestTool.handler
);
server.tool(
xcodebuildCleanTool.name,
xcodebuildCleanTool.description,
xcodebuildCleanSchema.shape,
xcodebuildCleanTool.handler
);
server.tool(
xcodebuildSettingsTool.name,
xcodebuildSettingsTool.description,
xcodebuildSettingsSchema.shape,
xcodebuildSettingsTool.handler
);
// WDA (WebDriverAgent) tools
server.tool(
wdaStatusTool.name,
wdaStatusTool.description,
wdaStatusSchema.shape,
wdaStatusTool.handler
);
server.tool(
wdaTapTool.name,
wdaTapTool.description,
wdaTapSchema.shape,
wdaTapTool.handler
);
server.tool(
wdaTypeTool.name,
wdaTypeTool.description,
wdaTypeSchema.shape,
wdaTypeTool.handler
);
server.tool(
wdaSwipeTool.name,
wdaSwipeTool.description,
wdaSwipeSchema.shape,
wdaSwipeTool.handler
);
server.tool(
wdaFindTool.name,
wdaFindTool.description,
wdaFindSchema.shape,
wdaFindTool.handler
);
server.tool(
wdaSourceTool.name,
wdaSourceTool.description,
wdaSourceSchema.shape,
wdaSourceTool.handler
);
server.tool(
wdaHomeTool.name,
wdaHomeTool.description,
wdaHomeSchema.shape,
wdaHomeTool.handler
);
server.tool(
wdaAlertTool.name,
wdaAlertTool.description,
wdaAlertSchema.shape,
wdaAlertTool.handler
);
server.tool(
wdaStartTool.name,
wdaStartTool.description,
wdaStartSchema.shape,
wdaStartTool.handler
);
server.tool(
wdaStopTool.name,
wdaStopTool.description,
wdaStopSchema.shape,
wdaStopTool.handler
);
return server;
}