Apple Documentation Crawler & MCP Server A Swift-based tool to crawl, index, and serve Apple's developer documentation to AI agents via the Model Context Protocol (MCP). Cupertino is a local, structured, AI-ready documentation system for Apple platforms. It: - Crawls Apple Developer documentation, Swift.org, Swift Evolution proposals, Human Interface Guidelines, Apple Archive legacy guides, and Sw
Add this skill
npx mdskills install mihaelamj/cupertinoWell-documented MCP server providing offline Apple documentation search with comprehensive setup guides
Apple Documentation Crawler & MCP Server
A Swift-based tool to crawl, index, and serve Apple's developer documentation to AI agents via the Model Context Protocol (MCP).
Cupertino is a local, structured, AI-ready documentation system for Apple platforms. It:
Note: When building from source, commands must be run from the
Packagesdirectory. The one-command install works from anywhere.
Building from source additionally requires Swift 6.2+ and Xcode 16.0+
One-command install (recommended):
bash **Note:** Use `/opt/homebrew/bin/cupertino` for Homebrew on Apple Silicon, `/usr/local/bin/cupertino` for Intel or manual install. Run `which cupertino` to find your path.
2. **Restart Claude Desktop**
3. **Ask Claude about Apple APIs:**
- "Search for SwiftUI documentation"
- "What does Swift Evolution proposal SE-0001 propose?"
- "List available frameworks"
### Use with Claude Code
If you're using [Claude Code](https://code.claude.com/docs/en/overview), you can add Cupertino as an MCP server with a single command:
```bash
claude mcp add cupertino --scope user -- $(which cupertino)
This registers Cupertino globally for all your projects. Claude Code will automatically have access to Apple documentation search.
If you're using OpenAI Codex, add Cupertino with:
codex mcp add cupertino -- $(which cupertino) serve
Or add directly to ~/.codex/config.toml:
[mcp_servers.cupertino]
command = "/opt/homebrew/bin/cupertino" # Homebrew on Apple Silicon
# command = "/usr/local/bin/cupertino" # Intel Mac or manual install
args = ["serve"]
Tip: Run
which cupertinoto find your installation path.
Add to .cursor/mcp.json in your project (or ~/.cursor/mcp.json for global access):
{
"mcpServers": {
"cupertino": {
"command": "/opt/homebrew/bin/cupertino",
"args": ["serve"]
}
}
}
Add to .vscode/mcp.json in your workspace:
{
"servers": {
"cupertino": {
"type": "stdio",
"command": "/opt/homebrew/bin/cupertino",
"args": ["serve"]
}
}
}
Add to your Zed settings.json:
{
"context_servers": {
"cupertino": {
"command": "/opt/homebrew/bin/cupertino",
"args": ["serve"]
}
}
}
Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"cupertino": {
"command": "/opt/homebrew/bin/cupertino",
"args": ["serve"]
}
}
}
Add to opencode.jsonc:
{
"mcp": {
"cupertino": {
"type": "local",
"command": ["/opt/homebrew/bin/cupertino", "serve"]
}
}
}
Note: All examples use
/opt/homebrew/bin/cupertino(Homebrew on Apple Silicon). Use/usr/local/bin/cupertinofor Intel Macs or manual installs. Runwhich cupertinoto find your path.
Once configured, Claude Desktop can search your local documentation:
Search Results Example:
# Search Results for "SwiftUI"
Found **20** results:
## 1. NSHostingView | Apple Developer Documentation
- **Framework:** `swiftui`
- **URI:** `apple-docs://swiftui/documentation_swiftui_nshostingview`
- **Score:** 1.82
An AppKit view that hosts a SwiftUI view hierarchy.
## 2. UIHostingController | Apple Developer Documentation
- **Framework:** `swiftui`
- **URI:** `apple-docs://swiftui/documentation_swiftui_uihostingcontroller`
A UIKit view controller that manages a SwiftUI view hierarchy.
...
Framework Statistics:
| Framework | Documents |
|---|---|
| Kernel | 39,396 |
| Matter | 24,320 |
| Swift | 17,466 |
| AppKit | 12,443 |
| Foundation | 12,423 |
| UIKit | 11,158 |
| Accelerate | 9,114 |
| SwiftUI | 7,062 |
| ... | ... |
| 307 Frameworks | 302,424 |
Apple Developer Documentation (301,000+ pages)
Swift Evolution Proposals (~400 proposals)
Swift.org Documentation
Swift Package Metadata
Apple Sample Code (606 projects)
Apple Archive Legacy Guides (~75 pages)
--include-archive)Human Interface Guidelines
Cupertino includes pre-indexed catalog data bundled directly into the application:
Swift Packages Catalog (9,699 packages)
Sample Code Catalog (606 entries)
Priority Packages (36 curated packages)
These catalogs are indexed during cupertino save and enable instant search without requiring multi-hour downloads. You can still fetch package READMEs and sample code separately via cupertino fetch if needed.
apple-docs://{framework}/{page}swift-evolution://{proposal-id}hig://{category}/{page}cupertino save):
search_docs - Full-text search across all documentation
query (required), source, framework, min_ios, min_macos, include_archive, limit (all optional)search_hig - Search Human Interface Guidelines
query (required), platform (optional), category (optional), limit (optional)list_frameworks - List available frameworksread_document - Read document by URI with format option
uri (required), format (optional: json or markdown, default: json)cupertino index):
search_samples - Search sample code projects and fileslist_samples - List all indexed sample projectsread_sample - Read sample project README and metadataread_sample_file - Read specific source file from a sample| Command | Description |
|---|---|
cupertino | Start MCP server (default) |
cupertino setup | Download pre-built databases from GitHub |
cupertino serve | Start MCP server |
cupertino fetch | Download documentation |
cupertino save | Build search index |
cupertino search | Search documentation from CLI |
cupertino read | Read full document by URI |
cupertino doctor | Check server health |
cupertino index | Index sample code for search |
cupertino cleanup | Clean up sample code archives |
See docs/commands/ for detailed usage and options.
Cupertino uses an ExtremePackaging architecture with 9 consolidated packages:
Foundation Layer:
โโ MCP # Consolidated MCP framework (Protocol + Transport + Server)
โโ Logging # os.log infrastructure
โโ Shared # Configuration & models
Infrastructure Layer:
โโ Core # Crawler & downloaders
โโ Search # SQLite FTS5 search
Application Layer:
โโ MCPSupport # Resource providers
โโ SearchToolProvider # Search tool implementations
โโ Resources # Embedded resources
Executables:
โโ CLI # Unified cupertino binary
โโ TUI # Terminal UI (cupertino-tui)
โโ MockAIAgent # Testing tool (mock-ai-agent)
1. Fetch: cupertino fetch --type docs
โ
WKWebView โ HTML โ Markdown โ disk (~/.cupertino/docs/)
2. Save: cupertino save
โ
Markdown files โ SQLite FTS5 index (~/.cupertino/search.db)
3. Serve: cupertino serve
โ
MCP Server (stdio) โ JSON-RPC โ Claude Desktop
โ
DocsResourceProvider + CupertinoSearchToolProvider
# Show all available commands
make help
# Common tasks
make build # Build release binaries
sudo make install # Install to /usr/local/bin
sudo make update # Rebuild and reinstall
make test # Run all tests
make clean # Clean build artifacts
# Development workflow
make test-unit # Fast unit tests only
make test-integration # All tests (includes network calls)
make format # Format code with SwiftFormat
make lint # Lint with SwiftLint
Test Suite:
Test Categories:
Cupertino uses os.log for structured logging:
# View all logs
log show --predicate 'subsystem == "com.cupertino"' --last 1h
# View specific category
log show --predicate 'subsystem == "com.cupertino" AND category == "crawler"' --last 1h
# Stream live logs
log stream --predicate 'subsystem == "com.cupertino"'
Categories: crawler, mcp, search, cli, transport, pdf, evolution, samples
| Operation | Time | Size |
|---|---|---|
| Build CLI | 10-15s | 4.3MB |
| Crawl 301,000+ pages | 12+ days | 2-3GB |
| Swift Evolution | 2-5 min | 429 proposals |
| Swift.org docs | 5-10 min | 501 pages |
| Build search index | 2-5 min | ~160MB |
| Search query | <100ms | - |
The crawler respects Apple's servers with a 0.5 second default delay between each request (configurable):
Use cupertino setup to download pre-built databases instead (~30 seconds).
This is a one-time operation. Incremental updates use change detection to skip unchanged pages and complete much faster.
# Download everything for offline access
cupertino fetch --type docs --max-pages 15000
cupertino fetch --type evolution
cupertino save
# Just SwiftUI documentation
cupertino fetch --type docs \
--start-url "https://developer.apple.com/documentation/swiftui" \
--max-pages 500
# Serve documentation to Claude
cupertino serve
# Then ask Claude: "How do I use @Observable in SwiftUI?"
# Multiple sources with custom paths
cupertino fetch --type docs --output-dir ~/docs/apple
cupertino fetch --type evolution --output-dir ~/docs/evolution
cupertino save --base-dir ~/docs --search-db ~/docs/search.db
cupertino serve --docs-dir ~/docs/apple --search-db ~/docs/search.db
Each command has detailed documentation:
Issues and pull requests are welcome! I'd love to hear how you're using Cupertino with your AI workflow.
For questions and discussion, use GitHub Discussions.
I prefer collaboration over competition โ if you're working on something similar, let's find ways to work together.
Don't hesitate to submit a PR because of code style. I'd rather have your contribution than perfect formatting.
By participating in this project you agree to abide by the Contributor Covenant Code of Conduct.
For development setup, see DEVELOPMENT.md.
Version: 0.9.1 Status: ๐ง Active Development
MIT License - see LICENSE for details
The docs and sample-code repositories will be used by the planned make install (full) command (see #52), providing pre-built documentation and sample code to avoid the initial 20+ hour crawl.
Note: This tool is for educational and development purposes. Respect Apple's Terms of Service when using their documentation.
Install via CLI
npx mdskills install mihaelamj/cupertinoCupertino is a free, open-source AI agent skill. Apple Documentation Crawler & MCP Server A Swift-based tool to crawl, index, and serve Apple's developer documentation to AI agents via the Model Context Protocol (MCP). Cupertino is a local, structured, AI-ready documentation system for Apple platforms. It: - Crawls Apple Developer documentation, Swift.org, Swift Evolution proposals, Human Interface Guidelines, Apple Archive legacy guides, and Sw
Install Cupertino with a single command:
npx mdskills install mihaelamj/cupertinoThis downloads the skill files into your project and your AI agent picks them up automatically.
Cupertino works with Claude Code, Claude Desktop, Cursor, Vscode Copilot, Windsurf, Continue Dev, Codex, Gemini Cli, Amp, Roo Code, Goose, Opencode, Trae, Qodo, Command Code. Skills use the open SKILL.md format which is compatible with any AI coding agent that reads markdown instructions.