@getcmd/spm依赖关系mcp
一个MCP服务器,用于在Xcode和SPM项目中搜索和探索SPM依赖关系。
SPM依赖项的代码位于隐藏文件夹中,通常在其他目录中(DerivedData 等等)。如果需要,编码代理无法轻松访问它。此MCP解决了这一差距。
配置
{
"mcpServers": {
"spm-dependencies": {
"command": "npx",
"args": ["-y", "@getcmd/spm-dependencies-mcp"]
}
}
}工具
list_dependencies列出项目/包使用的依赖项、它们解析到的版本以及在磁盘上的位置search使用ripgrep搜索依赖关系。任意参数都可以转发到ripgrep。list-files依赖关系中的列表read使用sed在依赖关系中搜索文件。任意参数都可以转发给sed。
CLI使用情况
通过MCP服务器提供的工具可以在CLI中直接访问:
$ npx -y @getcmd/spm-dependencies-mcp --help
Search Swift Package Manager dependencies
Usage: spm-dependencies-mcp [COMMAND]
Commands:
list-dependencies List all dependencies for a Swift project
search Search through dependencies using ripgrep
list-files List files in a dependency
read Read a file from a dependency using sed
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
-V, --version Print version