Skip to main content
Glama
roeybiran

XcodeBuild Mini MCP Server

by roeybiran

XcodeBuild Mini MCP Server

An MCP (Model Context Protocol) server that provides Xcode build operations through the MCP interface, following the official MCP Node.js guide.

Features

This MCP server provides the following tools:

  • build - Build an Xcode scheme

  • list_tests - List all tests for an Xcode scheme

  • build_tests - Build tests for an Xcode scheme

  • run_tests - Run tests for an Xcode scheme (with optional test filtering)

  • list_packages - List all packages in the Xcode project

Related MCP server: Xcode MCP Server

Installation

  1. Install dependencies:

npm install
  1. Build the TypeScript code:

npm run build

Usage

Running the MCP Server

npm start

Or for development:

npm run dev

MCP Client Configuration

To use this MCP server with an MCP client, add it to your client configuration:

{
  "mcpServers": {
    "xcodebuild-mini": {
      "command": "npx",
      "args": ["-y", "@roeybiran/xcodebuild-mini-mcp"],
    }
  }
}

Available Tools

build

Build an Xcode scheme.

Parameters:

  • scheme (required): The Xcode scheme to build

  • warn (optional): Show warnings in output (default: false)

Example:

{
  "name": "build",
  "arguments": {
    "scheme": "MyApp",
    "warn": true
  }
}

list_tests

List all tests for an Xcode scheme.

Parameters:

  • scheme (required): The Xcode scheme to list tests for

Example:

{
  "name": "list_tests",
  "arguments": {
    "scheme": "MyApp"
  }
}

build_tests

Build tests for an Xcode scheme.

Parameters:

  • scheme (required): The Xcode scheme to build tests for

Example:

{
  "name": "build_tests",
  "arguments": {
    "scheme": "MyApp"
  }
}

run_tests

Run tests for an Xcode scheme.

Parameters:

  • scheme (required): The Xcode scheme to run tests for

  • only (optional): Run only specific test

Example:

{
  "name": "run_tests",
  "arguments": {
    "scheme": "MyApp",
    "only": "MyAppTests/testExample"
  }
}

list_packages

List all packages in the Xcode project.

Parameters: None

Example:

{
  "name": "list_packages",
  "arguments": {}
}

Requirements

  • Node.js 18+

  • Xcode command line tools

  • The xcodebuild command must be available in PATH

Development

Project Structure

xcodebuild-mini-mcp/
├── src/
│   ├── index.ts          # Main MCP server implementation (following MCP guide patterns)
│   └── xcodebuild.ts     # TypeScript implementation of Xcode build operations
├── dist/                 # Compiled JavaScript output
├── package.json          # Node.js dependencies
├── tsconfig.json         # TypeScript configuration
└── README.md            # This file

Implementation Details

This server follows the official MCP Node.js guide patterns:

  • Server Initialization: Uses the recommended Server class from @modelcontextprotocol/sdk

  • Transport: Uses StdioServerTransport for stdio-based communication

  • Tool Handlers: Implements ListToolsRequestSchema and CallToolRequestSchema handlers

  • Error Handling: Proper error handling with structured responses

  • Logging: Uses console.error for logging (stdout is reserved for JSON-RPC messages)

Building

npm run build

Development Mode

npm run dev

Error Handling

The MCP server handles errors gracefully and returns structured error responses. Common error scenarios include:

  • Invalid scheme names

  • Build failures

  • Test execution failures

  • Missing dependencies

All errors are returned with descriptive messages and proper error flags.

License

MIT

Available Tools

4 tools
buildA

Build the project, not including test targets

ParametersJSON Schema
NameRequiredDescriptionDefault
srcNoThe source directory path
warnNoWhether to show warnings in the output
schemeYesThe scheme name

TDQS

A3.5/5.0
Behavior2/5

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

No annotations are provided, and the description 'Build the project' does not disclose behavioral traits such as side effects, error conditions, output details, or prerequisites beyond the schema parameters.

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

Conciseness5/5

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

The description is a single, concise sentence with no fluff, effectively conveying the tool's purpose and exclusion of test targets.

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

Completeness3/5

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

Given the tool has 3 parameters and no output schema, the description is somewhat complete but lacks behavioral context such as output location, build process details, or caching behavior.

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

Parameters3/5

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

Schema description coverage is 100%, so the baseline is 3. The description does not add any parameter-specific information beyond what the schema already provides.

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

Purpose5/5

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

The description 'Build the project, not including test targets' clearly states the action (build) and the resource (project), and explicitly distinguishes from sibling tools like build_tests by excluding test targets.

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

Usage Guidelines3/5

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

The description implies when to use this tool (when building the main project without tests), but does not explicitly state when not to use it or name alternatives like build_tests for test targets.

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

build_testsB

Build the project, including test targets

ParametersJSON Schema
NameRequiredDescriptionDefault
srcNoThe source directory path
warnNoWhether to show warnings in the output
schemeYesThe scheme name

TDQS

B3.3/5.0
Behavior2/5

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

With no annotations, the description must fully disclose behavioral traits. It only states the action of building, omitting side effects (e.g., artifact generation, output location, success/failure indicators) or any operational constraints like required environment or duration.

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

Conciseness4/5

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

The description is a single concise sentence with no wasted words. However, for a build tool with 3 parameters, it could be slightly expanded to include key behavioral notes without harming conciseness.

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

Completeness2/5

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

The description lacks essential context for a build tool, such as expected outcomes (e.g., compiled binaries), error behavior, or prerequisites (e.g., source code present). Schema coverage alone does not compensate for missing operational context.

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

Parameters3/5

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

Schema coverage is 100%, so parameters are fully documented structurally. The description adds no additional meaning beyond the schema, which is acceptable per baseline scoring. No parameter-specific semantics are provided.

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

Purpose5/5

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

The description uses the verb 'Build' and clearly specifies the resource as 'the project, including test targets'. This distinguishes it from sibling tools 'build' (likely without tests), 'list_tests', and 'run_tests', making its purpose unambiguous.

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

Usage Guidelines3/5

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

The description implies usage for building test targets but does not explicitly state when to use this tool versus alternatives like 'build' for plain builds or 'run_tests' after building. No prerequisites or exclusions are mentioned, leaving the agent to infer context.

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

list_testsC

List all tests for the project

ParametersJSON Schema
NameRequiredDescriptionDefault
srcNoThe source directory path
schemeYesThe scheme name

TDQS

C2.9/5.0
Behavior2/5

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

No annotations provided. Description does not disclose any behavioral traits (e.g., side effects, permissions, performance). Only states the action without additional context.

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

Conciseness3/5

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

Very concise single sentence. However, it is too brief and lacks detail that would be valuable for an agent. Could add context without harming conciseness.

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

Completeness3/5

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

For a simple list tool with two parameters, this description is minimally complete. However, it does not explain what 'tests' means (e.g., test files vs test cases) or how the project is identified.

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

Parameters3/5

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

Schema coverage is 100% with descriptions for both parameters. Description does not add value beyond schema, but baseline is 3 due to high coverage.

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

Purpose4/5

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

Clear verb and resource: 'list tests'. Distinguishes from siblings (build, build_tests, run_tests) by being a listing operation. However, does not specify scope beyond 'for the project'.

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

Usage Guidelines2/5

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

No guidance on when to use this tool vs alternatives. No mention of prerequisites or context for listing tests. Implied usage only.

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

run_testsC

Runs the project's tests

ParametersJSON Schema
NameRequiredDescriptionDefault
srcNoThe source directory path
onlyNoSpecific tests to run. Provide the full path to the test - TestTarget/TestSuite/TestName, including parentheses (e.g. 'MyAppTests/MyTestSuite/testExample()')
schemeYesThe scheme name
coverageNoWhether to generate code coverage

TDQS

C2.5/5.0
Behavior2/5

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

The description does not disclose what happens when tests are run (e.g., output format, exit codes, coverage generation) or whether there are side effects. With no annotations, the agent has minimal insight into the tool's behavior beyond the generic verb.

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

Conciseness3/5

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

At one sentence, the description is concise, but it is too sparse to be fully informative. It lacks structure or detail that could aid an agent, though it does not waste words.

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

Completeness2/5

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

The tool has 4 parameters and no output schema, yet the description does not explain what the tool returns or how to interpret results. For a test runner, this is a significant gap, leaving the agent without critical information.

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

Parameters3/5

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

Schema coverage is 100%, so the parameters are well-documented in the schema. The description adds no additional context about parameter usage or relationships, which is acceptable as the schema suffices, but no extra value is provided.

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

Purpose3/5

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

The description 'Runs the project's tests' clearly states the action and resource, but it is too generic. It does not differentiate from sibling tools like 'build' or 'build_tests', and omits nuances like running specific tests (via 'only' parameter) or configurations.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives. It does not mention prerequisites (e.g., needing to build first) or describe scenarios where this tool is appropriate compared to 'build_tests' or 'list_tests'. The agent is left to infer usage from context.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 4 tool updatesv1.0.11
    • First observedbuild
    • First observedbuild_tests
    • First observedlist_tests
    • First observedrun_tests

TDQS

A3.5/5.0
Disambiguation5/5

Each tool serves a unique purpose: build (without tests), build_tests (with tests), list_tests (list test targets), and run_tests (execute tests). No overlap in functionality.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern: build, build_tests, list_tests, run_tests. The naming is predictable and uniform.

Tool Count5/5

Four tools cover the essential build and test workflow without unnecessary bloat. The count is well-scoped for a focused Xcode build server.

Completeness4/5

The set covers core build and test operations (build with/without tests, list/run tests). Missing cleanup or individual test selection, but minimal for a 'mini' server.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    D
    quality
    D
    maintenance
    A Model Context Protocol server that provides tools for Xcode-related operations, making it easier to work with iOS project management, building, testing, archiving, and deploying apps to both simulators and physical devices.
    9
    19
    9
    MIT
  • A
    license
    B
    quality
    C
    maintenance
    Provides programmatic access to Xcode functionality, enabling AI assistants to create, build, test, and manage iOS/macOS projects directly.
    33
    7
    5
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Enables AI assistants to manage Xcode projects by listing targets, reading configurations, and triggering builds via the Model Context Protocol. It facilitates natural language interaction with macOS developer tools to streamline iOS app development processes.
    6
    234
    MIT

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/roeybiran/xcodebuild-mini-mcp'

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