Hi Apple,
I’m exploring the built-in MCP support in Xcode 27 and noticed that the available Xcode MCP tools don’t seem to provide a way for an agent to manage Swift Package dependencies.
For example, an agent can inspect and modify source code, build the project, run tests, and diagnose build issues. However, I haven’t found an MCP tool that allows the agent to perform operations such as:
- Add a Swift Package dependency to an Xcode project
- Remove a Swift Package dependency
- Add/remove a package product from a target
- Change the version/branch/revision requirement of a package dependency
For example, I’d like to be able to give an agent an instruction such as:
Add https://github.com/xxx/SomePackage.git to the project, use version 1.2.0 or later, and link the SomePackage product to the MyApp target.
At the moment, it appears that the agent can identify that the package is missing when compilation fails, but it cannot actually perform the package configuration step through the Xcode MCP tools.
Is Swift Package dependency management intentionally not exposed through Xcode MCP at this time?
If it is not currently supported, are there plans to expose APIs/tools for managing:
- Package dependencies
- Package products
- Target-package relationships
- Package version requirements
This would be particularly useful for coding agents, since adding a dependency is a common part of an otherwise automated development workflow.
I've submitted a request to feedback, the id is FB24676163.
Thanks!