Skip to main content
Glama

xcode_stop

Stop the current build or scheme action in Xcode for a specified project file to halt ongoing processes.

Instructions

Stop the current scheme action for a specific project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xcodeprojYesAbsolute path to the .xcodeproj file (or .xcworkspace if available) - e.g., /path/to/project.xcodeproj

Implementation Reference

  • Core handler function that executes the JXA script to invoke Xcode's workspace.stop() method, stopping the current build/run/test action.
    public static async stop(projectPath: string): Promise<McpResult> {
      const script = `
        (function() {
          ${getWorkspaceByPathScript(projectPath)}
          
          workspace.stop();
          return 'Stop command sent';
        })()
      `;
      
      const result = await JXAExecutor.execute(script);
      return { content: [{ type: 'text', text: result }] };
    }
  • MCP server dispatch handler in CallToolRequestSchema switch statement that validates input and delegates to BuildTools.stop.
    case 'xcode_stop':
      if (!args.xcodeproj) {
        return { content: [{ type: 'text', text: 'Error: xcodeproj parameter is required' }] };
      }
      return await BuildTools.stop(args.xcodeproj as string);
  • Tool schema definition providing name, description, and input validation schema (requires xcodeproj path).
    {
      name: 'xcode_stop',
      description: 'Stop the current scheme action for a specific project',
      inputSchema: {
        type: 'object',
        properties: {
          xcodeproj: {
            type: 'string',
            description: preferredXcodeproj 
              ? `Absolute path to the .xcodeproj file (or .xcworkspace if available) - defaults to ${preferredXcodeproj}`
              : 'Absolute path to the .xcodeproj file (or .xcworkspace if available) - e.g., /path/to/project.xcodeproj',
          },
        },
        required: preferredXcodeproj ? [] : ['xcodeproj'],
      },
    },
  • Registers xcode_stop tool (via getToolDefinitions) for the MCP ListToolsRequestSchema, making it discoverable by clients.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => {
      const toolOptions: {
        includeClean: boolean;
        preferredScheme?: string;
        preferredXcodeproj?: string;
      } = { includeClean: this.includeClean };
      
      if (this.preferredScheme) toolOptions.preferredScheme = this.preferredScheme;
      if (this.preferredXcodeproj) toolOptions.preferredXcodeproj = this.preferredXcodeproj;
      
      const toolDefinitions = getToolDefinitions(toolOptions);
      return {
        tools: toolDefinitions.map(tool => ({
          name: tool.name,
          description: tool.description,
          inputSchema: tool.inputSchema
        })),
      };
    });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lapfelix/XcodeMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server