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

Function createBaseServerInstance

src/server/server.ts:26–69  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24import { getServer, setServer } from './server-state.ts';
25
26function createBaseServerInstance(): McpServer {
27 return new McpServer(
28 {
29 name: 'xcodebuildmcp',
30 version: String(version),
31 },
32 {
33 instructions: `XcodeBuildMCP provides comprehensive tooling for Apple platform development (iOS, macOS, watchOS, tvOS, visionOS).
34
35Prefer XcodeBuildMCP tools over shell commands for Apple platform tasks when available.
36
37Capabilities:
38- Session defaults: Configure project, scheme, simulator, and device defaults to avoid repetitive parameters
39- Project discovery: Find Xcode projects/workspaces, list schemes, inspect build settings
40- Simulator workflows: Build, run, test, install, and launch apps on iOS simulators; manage simulator state (boot, erase, location, appearance)
41- Device workflows: Build, test, install, and launch apps on physical devices with code signing
42- macOS workflows: Build, run, and test macOS applications
43- Log capture: Stream and capture logs from simulators and devices
44- LLDB debugging: Attach debugger, set breakpoints, inspect stack traces and variables, execute LLDB commands
45- UI automation: Capture screenshots, inspect runtime UI snapshots, perform taps/swipes/gestures, type text, press hardware buttons, and batch multiple same-screen elementRef taps
46- SwiftPM: Build, run, test, and manage Swift Package Manager projects
47- Project scaffolding: Generate new iOS/macOS project templates
48
49Only simulator workflow tools are enabled by default. If capabilities like device, macOS, debugging, or UI automation are not available, the user must configure XcodeBuildMCP to enable them. See https://xcodebuildmcp.com/docs/configuration for workflow configuration.
50
51Simulator run flow:
52- Before your first build, run, or test call in a session, you MUST call session_show_defaults to verify the active project/workspace, scheme, and simulator. Do not assume defaults are configured. Only skip this if you have already called session_show_defaults earlier in the current session.
53- If session_show_defaults confirms project/workspace + scheme + simulator are set, call build_run_sim immediately (often with empty arguments).
54- Use discover_projs only when session_show_defaults shows project/workspace is missing or wrong.
55- Never call discover_projs speculatively or in parallel with session_show_defaults.
56- Do not call boot_sim or open_sim as prerequisites for build_run_sim; build_run_sim boots and opens Simulator as needed.`,
57 capabilities: {
58 tools: {
59 listChanged: true,
60 },
61 resources: {
62 subscribe: true,
63 listChanged: true,
64 },
65 logging: {},
66 },
67 },
68 ) as unknown as McpServer;
69}
70
71/**
72 * Create and configure the MCP server

Callers 1

createServerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected