Xcode: MCP Bridge Wrapper for Cursor

io.github.SoundBlaster由 GitHub 账号 SoundBlaster 发布v0.5.0更新于 Nov 10, 2026

Python wrapper that makes Xcode's MCP bridge compatible with strict MCP clients like Cursor

已验证STDIO仅桌面文件与存储开发者工具

概览

AI 生成的概览

通过 xcrun mcpbridge 把 Cursor 等 MCP 客户端连接到 Xcode 工具的 Python 包装器,并修复格式不完整的工具响应。

可以做什么
  • 列出、打开、关闭和新建 Xcode 工作区、目标、scheme 与测试计划
  • 读取、写入、更新、移动和删除项目文件,并支持 glob、grep 与代码问题刷新
  • 构建、测试、运行、停止和调试项目,读取构建日志与控制台输出,调整构建设置
  • 操作模拟器与设备:启动会话、安装并运行、合成输入
  • 规划本地化,读取或编辑字符串目录
  • 渲染预览、搜索文档、运行代码片段、查看崩溃与线上性能问题
适用场景
在 macOS 上使用 Xcode 开发,希望 AI 客户端查看和修改 Xcode 项目、执行构建与测试或操作模拟器时使用。多个客户端需要共享同一个常驻 Xcode 连接时,broker 模式更合适。
运行要求
macOS 与 Xcode 26.3 或更高版本(支持 27.0)、Python 3.9-3.12,以及用于运行 PyPI 包的 uv/uvx。需在 Xcode 的 Model Context Protocol 设置中允许外部代理,在 Xcode 中打开目标项目,并批准 Xcode 的访问提示。0.5.0 不支持 MCP 2026-07-28。
安装前请注意
构建、文件编辑和设备交互等工具调用会改变项目或设备状态,验证新环境时应先使用只读调用。Xcode 可能就 broker 宿主进程和项目文件夹请求授权,提示中显示的是 Python 可执行文件和 PID,只应批准预期路径。状态显示正常或 tools/list 成功并不代表已获授权。停止 broker 守护进程会断开所有使用它的客户端。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Xcode: MCP Bridge Wrapper for Cursor,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Xcode MCP Bridge Wrapper

[Version]

[Python 3.9+] [License: MIT]

mcpbridge-wrapper connects external MCP clients to Xcode through Apple's xcrun mcpbridge. It repairs Xcode tool responses that declare an outputSchema but omit structuredContent. The repair works in both direct and broker modes. Broker mode also lets several clients share one persistent Xcode connection, reducing repeated connection prompts.

Compatibility

ComponentSupport in 0.5.0
Xcode26.3+ and 27.0 on macOS; Xcode 27.0 handshake and tool discovery verified
MCP clientsClients using the initialize lifecycle; check the protocol used by your client version
MCP 2026-07-28Not supported by 0.5.0; the sessionless implementation remains experimental on a separate branch
Python3.9-3.12; uvx manages its own environment

The wrapper does not bundle Xcode tools. It exposes the catalog returned by the installed Xcode, so tool names and availability can change with Xcode updates and permissions. The Xcode 27.0 catalog observed with build 27A266a is listed below.

Quick Start

  1. Install uv and Xcode 26.3 or newer. Xcode 27.0 is supported.
  2. In Xcode > Settings > Intelligence > Model Context Protocol, enable Allow external agents to use Xcode tools. Open the project you want to use in Xcode. See Apple's setup guide.
  3. Add one of the client configurations below. Pin 0.5.0 to keep the legacy MCP contract when a future major release becomes available.
  4. Start the client and approve the Xcode access prompt if shown. After approval, reload or reconnect the MCP server in the client so it fetches tools/list again, then verify with a real Xcode tool call. A green MCP indicator alone only confirms the handshake.

Broker mode is recommended for multiple clients. All examples use the same per-user daemon. The first client starts it; subsequent clients reuse it.

Cursor

Add to ~/.cursor/mcp.json:

json
{  "mcpServers": {    "xcode-tools": {      "command": "uvx",      "args": ["--from", "mcpbridge-wrapper==0.5.0", "mcpbridge-wrapper", "--broker"]    }  }}

Codex

Add to ~/.codex/config.toml and restart Codex:

toml
[mcp_servers.xcode-tools]command = "uvx"args = ["--from", "mcpbridge-wrapper==0.5.0", "mcpbridge-wrapper", "--broker"]

Zed

Add inside ~/.config/zed/settings.json under the top-level context_servers key, then disable and re-enable the server in Settings > AI > MCP Servers:

json
{  "context_servers": {    "xcode-tools": {      "command": "uvx",      "args": ["--from", "mcpbridge-wrapper==0.5.0", "mcpbridge-wrapper", "--broker"],      "env": {}    }  }}

See Zed's MCP configuration guide for the settings UI and server status indicator.

Claude Code

bash
claude mcp add --transport stdio xcode -- uvx --from 'mcpbridge-wrapper==0.5.0' mcpbridge-wrapper --broker

For a single client that does not need the shared daemon, remove --broker from its command to use direct mode. Manual installation and Web UI options are covered in the installation, broker, and Web UI guides.

Xcode 27.0 Approval and Verification

Xcode 27.0 may ask for permission for the broker host process and for the project folder. The prompt identifies the Python executable and PID, not the editor name. A new uvx host identity may need a fresh approval even if an older Python installation was already permitted. Approve access only when the path and project are expected.

If a tool reports that the agent is not approved, use XcodeOpenWorkspace with the absolute path of an existing .xcodeproj or .xcworkspace to request access, approve the prompt in Xcode, then retry the read-only tool. Do not treat a successful tools/list or a green client status dot as proof that Xcode tool calls are authorized. Check Xcode's state with:

bash
xcrun mcp-server statusuvx --from 'mcpbridge-wrapper==0.5.0' mcpbridge-wrapper --broker-status

The second command should show Proxy version: 0.5.0 and Daemon version: 0.5.0. If an older daemon is still running, stop it once and reconnect the clients:

bash
uvx --from 'mcpbridge-wrapper==0.5.0' mcpbridge-wrapper --broker-stop

Stopping the singleton temporarily disconnects every client using it. The next --broker connection starts a new daemon. For a stable long-lived host identity, see the dedicated broker host.

Xcode 27.0 Tools

tools/list exposed 54 tools on Xcode 27.0 build 27A266a during a local smoke test. This is an observed catalog, not a hard-coded wrapper API. Xcode 27 adds workspace creation/opening, simulator interaction, run and debugger control, build configuration, localization, and crash/field insight tools. See Apple's Xcode 27 release notes.

  • Workspaces and targets: XcodeListWorkspaces, XcodeOpenWorkspace, XcodeCloseWorkspace, XcodeNewProject, XcodeNewTarget, XcodeListTargets, XcodeListTemplates, XcodeListSchemes, XcodeSwitchScheme, XcodeListRunDestinations, XcodeSwitchRunDestination, XcodeListTestPlans, XcodeSwitchTestPlan.
  • Files and diagnostics: XcodeRead, XcodeWrite, XcodeUpdate, XcodeLS, XcodeGlob, XcodeGrep, XcodeMakeDir, XcodeMV, XcodeRM, XcodeRefreshCodeIssuesInFile.
  • Build, test, run, and debug: BuildProject, GetBuildLog, GetTestList, RunAllTests, RunSomeTests, RunProject, StopProject, GetConsoleOutput, InvokeDebuggerCommand, GetFileCompilerFlags, UpdateFileCompilerFlags, GetTargetBuildSettings, UpdateTargetBuildSetting.
  • Device interaction: DeviceInteractionStartSession, DeviceInteractionStartWorkspaceSession, DeviceInteractionInstallAndRun, DeviceInteractionSynthesize, DeviceInteractionEndSession.
  • Localization: LocalizationPlanner, StringCatalogContext, StringCatalogRead, StringCatalogEdit.
  • Crash and field insights: GetTopCrashIssues, GetCrashIssueLogs, GetTopFieldPerformanceIssues, GetFieldPerformanceIssueLogs.
  • Previews and reference: RenderPreview, DocumentationSearch, RunCodeSnippet.
  • Project metadata: AddEntitlement, AddInfoPlist.

In this catalog, the older XcodeListWindows name is absent; use XcodeListWorkspaces to inspect workspaces after Xcode approval. Tool calls such as builds, file edits, and device interaction can change project or device state. Start with read-only calls when validating a new setup.

Development

For source installation and quality gates, see Contributing. The package is also available on PyPI and in the MCP Registry.

Licensed under the MIT License.

来源:README.md,提交 20b17fa

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

2
  1. v0.5.0最新Sep 23, 2026
  2. v0.4.5Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分