Skip to main content
Glama

xcode_get_workspace_info

Retrieve detailed information about an Xcode workspace or project by providing the path to the .xcodeproj or .xcworkspace file, facilitating Xcode build automation and log parsing.

Instructions

Get information about a specific workspace

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xcodeprojYesPath to the .xcodeproj file (or .xcworkspace if available) - supports both absolute (/path/to/project.xcodeproj) and relative (MyApp.xcodeproj) paths

Implementation Reference

  • Core handler function that validates the project path, opens the project if needed, executes JXA script to retrieve workspace details (name, path, loaded status, active scheme, active run destination), and returns the JSON-formatted info.
    public static async getWorkspaceInfo(projectPath: string, openProject: OpenProjectCallback): Promise<McpResult> { const validationError = PathValidator.validateProjectPath(projectPath); if (validationError) return validationError; await openProject(projectPath); const script = ` (function() { ${getWorkspaceByPathScript(projectPath)} const info = { name: workspace.name(), path: workspace.path(), loaded: workspace.loaded(), activeScheme: workspace.activeScheme() ? workspace.activeScheme().name() : null, activeRunDestination: workspace.activeRunDestination() ? workspace.activeRunDestination().name() : null }; return JSON.stringify(info, null, 2); })() `; const result = await JXAExecutor.execute(script); return { content: [{ type: 'text', text: result }] }; }
  • Tool dispatch/registration in the main MCP server switch statement within CallToolRequestSchema handler, which validates input and delegates to InfoTools.getWorkspaceInfo.
    case 'xcode_get_workspace_info': if (!args.xcodeproj) { throw new McpError(ErrorCode.InvalidParams, `Missing required parameter: xcodeproj`); } return await InfoTools.getWorkspaceInfo(args.xcodeproj as string, this.openProject.bind(this));
  • Tool definition including name, description, and input schema (requiring xcodeproj path) used by the server for ListToolsRequestSchema and tool discovery.
    { name: 'xcode_get_workspace_info', description: 'Get information about a specific workspace', 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'], }, },
  • Duplicate tool dispatch in the callToolDirect method for direct CLI/server compatibility.
    case 'xcode_get_workspace_info': if (!args.xcodeproj) { throw new McpError(ErrorCode.InvalidParams, `Missing required parameter: xcodeproj`); } return await InfoTools.getWorkspaceInfo(args.xcodeproj as string, this.openProject.bind(this));
  • Tool listed in getToolLimitations for environment validation checks (requires Xcode and osascript).
    'xcode_get_run_destinations', 'xcode_get_workspace_info', 'xcode_get_projects'];

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