xcode_modify_plist
Modify values in plist files to configure Xcode project settings, enabling automated updates to iOS/macOS app properties.
Instructions
Modify a value in a plist file
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| plist_path | Yes | Path to the plist file | |
| key | Yes | Plist key to modify | |
| value | Yes | New value for the key |
Implementation Reference
- src/file-manager.ts:55-59 (handler)The core handler function that executes the plist modification using PlistBuddy to set the specified key to the given value in the plist file.async modifyPlist(plistPath: string, key: string, value: string): Promise<void> { // Use PlistBuddy to modify plist files const command = `/usr/libexec/PlistBuddy -c "Set :${key} ${value}" "${plistPath}"`; await execAsync(command); }
- src/command-executor.ts:191-194 (handler)Dispatches the 'modify_plist' internal command to the FileManager's modifyPlist method.case 'modify_plist': await this.fileManager.modifyPlist(args.plist_path, args.key, args.value); output = `Plist modified successfully: ${args.key} = ${args.value}`; break;
- src/command-executor.ts:281-306 (registration)Generates the MCP tool definitions including 'xcode_modify_plist' by prefixing command names with 'xcode_' and deriving inputSchema from command parameters.generateMCPToolDefinitions(): Array<{ name: string; description: string; inputSchema: any; }> { return Object.entries(this.commands).map(([name, command]) => ({ name: `xcode_${name}`, description: command.description, inputSchema: { type: 'object', properties: command.parameters ? Object.fromEntries( Object.entries(command.parameters).map(([paramName, paramDef]) => [ paramName, { type: paramDef.type, description: paramDef.description, ...(paramDef.default !== undefined && { default: paramDef.default }) } ]) ) : {}, required: command.parameters ? Object.entries(command.parameters) .filter(([_, paramDef]) => paramDef.required) .map(([paramName]) => paramName) : [] } })); }
- src/command-executor.ts:289-306 (schema)Defines the input schema for tools like 'xcode_modify_plist' based on the command's parameter definitions.inputSchema: { type: 'object', properties: command.parameters ? Object.fromEntries( Object.entries(command.parameters).map(([paramName, paramDef]) => [ paramName, { type: paramDef.type, description: paramDef.description, ...(paramDef.default !== undefined && { default: paramDef.default }) } ]) ) : {}, required: command.parameters ? Object.entries(command.parameters) .filter(([_, paramDef]) => paramDef.required) .map(([paramName]) => paramName) : [] } })); }
- src/index.ts:135-139 (handler)Main MCP CallTool request handler that recognizes 'xcode_*' tools, strips the prefix, and delegates execution to CommandExecutor.// Handle Xcode commands // Remove 'xcode_' prefix if present const commandName = name.startsWith('xcode_') ? name.slice(6) : name; const result = await this.commandExecutor.executeCommand(commandName, args);