Skip to main content
Glama

Xcode MCP Server

by PolarVista

Xcode MCP 服务器

Xcode MCP 服务器提供了用于构建和测试 Xcode 项目的模型上下文协议 (MCP) 接口。它使 AI 助手能够通过标准化接口直接触发构建、运行测试、监控进度和访问日志。

特征

  • 使用自定义方案和配置构建 Xcode 项目
  • 运行具有精细控制的单元测试(运行特定测试或跳过测试)
  • 生成代码覆盖率报告
  • 实时传输构建和测试日志
  • 访问详细的构建和测试报告
  • JSON 格式的输出
  • 自动日志持久化

要求

  • Node.js 16+
  • Xcode 命令行工具
  • TypeScript
  • MCP 兼容客户端(例如 Claude Desktop)

安装

# Clone the repository git clone https://github.com/PolarVista/Xcode-mcp-server.git cd xcode-mcp-server # Install dependencies npm install # Build the server npm run build

与 Claude Desktop 一起使用

  1. 启动服务器:
    npm run start /path/to/build/logs/directory
  2. 在 Claude Desktop 设置中:
    "command": "node", "args": ["/path/to/the/xcode-mcp-server/build/index.js", "/path/to/your/project/folder"], "env": { "PATH": "/usr/bin:/bin:/usr/local/bin:/usr/sbin:/sbin" }

可用工具

构建项目

使用指定的参数构建 Xcode 项目。

参数:

  • projectPath (必需):.xcodeproj 或 .xcworkspace 的路径
  • scheme (必填):构建方案名称
  • configuration (可选):构建配置(调试/发布,默认为调试)
  • destination (可选):构建目标(默认为“platform=iOS Simulator,name=iPhone 15 Pro”)

Claude 中的用法示例:

build_project({ projectPath: "/path/to/Project.xcodeproj", scheme: "MyApp", configuration: "Debug" })

运行测试

运行带有可选过滤的单元测试。

参数:

  • projectPath (必需):.xcodeproj 或 .xcworkspace 的路径
  • scheme (必填):测试方案名称
  • testIdentifier (可选):要运行的特定测试(例如,“MyTests/testExample”)
  • skipTests (可选):要跳过的测试标识符数组
  • configuration (可选):构建配置(调试/发布,默认为调试)
  • destination (可选):测试目的地(默认为“platform=iOS Simulator,name=iPhone 15 Pro”)

Claude 中的用法示例:

run_tests({ projectPath: "/path/to/Project.xcodeproj", scheme: "MyAppTests", testIdentifier: "LoginTests/testSuccessfulLogin", skipTests: ["PerformanceTests/testLargeDataLoad"], configuration: "Debug" })

日志

  • 所有日志都存储在build-logs/下的指定基础目录中
  • 构建操作创建:
    • 纯文本日志( build-[timestamp].log
    • JSON 格式的日志( build-[timestamp].log.json
    • Xcode 报告( report-[timestamp].txt
  • 测试操作创建:
    • 测试日志( test-[timestamp].log
    • JSON 格式的日志( test-[timestamp].log.json
    • 测试报告( test-report-[timestamp].txt
    • 代码覆盖率报告( coverage-[timestamp].txt
  • 最新日志(构建或测试)可通过xcode-build://latest-log资源访问
Install Server
A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

local-only server

The server can only run on the client's local machine because it depends on local resources.

模型上下文协议服务器,使 AI 助手能够直接通过标准化界面构建和测试 Xcode 项目,并具有运行测试、监控进度和实时访问日志的功能。

  1. 特征
    1. 要求
      1. 安装
        1. 与 Claude Desktop 一起使用
          1. 可用工具
            1. 构建项目
            2. 运行测试
          2. 日志

            Related MCP Servers

            • -
              security
              F
              license
              -
              quality
              A comprehensive Model Context Protocol server implementation that enables AI assistants to interact with file systems, databases, GitHub repositories, web resources, and system tools while maintaining security and control.
              Last updated -
              3
              1
              TypeScript
            • A
              security
              A
              license
              A
              quality
              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.
              Last updated -
              9
              669
              4
              JavaScript
              MIT License
              • Apple
            • -
              security
              F
              license
              -
              quality
              A Model Context Protocol server that provides AI models with structured access to external data and services, acting as a bridge between AI assistants and applications, databases, and APIs in a standardized, secure way.
              Last updated -
              1
              Python
            • -
              security
              A
              license
              -
              quality
              A Model Context Protocol server that enables AI assistants to interact with iOS simulators, perform accessibility testing, manage apps, and automate complex iOS workflows.
              Last updated -
              12
              Python
              Apache 2.0
              • Apple

            View all related MCP servers

            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/PolarVista/Xcode-mcp-server'

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