jihongboo/dsh-apple-mode
Xcode AI integration mode for DeepSeek Harness (dsh) — an agent preset + installer that gives your DSH sessions the full Xcode AI stack.
已收录
1
Tools
Bundle 已验证
预览
功能介绍
DSH 的 Xcode AI 集成:26 个 Xcode MCP 工具(mcpbridge)+ Apple 平台技能 + Xcode Intelligence 风格 persona(agent preset 或全局 bundle)。
适合
- 希望 DSH 通过 Xcode MCP 工具工作的 Swift 与 Apple 平台开发者。
- 受益于本地生成 Apple 平台技能和 Xcode Intelligence 风格 Agent persona 的 Xcode 项目。
- 希望只在主动选择 Apple Mode 的会话中加载 Xcode 工具、避免其他会话承担 schema 开销的用户。
- 可以接受每个会话都暴露 Xcode 工具的专用 Apple 开发 profile。
不适合
- 非 macOS 环境,或未安装 Xcode 26 及以上版本的系统。
- 无法保持 Xcode 运行并打开目标项目,或无法批准 MCP 访问的自动化。
- 不需要 Apple 工具的通用 DSH 会话,尤其是全局安装会让每次请求都携带约 26 个工具 schema。
- 假设 Xcode 文件写入仍受 DSH 文件沙箱约束的工作流;MCP 写操作走工具审批并直接影响真实项目文件。
README
dsh-apple-mode
Xcode AI integration mode for DeepSeek Harness (dsh) — an agent preset + installer that gives your DSH sessions the full Xcode AI stack:
-
26 Xcode MCP tools (
mcp__xcode__*) via Apple’s officialmcpbridge -
Xcode Intelligence–style persona (Swift-first, tool-assisted, explain-vs-change classification) adapted from the
IDEIntelligenceChatprompt templates - 10 Apple platform skills (SwiftUI, App Intents, security hardening, bounds safety, …) generated locally from your own Xcode
📌
dsh-plugintopic repo. DeepSeek Harness is in developer preview — pin an exactdshversion for your automation.
Why a preset (mode) instead of a global MCP wiring?
The three capabilities map onto three different DSH mechanisms:
| Layer | Capability | DSH mechanism |
|---|---|---|
| Execute | 26 mcp__xcode__* tools |
dsh-mcp-client (mounted inside the preset) |
| Knowledge | 10 Apple skills |
dsh-skill-filesystem (global, lazy-loaded) |
| Behavior | Xcode Intelligence persona | agent preset (this repo) |
Wiring the MCP server globally would put ~26 large tool schemas (~6k+ tokens/request) into every session. Mounting it inside a preset keeps the cost only in sessions that opt in — pick Apple Mode when creating a session, and you get the whole stack; other sessions stay lean.
Requirements
- macOS
-
DeepSeek Harness:
npx @deepseek-ai/dsh web - Xcode 26+ (contains
mcpbridgeandxcrun agent skills export). To use the MCP tools, Xcode must be running with the target project open, and you must click Allow on the MCP access dialog Xcode shows (see Usage).
Install
git clone https://github.com/jihongboo/dsh-apple-mode.git
cd dsh-apple-mode
./install.sh
install.sh does three things:
-
Detects your Xcode installs and lets you choose which one provides
mcpbridge(see below). - Installs the
appleagent preset →~/.dsh/.agent-presets/apple/(existing copy is backed up). - Generates the 10 Xcode AI skills on your machine via
xcrun agent skills exportand merges them into~/.agents/skills/(the DSH skill root, hot-reloaded by the filesystem watcher).
Why no vendored skills? The skills are Apple-authored guidance. Generating them from your own Xcode at install time avoids redistributing Apple content — the repo ships only our own code, config, and docs.
Choosing an Xcode (multiple installs)
If you have several Xcode versions (e.g. Xcode.app, Xcode-beta.app, Xcode-26.2.app), mcpbridge lives in each one’s Contents/Developer/usr/bin — and only in Xcode 26+. install.sh scans /Applications for every install that provides it and prompts you to pick:
Found Xcode installs providing mcpbridge:
1) /Applications/Xcode-beta.app/Contents/Developer (xcode-select default)
2) /Applications/Xcode.app/Contents/Developer
Choose (1-2, default 1):
-
Default = the Xcode selected by
xcode-select→ the preset usescommand: xcrun mcpbridge(portable; follows futurexcode-selectchanges). -
Pick another → the chosen
…/Contents/Developer/usr/bin/mcpbridgeis baked into the installed preset as an absolute path. -
Non-interactive:
./install.sh --xcode /Applications/Xcode.app(or--xcode …/Contents/Developer);./install.sh --list-xcodesprints the candidates. -
Switch at runtime without reinstalling:
./install.sh --runtime-selectableinstallsbin/mcpbridgeas the command; setDSH_XCODE_DEVELOPER_DIR=/Applications/…/Contents/Developerwhen launchingdshto switch. (Resolution:DSH_XCODE_DEVELOPER_DIR→xcrun→ newest/Applications/Xcode*.app.) -
Drive a specific running Xcode instance: add
env: { MCP_XCODE_PID: '<pid>' }to themcp-xcoderow of the installed preset.
To change the choice later: re-run ./install.sh, edit the mcp-xcode row in ~/.dsh/.agent-presets/apple/agent.cordis.yml, or use the runtime env var above.
Alternative: global bundle (MCP in every session)
dsh plugin --profile web add "github:jihongboo/dsh-apple-mode"
Installs the cordis.patch.yml bundle, which wires the Xcode MCP server into every session of the profile — no preset selection needed, at the cost of the tool-schema tokens in all sessions. Use one install path, not both: each registers serverName: xcode, and a duplicate server name fails the later instance at load. See docs/global-mcp.md.
Usage
- Restart
dsh(or just open a new session — the preset can only be selected on a blank session). - Pick Apple Mode as the agent preset when creating the session.
- The session now has:
-
mcp__xcode__*tools — operate the open Xcode workspace:XcodeRead/Write/Update/MV/RM,XcodeGlob/Grep/LS,UpdateTargetBuildSetting/UpdateFileCompilerFlags,XcodeListNavigatorIssues, scheme/run-destination/test-plan switching,XcodeNewTarget,StringCatalogRead/Edit, … - All Apple platform skills (lazy-loaded on demand).
- An Apple-first, tool-assisted working style.
-
Before using the
mcp__xcode__*tools:
- Xcode must be running with the project/workspace you want to work on opened in it.
- On first connection, Xcode shows an MCP access dialog — click Allow (允许). Until you do, tool calls will be rejected.
Build/run/test still happen from the terminal (xcodebuild, pipe through xcsift for structured output); the MCP toolset covers project surgery, build settings, diagnostics, destinations, and localization.
What you get
MCP tools (26, namespaced mcp__xcode__*)
| Group | Tools |
|---|---|
| Project I/O |
XcodeRead XcodeWrite XcodeUpdate XcodeMV XcodeRM XcodeMakeDir
|
| Search |
XcodeGlob XcodeGrep XcodeLS
|
| Targets & settings |
XcodeNewTarget XcodeListTemplates XcodeListTargets UpdateTargetBuildSetting UpdateFileCompilerFlags
|
| Scheme / destination / tests |
XcodeListSchemes XcodeSwitchScheme XcodeListRunDestinations XcodeSwitchRunDestination XcodeListTestPlans XcodeSwitchTestPlan
|
| Diagnostics |
XcodeListNavigatorIssues XcodeRefreshCodeIssuesInFile
|
| Localization |
StringCatalogRead StringCatalogEdit
|
| Windows |
XcodeListWindows XcodeGetCurrentFile
|
Skills (10, generated at install time)
swiftui-specialist · swiftui-whats-new-27 · app-intents-specialist · app-intents-whats-new-27 · audit-xcode-security-settings · adopt-c-bounds-safety · uikit-app-modernization · modernize-tests · device-interaction · building-document-based-swiftui-applications
Repository layout
.
├── presets/apple/ # The agent preset: agent.cordis.yml + preset.yml
├── bin/mcpbridge # Runtime-selectable mcpbridge launcher (--runtime-selectable)
├── cordis.patch.yml # Global-MCP bundle patch (dsh plugin add)
├── package.json # Bundle manifest (dsh.bundle.patch)
├── docs/
│ ├── XCODE_AI_INTEGRATION.md # Full integration notes (Chinese)
│ └── global-mcp.md # Alternative: wire the MCP server into every session
├── install.sh # Xcode picker + preset install + local skills generation
├── uninstall.sh
└── LICENSE # MIT
Customization
-
Different Xcode: re-run
./install.sh(picker),./install.sh --xcode <path>(non-interactive),--runtime-selectable+DSH_XCODE_DEVELOPER_DIR, or addenv: { MCP_XCODE_PID: '<pid>' }to themcp-xcoderow to drive a specific running instance. See Choosing an Xcode. -
Persona: edit the
personarow text in the same file. -
Sync skills after Xcode updates: re-run
./install.sh(skills are replaced, preset is backed up). -
Keep in sync with upstream
standardpreset:diffagainstnode_modules/@deepseek-ai/dsh/config/agent-presets/standard/agent.cordis.yml.
Security notes
- MCP tool calls do not go through the DSH file sandbox — they go through the tool-approval flow.
XcodeUpdate/XcodeWritemodify real Xcode project files (includingproject.pbxproj). - The preset only activates when you select it; no global config is touched by
install.sh.
Contributing
PRs welcome. Open an issue for feature requests. If you publish your own DSH extension, add the dsh-plugin topic for discoverability and consider submitting it to awesome-dsh-plugin.
License
MIT. The Xcode AI skills are generated on your machine from your own Xcode installation and remain subject to Apple’s license; the persona prompt style is adapted from Xcode Intelligence templates (behavioral guidance, not Apple source text).
常见问题常见问题
在启用了 DSH 的终端中执行已验证命令 dsh plugin --profile default add github:jihongboo/dsh-apple-mode。命令会解析公开 package 元数据,并保持插件与本页展示的目录身份一致。
兼容性以页面上展示的 bundle 与 profile 状态为准。如果某个 profile 尚未检测到,请先保持禁用,并在生产启用前阅读仓库文档。
GitHub 链接和 activity 元数据是 release 与维护状态的来源。新版本发布后重新查看本页,确认目录已经观察到最新版本。