Skip to main content
Glama
devyhan

Xcode MCP Server

by devyhan

xcode-archive

Archive Xcode projects to create distributable packages for iOS apps by specifying project paths, schemes, and archive destinations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectPathYesXcode 프로젝트 또는 워크스페이스 경로
schemeYes아카이브할 스킴
configurationNo빌드 구성 (예: Release)
archivePathYes아카이브 파일(.xcarchive) 저장 경로
exportPathNo익스포트 경로 (IPA 파일 등)
exportOptionsPlistNo익스포트 옵션 plist 파일 경로

Implementation Reference

  • The core handler function that constructs and executes xcodebuild archive and optional export commands using executeCommand utility, processes stdout/stderr, and returns formatted results or error responses.
    async ({ projectPath, scheme, configuration = "Release", archivePath, exportPath, exportOptionsPlist }) => {
      try {
        console.error(`Xcode 아카이브 생성: ${projectPath}, Scheme: ${scheme}`);
        
        let archiveCommand = `xcodebuild`;
        
        // 워크스페이스인지 프로젝트인지 확인
        if (projectPath.endsWith(".xcworkspace")) {
          archiveCommand += ` -workspace "${projectPath}"`;
        } else {
          archiveCommand += ` -project "${projectPath}"`;
        }
        
        archiveCommand += ` -scheme "${scheme}" -configuration "${configuration}" archive -archivePath "${archivePath}"`;
        
        console.error(`실행할 아카이브 명령어: ${archiveCommand}`);
        
        // 아카이브 명령어 실행
        try {
          const { stdout: archiveStdout, stderr: archiveStderr } = await executeCommand(archiveCommand);
          
          let resultText = "아카이브 결과:\n";
          if (archiveStdout) resultText += `${archiveStdout}\n`;
          if (archiveStderr) resultText += `STDERR:\n${archiveStderr}\n`;
          
          // 익스포트 실행 (옵션이 제공된 경우)
          if (exportPath && exportOptionsPlist) {
            console.error(`Xcode 아카이브 익스포트: ${archivePath} -> ${exportPath}`);
            
            let exportCommand = `xcodebuild -exportArchive -archivePath "${archivePath}" -exportPath "${exportPath}" -exportOptionsPlist "${exportOptionsPlist}"`;
            
            console.error(`실행할 익스포트 명령어: ${exportCommand}`);
            
            // 익스포트 명령어 실행
            const { stdout: exportStdout, stderr: exportStderr } = await executeCommand(exportCommand);
            
            resultText += "\n익스포트 결과:\n";
            if (exportStdout) resultText += `${exportStdout}\n`;
            if (exportStderr) resultText += `STDERR:\n${exportStderr}\n`;
          }
    
          return {
            content: [{ type: "text", text: resultText }]
          };
        } catch (error: any) {
          throw error;
        }
      } catch (error: any) {
        console.error(`Xcode 아카이브/익스포트 오류: ${error.message}`);
        
        return {
          content: [{ 
            type: "text", 
            text: `Xcode 아카이브/익스포트 중 오류가 발생했습니다:\n${error.message}\n${error.stderr || ''}`
          }],
          isError: true
        };
      }
    }
  • Zod input schema defining parameters for the xcode-archive tool: project/workspace path, scheme, optional configuration, required archive path, optional export path and plist.
    {
      projectPath: z.string().describe("Xcode 프로젝트 또는 워크스페이스 경로"),
      scheme: z.string().describe("아카이브할 스킴"),
      configuration: z.string().optional().describe("빌드 구성 (예: Release)"),
      archivePath: z.string().describe("아카이브 파일(.xcarchive) 저장 경로"),
      exportPath: z.string().optional().describe("익스포트 경로 (IPA 파일 등)"),
      exportOptionsPlist: z.string().optional().describe("익스포트 옵션 plist 파일 경로")
  • src/index.ts:298-368 (registration)
    Registration of the 'xcode-archive' tool on the MCP server, specifying name, input schema, and inline handler function.
    // 6. 앱 아카이브 및 익스포트 도구
    server.tool(
      "xcode-archive",
      {
        projectPath: z.string().describe("Xcode 프로젝트 또는 워크스페이스 경로"),
        scheme: z.string().describe("아카이브할 스킴"),
        configuration: z.string().optional().describe("빌드 구성 (예: Release)"),
        archivePath: z.string().describe("아카이브 파일(.xcarchive) 저장 경로"),
        exportPath: z.string().optional().describe("익스포트 경로 (IPA 파일 등)"),
        exportOptionsPlist: z.string().optional().describe("익스포트 옵션 plist 파일 경로")
      },
      async ({ projectPath, scheme, configuration = "Release", archivePath, exportPath, exportOptionsPlist }) => {
        try {
          console.error(`Xcode 아카이브 생성: ${projectPath}, Scheme: ${scheme}`);
          
          let archiveCommand = `xcodebuild`;
          
          // 워크스페이스인지 프로젝트인지 확인
          if (projectPath.endsWith(".xcworkspace")) {
            archiveCommand += ` -workspace "${projectPath}"`;
          } else {
            archiveCommand += ` -project "${projectPath}"`;
          }
          
          archiveCommand += ` -scheme "${scheme}" -configuration "${configuration}" archive -archivePath "${archivePath}"`;
          
          console.error(`실행할 아카이브 명령어: ${archiveCommand}`);
          
          // 아카이브 명령어 실행
          try {
            const { stdout: archiveStdout, stderr: archiveStderr } = await executeCommand(archiveCommand);
            
            let resultText = "아카이브 결과:\n";
            if (archiveStdout) resultText += `${archiveStdout}\n`;
            if (archiveStderr) resultText += `STDERR:\n${archiveStderr}\n`;
            
            // 익스포트 실행 (옵션이 제공된 경우)
            if (exportPath && exportOptionsPlist) {
              console.error(`Xcode 아카이브 익스포트: ${archivePath} -> ${exportPath}`);
              
              let exportCommand = `xcodebuild -exportArchive -archivePath "${archivePath}" -exportPath "${exportPath}" -exportOptionsPlist "${exportOptionsPlist}"`;
              
              console.error(`실행할 익스포트 명령어: ${exportCommand}`);
              
              // 익스포트 명령어 실행
              const { stdout: exportStdout, stderr: exportStderr } = await executeCommand(exportCommand);
              
              resultText += "\n익스포트 결과:\n";
              if (exportStdout) resultText += `${exportStdout}\n`;
              if (exportStderr) resultText += `STDERR:\n${exportStderr}\n`;
            }
    
            return {
              content: [{ type: "text", text: resultText }]
            };
          } catch (error: any) {
            throw error;
          }
        } catch (error: any) {
          console.error(`Xcode 아카이브/익스포트 오류: ${error.message}`);
          
          return {
            content: [{ 
              type: "text", 
              text: `Xcode 아카이브/익스포트 중 오류가 발생했습니다:\n${error.message}\n${error.stderr || ''}`
            }],
            isError: true
          };
        }
      }
    );
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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

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