Skip to content

Latest commit

 

History

184 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xdocs - Apple Developer Documentation MCP Server

Note: This is an independent project not affiliated with, endorsed by, or sponsored by Apple Inc. Documentation content is © Apple Inc. and provided for development use only.

An MCP server that gives Claude and other AI assistants instant access to Apple's complete developer documentation. 390+ frameworks, 322K+ documents, sub-3ms search.

Frameworks Documents License Twice Weekly Scrape

Quick Start

Claude Code

claude mcp add --transport http apple-docs https://xdocs.dev/mcp

Claude Desktop

  1. Open Claude Desktop
  2. Go to Settings → Connectors
  3. Click "Add custom connector"
  4. Name: apple-docs
  5. URL: https://xdocs.dev/mcp
  6. Click Add

Cursor

Add to Cursor Settings → MCP:

{
  "apple-docs": {
    "url": "https://xdocs.dev/mcp"
  }
}

VSCode

Create .vscode/mcp.json:

{
  "servers": {
    "apple-docs": {
      "type": "http",
      "url": "https://xdocs.dev/mcp"
    }
  }
}

Other MCP Clients

For stdio-only clients, use mcp-remote as a bridge:

{
  "mcpServers": {
    "apple-docs": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://xdocs.dev/mcp"]
    }
  }
}

Why?

Apple's developer documentation website uses aggressive lazy-loading, rendering only visible content in the HTML source. This makes it nearly impossible for AI systems to effectively search or reference Apple's documentation.

This project provides a complete, searchable mirror of Apple's documentation in a clean, AI-friendly format. All content is unchanged from the original source - we've simply made it accessible.

Updated automatically twice weekly (Tue/Fri) from Apple's live documentation — includes WWDC 2026 content.

Features

  • 390+ frameworks - SwiftUI, UIKit, Metal, ARKit, Core ML, and more
  • Human Interface Guidelines - Apple's design documentation for all platforms
  • Swift Language Guide - The Swift Programming Language book, API Design Guidelines, C++ Interop
  • MLX & CoreML Tools - Apple's ML framework documentation
  • Sub-3ms search - Powered by Meilisearch
  • Platform filtering - iOS, macOS, tvOS, watchOS, visionOS
  • Wildcard search - *View, UI*Controller, Button?
  • Token management - 1K-25K token budgets
  • Native HTTP - Streamable HTTP transport (no wrappers needed)

Available Tools

search_apple_docs

Search documentation with natural language queries.

query: "SwiftUI Button custom style"
framework: "SwiftUI" (optional)
platform: "ios" (optional)
limit: 10 (1-20)

expand_result

Get full documentation for a symbol.

file_path: "Button" or "documentation/SwiftUI/View.md"

list_frameworks

Browse all 390+ frameworks with document counts.

query: "UI" (optional filter)

choose_framework

Set active framework for subsequent searches.

framework: "SwiftUI" or "clear"

Self-Hosting

Docker (Recommended)

# Clone
git clone https://github.com/Averyy/apple-dev-docs.git
cd apple-dev-docs

# Configure
cp .env.example .env
# Edit .env: set MEILI_MASTER_KEY (run: openssl rand -hex 32)

# Run
cd mcp-server
docker compose up -d

# Server available at http://localhost:8000/mcp
# First run indexes ~322K docs (~15-20 minutes)

Local Development

# Install dependencies
pip install -r mcp-server/requirements.txt

# Start Meilisearch
docker run -d -p 7700:7700 \
  -e MEILI_MASTER_KEY=$(openssl rand -hex 32) \
  -v $(pwd)/meilisearch:/meili_data \
  getmeili/meilisearch:v1.49

# Index documents (~15-20 minutes)
cd scripts && python3 index_to_meilisearch.py

# Run server
cd ../mcp-server && python3 apple_docs_mcp.py

Environment Variables

Variable Required Description
MEILI_MASTER_KEY Yes Meilisearch auth key (openssl rand -hex 32)
MCP_API_KEY No API key for rate limit bypass
ALLOWED_HOSTS No Comma-separated public hostnames accepted in the Host header (default: xdocs.dev,www.xdocs.dev; localhost always allowed, others get 421)
HTTP_PORT No Server port (default: 8000)
MEILI_TIMEOUT No Meilisearch connection timeout in seconds (default: 10)
MEILI_MAX_RETRIES No Max retries for transient errors (default: 2)
RATE_LIMIT_REQUESTS No Requests per minute per IP (default: 60)
MIN_EXPECTED_DOCS No Minimum docs for "healthy" status (default: 290000)
EXPECTED_FULL_INDEX_SIZE No Expected full index size for progress calc (default: 322000)

Updating Documentation

# Clean up frameworks Apple has removed
python3 scripts/utilities/cleanup_removed_frameworks.py --dry-run  # Preview
python3 scripts/utilities/cleanup_removed_frameworks.py            # Interactive
python3 scripts/utilities/cleanup_removed_frameworks.py --yes      # Automated

# Scrape Apple framework documentation
python3 scrape.py --all --yes

# Scrape Swift language documentation (from GitHub)
python3 scripts/scrape_swift_docs.py

# Scrape MLX & CoreML Tools documentation
python3 scripts/scrape_mlx_docs.py

# Re-index to Meilisearch
cd scripts && python3 index_to_meilisearch.py

Cleanup Scripts

cleanup_removed_frameworks.py - Removes entire frameworks that Apple has deprecated:

  • Compares local frameworks against Apple's technologies.json
  • Verifies each candidate via HTTP (404 = removed, 200 = keep)
  • Safety check pings Apple's site before trusting 404s
  • Deletes both hash files and documentation folders

--cleanup-orphans --auto-cleanup flags on scrape.py - Removes individual pages within frameworks that Apple has deleted.

Requirements

  • Python 3.11+ or Docker
  • 1.5GB RAM (4GB+ recommended for indexing)
  • ~5GB disk space (1.5GB documentation + Meilisearch index + Docker image)

License

Code: MIT License Documentation Content: © Apple Inc. - For development use only

Links

About

Apple Developer Documentation MCP for AI LLM's

Resources

Stars

17 stars

Watchers

0 watching

Forks

Used by

Contributors

Languages