Skip to main content
Glama
ebowwa

Xcode MCP Server

by ebowwa

xcode_add_plist_entry

Add new entries to plist files in Xcode projects by specifying key, type, and value parameters for configuration management.

Instructions

Add a new entry to a plist file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
plist_pathYesPath to the plist file
keyYesPlist key to add
typeYesValue type (string, bool, integer, array, dict)
valueYesValue to add

Implementation Reference

  • Core handler function that executes the PlistBuddy command to add a new entry to the plist file.
    async addPlistEntry(plistPath: string, key: string, type: string, value: string): Promise<void> {
      const command = `/usr/libexec/PlistBuddy -c "Add :${key} ${type} ${value}" "${plistPath}"`;
      await execAsync(command);
    }
  • Dispatches the add_plist_entry internal command by calling FileManager.addPlistEntry.
    case 'add_plist_entry':
      await this.fileManager.addPlistEntry(args.plist_path, args.key, args.type, args.value);
      output = `Plist entry added successfully: ${args.key} = ${args.value}`;
      break;
  • Generates the MCP tool list including 'xcode_add_plist_entry' by prefixing internal 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) : []
        }
      }));
    }
  • MCP tool call handler that strips the 'xcode_' prefix from tool names and delegates to CommandExecutor.executeCommand.
    const commandName = name.startsWith('xcode_') ? name.slice(6) : name;
    const result = await this.commandExecutor.executeCommand(commandName, args);
  • src/index.ts:87-89 (registration)
    Registers the tool list handler, exposing generated tools including 'xcode_add_plist_entry' via ListToolsRequestSchema.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [...tools, ...webMonitorTools],
    }));

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/ebowwa/xcode-mcp'

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