xcode-mcp-bridge
Allows MCP clients to interact with Xcode's mcpbridge, exposing Xcode tools for AI agents to control and query Xcode.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@xcode-mcp-bridgeShow me the files in the current Xcode project"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Xcode MCP Bridge
让 Xcode 的 mcpbridge 以唯一进程长期稳定驻留,通过 HTTP/SSE 暴露给任意 MCP 客户端(如 WorkBuddy、Claude 等),消除反复授权弹窗。
背景:解决的两个问题
Xcode 自带的 mcpbridge 有两个缺陷,本桥针对性地修复:
# | mcpbridge 缺陷 | 桥的解法 |
1 | 对 | 桥启动时用 |
2 | 不认识 | 桥本地应答 |
效果:mcpbridge 进程永不换 PID → Xcode 只授权一次 → 不再反复弹窗。
Related MCP server: MCP Stdio to SSE Proxy
特性
🔌 单例 SSE 桥:一个
mcpbridge子进程服务多个 SSE 客户端连接🪶 零依赖:仅使用 Node 内置模块(
http/child_process/crypto)🔁 常驻自愈:launchd
KeepAlive自动重启;手动模式可搭配 watchdog📍 位置自适应:所有脚本路径由自身位置推导,clone 到任意目录直接可用
工作原理
MCP 客户端 (WorkBuddy / Claude / 其他)
│ HTTP + SSE (127.0.0.1:3811)
▼
┌──────────────────────────────────────┐
│ single-sse-bridge.js │ ← 本地应答 initialize / ping
│ (Node,零第三方依赖) │ 转发其余 JSON-RPC
└──────────────────┬───────────────────┘
│ stdio (JSON-RPC 2.0, 协议 2024-11-05)
▼
┌──────────────────────────────────────┐
│ Xcode mcpbridge 子进程(唯一) │ ← 永不换 PID
└──────────────────────────────────────┘握手流程:
桥启动 → 用
2024-11-05协议向mcpbridge发送initialize并缓存能力/服务信息桥向
mcpbridge发送notifications/initialized(协议要求,否则它不处理请求)客户端连上
/sse→ 客户端发initialize→ 桥本地应答(回显客户端协议版本)客户端发
ping→ 桥本地应答{}其余请求(
tools/list等)→ 转发mcpbridge,响应按 JSON-RPC id 回路由到对应会话
目录结构
xcode-mcp-bridge/
├── src/
│ └── single-sse-bridge.js # 桥主程序(零依赖)
├── scripts/
│ ├── install.sh # 注册 launchd 常驻服务(推荐)
│ ├── start.sh # 手动启动(nohup 后台)
│ ├── stop.sh # 停止
│ ├── status.sh # 健康检查
│ └── xcode-mcp-bridge-watchdog.sh # 手动模式看门狗(每 8s 自愈)
├── launchd/
│ └── com.user.xcode-mcp-bridge.plist # launchd 模板(占位符,install.sh 渲染)
├── logs/ # 运行日志(已被 .gitignore 忽略)
├── package.json # 元数据 + npm scripts(无第三方依赖)
├── CHANGELOG.md
└── README.md环境要求
macOS(需 Xcode,含
Contents/Developer/usr/bin/mcpbridge)Node.js >= 18(推荐 LTS 20;脚本自动探测
node,兼容 nvm)
快速开始
0. 获取代码
git clone git@github.com:qianshang/xcode-mcp-bridge.git
cd xcode-mcp-bridge1. 安装(launchd 常驻模式,推荐)
bash scripts/install.sh脚本会自动完成:探测 node 绝对路径 → 渲染 plist 到 ~/Library/LaunchAgents/ → launchctl bootstrap → 健康检查。
2. 验证
curl http://127.0.0.1:3811/healthz # 期望输出: ok
bash scripts/status.sh # 期望输出: bridge OK3. Xcode 侧配置(两步 GUI)
Xcode > Settings > Intelligence > Model Context Protocol,打开 "Allow external agents to use Xcode tools"
首次连接时,Xcode 弹出的权限对话框点 Allow(之后不再反复弹窗)
4. 在 MCP 客户端中接入
SSE 端点:http://127.0.0.1:3811/sse
常用命令
命令 | 说明 |
| 注册 / 重装 launchd 常驻服务 |
| 手动启动(后台 nohup) |
| 停止 |
| 健康检查 |
| 手动模式自愈看门狗 |
说明:
start.sh/watchdog.sh通过NODE=/path/to/node环境变量可指定 Node 可执行文件。
常见问题
Q: healthz 返回 DOWN?
A: 先确认 Xcode 已打开;再查看 logs/bridge.log。launchd 模式下若持续失败可运行 bash scripts/start.sh 观察输出。
Q: 端口被占用?
A: lsof -i :3811 查看占用进程,确认没有旧桥进程残留后重启。
Q: 仍反复弹授权框?
A: 确认只有一个桥进程(bash scripts/status.sh 正常 + pgrep -f single-sse-bridge 仅 1 个)。多个桥进程会导致 mcpbridge 换 PID。
开源许可
贡献
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-quality-maintenanceBridges STDIO-based MCP clients with SSE-based MCP servers, allowing applications like Claude Desktop to connect to remote MCP servers that use SSE transport.9
- Alicense-qualityDmaintenanceActs as a proxy between a local Stdio connection and a remote Model Context Protocol server running over Server-Sent Events. It specifically enables Stdio-based MCP clients to connect to the SwiftZilla remote SSE endpoint.7ISC
- Flicense-qualityDmaintenanceA bridge that enables MCP clients like Cascade and Windsurf to interact with tools and features within JetBrains IDEs. It facilitates communication between the client and the IDE via an SSE connection on a dedicated local port.
- Alicense-qualityDmaintenanceExposes any stdio-based MCP server to the internet via HTTP/SSE transport, enabling remote agents to access MCP tools over a network.16MIT
Related MCP Connectors
MCP connector for iMessage & Contacts via a local Mac agent + Vercel relay
MCP server for Appcircle mobile CI/CD platform.
MCP server for interacting with the Supabase platform
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/qianshang/xcode-mcp-bridge'
If you have feedback or need assistance with the MCP directory API, please join our Discord server