DX

dazuiba/xcode-cli-skill

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

42 stars 质量 58 趋势 0MIT

CLI + Skill 封装器,官方 Xcode 26.3+ MCP 工具,因此“允许访问 Xcode?”弹窗每次电脑启动只出现一次,此外还有一个技能,每次对话保存约 500 个上下文标记。

概览

CLI + Skill 封装器,适用于官方 Xcode 26.3+ MCP 工具:一个长寿命的 xcode-cli-service,使“允许访问 Xcode?”弹窗不再在每次通话中出现,同时还有一个 Claude 代码技能,可以为每次对话保存上下文。 当 AI 代理(Claude Code、Codex、Cursor)调用 Xcode 26.3 MCP 工具时,macOS 可以每隔几秒弹出“允许访问 Xcode?”的提示。如果桥接进程不断变化,macOS 就不会把它当作同样的长期集成来看待。 Xcode MCP 桥接器是进程受限的。如果每个通话都经过一个新的短暂进程,你会收到重复的权限提示,日常工作流程也会变差。 该仓库在 xcrun mcpbridge 前端运行持久的本地桥接服务。代理或终端 CLI 与稳定的 HTTP 端点通信,而 xcode-cli-ctl 则为你管理后台服务。 原始MCP服务器集成可用,但这不是推荐的默认配置。

概述(AI 翻译)

中文文档

官方 Xcode 26.3+ MCP 工具的 CLI + Skill 包装器:一个长寿命的 xcode-cli-service,这样“允许访问 Xcode?”弹窗就不会在每次通话中出现,还有一个 Claude 代码技能,每次对话能保存 **~5 千个上下文令牌。

痛点 解决方案
AI 代理在每次 Xcode MCP 调用时都会弹出“允许访问 Xcode?”,而且它从未记住 一个持久的mcp-proxy进程——macOS只请求一次
MCP工具定义(20个工具,~5K代币)加载到每次对话中 以Claude代码技能形式包装 — 按需加载

详情

问题1:许可弹窗垃圾信息

当 AI 代理(Claude Code、Codex、Cursor)调用 Xcode 26.3 MCP 工具时,macOS 可以每隔几秒弹出“允许访问 Xcode?”的提示。如果桥接进程不断变化,macOS 就不会把它当作同样的长期集成来看待。

根本原因

Xcode MCP 桥接器是进程受限的。如果每个通话都经过一个新的短暂进程,你会收到重复的权限提示,日常工作流程也会变差。

修理

该仓库在xcrun mcpbridge前方运行持久本地桥接服务。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

xcode-cli-skill

中文文档

CLI + Skill wrapper for the official Xcode 26.3+ MCP tools: a long-lived xcode-cli-service so the “Allow access to Xcode?” popup stops showing up on every call, plus a Claude Code Skill that saves ~5 K tokens of context per conversation.

Pain point Solution
AI agents get a “Allow access to Xcode?” popup on every Xcode MCP call, and it never remembers A persistent mcp-proxy process — macOS only asks once
MCP tool definitions (20 tools, ~5K tokens) load into every conversation Wrapped as a Claude Code Skill — loads on-demand

Details

Problem 1: Permission Popup Spam

When AI agents (Claude Code, Codex, Cursor) call Xcode 26.3 MCP tools, macOS can keep popping up “Allow access to Xcode?” every few seconds. If the bridge process keeps changing, macOS does not treat it as the same long-lived integration.

Root Cause

The Xcode MCP bridge is process-bound. If every call goes through a fresh short-lived process, you get repeated permission prompts and a worse day-to-day workflow.

The Fix

This repo runs a persistent local bridge service in front of xcrun mcpbridge. The agent or terminal CLI talks to that stable HTTP endpoint, while xcode-cli-ctl manages the background service for you.

Agent / CLI ──HTTP──▶ local bridge service ──▶ xcrun mcpbridge ──▶ Xcode
                           ▲
                  managed by xcode-cli-ctl

Problem 2: Keep MCP Out of Every Conversation by Default

Raw MCP server integration is available, but it is not the recommended default. For Claude Code and Codex, this repo is primarily about the packaged xcode-cli Skill: let the agent load the workflow when it actually needs Xcode, instead of wiring raw MCP tools into every session.

Prerequisites

  • macOS with Xcode 26.3+
  • Node.js 18+
  • Xcode open with the target project/workspace when you want to build, test, preview, or inspect issues

Quick Start

# 1. Install from npm
npm install -g xcode-cli@latest

# 2. Install and start the local bridge service
xcode-cli-ctl install

# 3. Check service health
xcode-cli-ctl status

# 4. Install the packaged skill
xcode-cli-ctl skill install

Click “Allow” when macOS asks for Xcode permission.

Verify

# Make sure Xcode is open with a project, then run from the project directory
cd ~/MyProject
xcode-cli build        # auto-selects the matching Xcode tab
xcode-cli windows      # or list tabs explicitly

AI Agent Integration

use skill, you can saves ~5 K tokens of context per conversation.

Skill Installation (better)

xcode-cli-ctl skill install --claude
xcode-cli-ctl skill install --codex
# Install to both Claude Code and Codex
xcode-cli-ctl skill install

# Or copy manually
在 GitHub 查看完整 README

推荐工具

换一个关键词,或者移除筛选条件。

安装

npx skillfish add dazuiba/xcode-cli-skill
新手?先看 mcpskill.org 教程 →