
使 Xcode 26.3 的 MCP 兼容光标及其他严格遵守 MCP 规范的客户端
概览
mcpbridge-wrapper 通过苹果的 xcrun mcpbridge 将外部 MCP 客户端连接到 Xcode。它修复声明 outputSchema 但省略 structuredContent 的 Xcode 工具响应。该修复在直接模式和代理模式中均有效。代理模式还允许多个客户端共享一个持久的 Xcode 连接,减少重复的连接提示。 包装器确实捆绑了 Xcode 工具。它会暴露已安装 Xcode 返回的目录,因此工具名称和可用性可以随着 Xcode 更新和权限而更改。在 build 27A266a 中观察到的 Xcode 27.0 目录如下。 1. 安装 uv 和 Xcode 26.3 或更新版本。支持 Xcode 27.0。2. 在 中启用。在 Xcode 中打开你想使用的项目。请参阅苹果的设置指南。3. 添加以下一个客户端配置。在未来主要版本可用时,将 Pin 0.5.0 保留遗留 MCP 合同。4. 启动客户端并批准 Xcode 访问提示(如显示)。
概述(AI 翻译)
mcpbridge-wrapper 通过苹果的 X 连接外部 MCP 客户端到 Xcode
[xcrun mcpbridge。它修复了声明
outputSchema,但省略structuredContent。修复在两者中都可直接生效
以及代理模式。代理模式还允许多个客户端共享一个持久化
Xcode连接,减少了重复的连接提示。
兼容性
| 组件 | 0.5.0 中的支持 |
|---|---|
| Xcode | macOS 上的 26.3+ 和 27.0;Xcode 27.0 握手和工具发现验证 |
| MCP客户端 | 使用initialize生命周期的客户端;检查你客户端版本所使用的协议 |
| MCP 2026-07-28 | 0.5.0 不支持无会话实现仍处于实验阶段,存在于独立分支 |
| Python | 3.9-3.12;uvx 管理自己的环境 |
包装器不捆绑Xcode工具。它暴露的是返回的目录 因此工具名称和可用性可以随Xcode更改 更新和权限。Xcode 27.0目录在构建[[T6]中被观察到 如下所示。
快速启动
- 安装UV和 Xcode 26.3或更新版本。支持Xcode 27.0。
- 在 Xcode > 设置中 > 智能 >模型上下文协议,启用
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Xcode MCP Bridge Wrapper
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
| Component | Support in 0.5.0 |
|---|---|
| Xcode | 26.3+ and 27.0 on macOS; Xcode 27.0 handshake and tool discovery verified |
| MCP clients | Clients using the initialize lifecycle; check the protocol used by your client version |
| MCP 2026-07-28 | Not supported by 0.5.0; the sessionless implementation remains experimental on a separate branch |
| Python | 3.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
- Install uv and Xcode 26.3 or newer. Xcode 27.0 is supported.
- 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.
- Add one of the client configurations below. Pin
0.5.0to keep the legacy MCP contract when a future major release becomes available. - 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/listagain, 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:
{
"mcpServers": {
"xcode-tools": {
"command": "uvx",
"args": ["--from", "mcpbridge-wrapper==0.5.0", "mcpbridge-wrapper", "--broker"]
}
}
}
Codex
Add to ~/.codex/config.toml and restart Codex:
[mcp_servers.xcode-tools]
command = "uvx"
args = ["--from", "mcpbridge-wrapper==0.5.0", "mcpbridge-wrapper", "--broker"]
Zed
安装
uvx --from mcpbridge-wrapper==0.5.0 mcpbridge-wrapper --broker配置
{
"mcpServers": {
"xcode-tools": {
"command": "uvx",
"args": ["--from", "mcpbridge-wrapper==0.5.0", "mcpbridge-wrapper", "--broker"]
}
}
}