Apple Doc MCP 是一个模型上下文协议(MCP)服务器,它能让你在 AI 代码助手内无缝访问苹果开发者文档。
Apple Doc MCP 服务器可让你在 AI 代码助手中直接访问苹果开发者文档。以下是使用该服务器的基本步骤:
*, ?),可在所有苹果框架中查找符号。git clone https://github.com/MightyDillah/apple-doc-mcp.git
cd apple-doc-mcp
npm install
npm run build
此命令会编译 TypeScript 代码,并在 dist/ 文件夹中创建可执行服务器。
~/.config/claude/claude_desktop_config.jsonCmd/Ctrl + ,)→ 扩展 → MCP~/.continue/config.json{
"mcpServers": {
"apple-doc-mcp": {
"command": "node",
"args": ["/path/to/apple-doc-mcp/dist/index.js"]
}
}
}
⚠️ 重要提示:
请将
/path/to/apple-doc-mcp替换为你克隆仓库的实际路径。
💡 使用建议:
在 macOS/Linux 系统中,可在
apple-doc-mcp文件夹内运行pwd命令获取绝对路径。
配置完成后,只需自然地与你的 AI 助手交流即可。以下是一些示例:
"Use apple-doc-mcp to list all current Apple frameworks"
"Get the latest available Apple technologies from Apple's docs"
"Search Apple documentation for all available frameworks"
"Use apple-doc-mcp to browse SwiftUI framework structure"
"Get current UIKit topics from Apple documentation"
"Search Apple docs for Foundation framework details"
"Search Apple's SwiftUI docs for drag and drop APIs"
"Use apple-doc-mcp to find RPBroadcast* classes in ReplayKit"
"Look up current *View* symbols across Apple frameworks"
"Find all *Controller classes in UIKit using Apple docs"
"Get the latest SwiftUI View protocol docs from Apple"
"Use apple-doc-mcp to look up UIViewController documentation"
"Search Apple's current docs for NSURLSession details"
AI 会自动使用 MCP 工具获取最新的苹果文档并提供全面的答案。
list_technologies浏览所有可用的苹果框架和技术。
get_documentation获取符号或框架的详细文档(自动检测类型)。
path(必需):文档路径(如 "documentation/SwiftUI/View")或框架名称(如 "SwiftUI")示例:
{"path": "SwiftUI"}
{"path": "documentation/SwiftUI/View"}
{"path": "Foundation"}
search_symbols使用高级过滤功能在苹果框架中搜索符号。
query(必需):支持通配符的搜索查询framework(可选):在特定框架内搜索symbolType(可选):按符号类型过滤(类、协议、结构体等)platform(可选):按平台过滤(iOS、macOS 等)maxResults(可选):最大结果数(默认:20)示例:
{"query": "RPBroadcast*"}
{"query": "*Controller", "framework": "UIKit"}
{"query": "*View*", "platform": "iOS", "maxResults": 5}
check_updates检查 Git 仓库是否有可用更新。
暂未提供相关许可证信息。
list_technologies - 浏览所有苹果框架get_documentation - 获取符号或框架文档(自动处理两种情况)search_symbols - 使用通配符和过滤器进行搜索check_updates - 通过 Git 检查仓库更新dist/index.js 位置。dist 目录,无需构建步骤。node /path/to/apple-doc-mcp/dist/index.js"*View*" 而非 "View"。maxResults 以加快响应速度。如果你发现了 bug 或想添加新功能,欢迎贡献代码!
详细指南请参阅 CONTRIBUTING.md。