### Framework Exploration Examples Source: https://github.com/kimsungwhee/apple-docs-mcp/blob/main/README.md These examples illustrate how to explore the structure, index, and hierarchy of different Apple frameworks. ```text "Show me SwiftUI framework API index" "List all UIKit classes and methods" "Browse ARKit framework structure" "Get WeatherKit API hierarchy" "Explore Core ML model loading APIs" "Show Vision framework image analysis APIs" ``` -------------------------------- ### Documentation Access Examples Source: https://github.com/kimsungwhee/apple-docs-mcp/blob/main/README.md Examples showing how to retrieve detailed information and related APIs for various Apple frameworks and classes. ```text "Get detailed information about the SwiftUI framework" "Show me withAnimation API with related APIs" "Get platform compatibility for SwiftData" "Access UIViewController documentation with similar APIs" "Show me NSManagedObjectContext documentation" "Get URLSession async/await methods" ``` -------------------------------- ### Development Setup for Apple Docs MCP Source: https://github.com/kimsungwhee/apple-docs-mcp/blob/main/README.md Clone the repository and install dependencies for development. pnpm is recommended for installation and building. ```bash git clone https://github.com/kimsungwhee/apple-docs-mcp.git cd apple-docs-mcp # Using pnpm (recommended) pnpm install && pnpm run build # Using npm npm install && npm run build ``` -------------------------------- ### Documentation Updates Examples Source: https://github.com/kimsungwhee/apple-docs-mcp/blob/main/README.md Examples for retrieving information about the latest WWDC updates, release notes, and new features. ```text "Show me the latest WWDC updates" "What's new in SwiftUI?" "Get technology updates for iOS" "Show me release notes for Xcode" "Find beta features in the latest updates" ``` -------------------------------- ### Get Technology Overviews Source: https://context7.com/kimsungwhee/apple-docs-mcp/llms.txt Access technology guides with `get_technology_overviews`. Filter by `category` and `platform`. Use `searchQuery` for specific topics and `includeSubcategories` to broaden the search. ```jsonc { "name": "get_technology_overviews", "arguments": { "category": "ai-machine-learning", // "app-design-and-ui" | "games" | "augmented-reality" | ... "platform": "ios", // "all" | "ios" | "macos" | "watchos" | "tvos" | "visionos" "searchQuery": "getting started", "includeSubcategories": true, "limit": 30 } } ``` ```typescript // TypeScript const overviews = await server.getTechnologyOverviews( "ai-machine-learning", "ios", "getting started", true, 30 ); ``` -------------------------------- ### Smart Search Examples Source: https://github.com/kimsungwhee/apple-docs-mcp/blob/main/README.md These examples demonstrate how to use the MCP for searching specific Apple API documentation and concepts. ```text "Search for SwiftUI animations" "Find withAnimation API documentation" "Look up async/await patterns in Swift" "Show me UITableView delegate methods" "Search Core Data NSPersistentContainer examples" "Find AVFoundation video playback APIs" ``` -------------------------------- ### API Discovery Examples Source: https://github.com/kimsungwhee/apple-docs-mcp/blob/main/README.md Examples for finding related APIs, alternatives, and references within Apple's documentation. ```text "Find APIs related to UIViewController" "Show me similar APIs to withAnimation" "Get all references from SwiftData documentation" "Discover alternatives to Core Data NSManagedObject" ``` -------------------------------- ### Development Build and Run MCP Server Source: https://context7.com/kimsungwhee/apple-docs-mcp/llms.txt Build and run the Apple Docs MCP server from source. This process involves cloning the repository, installing dependencies, building the project, and then starting the server. ```bash # Development build from source git clone https://github.com/kimsungwhee/apple-docs-mcp.git cd apple-docs-mcp pnpm install && pnpm run build node dist/index.js # starts the MCP server on stdio ``` -------------------------------- ### Technology & Platform Analysis Examples Source: https://github.com/kimsungwhee/apple-docs-mcp/blob/main/README.md Demonstrates how to query for technology lists, framework availability, and platform compatibility information. ```text "List all Beta frameworks in iOS 26" "Show me Graphics & Games technologies" "What machine learning frameworks are available?" "Analyze platform compatibility for Vision framework" ``` -------------------------------- ### Extract WWDC Code Examples by Filter Source: https://context7.com/kimsungwhee/apple-docs-mcp/llms.txt Extract all code examples from WWDC sessions that match specified filters such as framework, topic, year, or language. Supports a limit for the number of results. ```jsonc { "name": "get_wwdc_code_examples", "arguments": { "framework": "SwiftData", "topic": "swiftui-ui-frameworks", "year": "2023", "language": "swift", "limit": 20 } } ``` ```swift @Model class Trip { var name: String; var destination: String } let container = try ModelContainer(for: Trip.self) ``` ```swift @Model class BucketListItem { @Attribute(.spotlight) var title: String } ``` -------------------------------- ### Global Installation of MCP Server Source: https://context7.com/kimsungwhee/apple-docs-mcp/llms.txt Install the Apple Docs MCP server globally using pnpm. It is recommended to use pnpm for package management. ```bash # Global install (pnpm recommended) pnpm add -g @kimsungwhee/apple-docs-mcp ``` -------------------------------- ### Run Development Server with Auto-Reload Source: https://github.com/kimsungwhee/apple-docs-mcp/blob/main/README.md Use this command to start the development server with auto-reloading enabled for faster iteration. Requires pnpm or npm. ```bash # Development with auto-reload pnpm run dev # or: npm run dev ``` -------------------------------- ### Install Apple Docs MCP Globally Source: https://github.com/kimsungwhee/apple-docs-mcp/blob/main/README.md Install the Apple Docs MCP package globally using either pnpm (recommended) or npm. ```bash # Using pnpm (recommended) pnpm add -g @kimsungwhee/apple-docs-mcp # Using npm npm install -g @kimsungwhee/apple-docs-mcp ``` -------------------------------- ### Search Apple Docs Output Example Source: https://context7.com/kimsungwhee/apple-docs-mcp/llms.txt Example of the expected markdown text output from the `search_apple_docs` tool. It includes ranked results with URLs, types, and abstracts for the queried term. ```markdown // Expected output (markdown text): // ## Search Results for "NSPersistentContainer" // // ### NSPersistentContainer // **Type:** Class **Framework:** Core Data // **URL:** https://developer.apple.com/documentation/coredata/nspersistentcontainer // A container that encapsulates the Core Data stack in your application. // // ### NSPersistentContainer (SwiftData) // ... ``` -------------------------------- ### Retrieve Specific WWDC Video Content Source: https://context7.com/kimsungwhee/apple-docs-mcp/llms.txt Get the full content for a specific WWDC session, including metadata, transcript with timestamps, all code examples, and linked resources. Requires year and video ID. ```jsonc { "name": "get_wwdc_video", "arguments": { "year": "2023", "videoId": "10187", // session number "includeTranscript": true, "includeCode": true } } ``` ```swift import SwiftData @Model class Trip { var name: String var destination: String var startDate: Date var endDate: Date } ``` -------------------------------- ### Test MCP Server Directly Source: https://github.com/kimsungwhee/apple-docs-mcp/blob/main/README.md This command starts the MCP server directly from the compiled JavaScript files for local testing. ```bash # Test the MCP server directly node dist/index.js ``` -------------------------------- ### Get Sample Code Projects Source: https://context7.com/kimsungwhee/apple-docs-mcp/llms.txt Use this tool to browse Apple's official sample code projects. You can filter by framework, keyword, and beta status. It returns project titles, descriptions, and direct URLs. ```jsonc { "name": "get_sample_code", "arguments": { "framework": "ARKit", "beta": "exclude", // "include" | "exclude" | "only" "searchQuery": "face tracking", "limit": 20 } } ``` ```typescript const samples = await server.getSampleCode("ARKit", "exclude", "face tracking", 20); ``` -------------------------------- ### Search WWDC Videos and Transcripts Source: https://context7.com/kimsungwhee/apple-docs-mcp/llms.txt Perform a full-text search across WWDC video transcripts and code examples from 2014-2025. This tool uses locally bundled data for zero network latency and no rate limits. ```jsonc { "name": "search_wwdc_content", "arguments": { "query": "async await concurrency", "searchIn": "both", // "transcript" | "code" | "both" "year": "2021", // restrict to specific WWDC year "language": "swift", // code language filter "limit": 10 } } ``` ```typescript // handleSearchWWDCContent("async await concurrency", "both", "2021", "swift", 10) ``` ```swift func loadImage() async throws -> UIImage { ... } ``` -------------------------------- ### Get Documentation Updates Source: https://context7.com/kimsungwhee/apple-docs-mcp/llms.txt Track API updates with `get_documentation_updates`. Filter by `category`, `technology`, `year`, or `searchQuery`. Set `includeBeta` to true to include beta information. ```jsonc { "name": "get_documentation_updates", "arguments": { "category": "wwdc", // "all" | "wwdc" | "technology" | "release-notes" "technology": "SwiftUI", // exact framework name (case-sensitive) "year": "2025", // WWDC year filter "searchQuery": "Observable", // keyword search "includeBeta": true, "limit": 20 } } ``` ```typescript // TypeScript const updates = await server.getDocumentationUpdates( "wwdc", "SwiftUI", "2025", "Observable", true, 20 ); ``` -------------------------------- ### Drill into a specific WWDC topic Source: https://context7.com/kimsungwhee/apple-docs-mcp/llms.txt To get sessions for a specific topic, use the `browse_wwdc_topics` tool with `topicId`, `includeVideos`, `year`, and `limit` arguments. The `topicId` should be the machine-readable identifier for the topic. ```jsonc // Drill into one topic { "name": "browse_wwdc_topics", "arguments": { "topicId": "machine-learning-ai", "includeVideos": true, "year": "2024", "limit": 20 } } ``` -------------------------------- ### Get Platform Compatibility Source: https://context7.com/kimsungwhee/apple-docs-mcp/llms.txt Retrieve platform availability for APIs using `get_platform_compatibility`. Set `compareMode` to "framework" to check an entire framework and `includeRelated` to also check related APIs. ```jsonc { "name": "get_platform_compatibility", "arguments": { "apiUrl": "https://developer.apple.com/documentation/swiftdata", "compareMode": "framework", // "single" | "framework" "includeRelated": true // also check related APIs' compatibility } } ``` ```typescript // TypeScript const compat = await server.getPlatformCompatibility( "https://developer.apple.com/documentation/swiftdata", "framework", false ); ``` -------------------------------- ### Create and use a custom MemoryCache instance Source: https://context7.com/kimsungwhee/apple-docs-mcp/llms.txt Instantiate `MemoryCache` with a maximum number of entries and a TTL in milliseconds. Basic `get` and `set` operations are supported, with optional custom TTL for individual entries. ```typescript import { MemoryCache, apiCache, generateUrlCacheKey } from './src/utils/cache.js'; // Custom instance: 200 entries, 15-minute TTL const myCache = new MemoryCache(200, 15 * 60 * 1000); // Basic get/set myCache.set("key1", { data: "value" }, 60_000); // custom 1-min TTL const val = myCache.get<{ data: string }>("key1"); // typed retrieval ``` -------------------------------- ### Search Apple Docs Tool Call Source: https://context7.com/kimsungwhee/apple-docs-mcp/llms.txt Example of an MCP tool call to search Apple Developer Documentation. This JSON structure is sent by the AI host to the server, specifying the query and the type of documentation to search. ```json // MCP tool call (as sent by the AI host) { "name": "search_apple_docs", "arguments": { "query": "NSPersistentContainer", "type": "documentation" // "all" | "documentation" | "sample" } } ``` -------------------------------- ### Get Related APIs with get_related_apis Source: https://context7.com/kimsungwhee/apple-docs-mcp/llms.txt Use `get_related_apis` to analyze API relationships, including inheritance, protocol conformances, and 'See Also' recommendations. ```jsonc { "name": "get_related_apis", "arguments": { "apiUrl": "https://developer.apple.com/documentation/uikit/uiviewcontroller", "includeInherited": true, // superclass methods/properties "includeConformance": true, // protocol requirements fulfilled "includeSeeAlso": true // Apple's curated "See Also" links } } ``` -------------------------------- ### Get Related APIs with TypeScript Source: https://context7.com/kimsungwhee/apple-docs-mcp/llms.txt The TypeScript equivalent for fetching related APIs using `get_related_apis`, showing how to enable analysis of inherited methods, protocol conformances, and 'See Also' links. ```typescript // TypeScript const related = await server.getRelatedApis( "https://developer.apple.com/documentation/uikit/uiviewcontroller", true, true, true ); ``` -------------------------------- ### Build Project for Production Source: https://github.com/kimsungwhee/apple-docs-mcp/blob/main/README.md Execute this command to create a production-ready build of the project. Requires pnpm or npm. ```bash # Build for production pnpm run build # or: npm run build ``` -------------------------------- ### Test with Sample Queries Source: https://github.com/kimsungwhee/apple-docs-mcp/blob/main/README.md Run this command to test the MCP server with sample queries using the provided CLI tool. ```bash # Test with sample queries npx @kimsungwhee/apple-docs-mcp --test ``` -------------------------------- ### List all WWDC topics Source: https://context7.com/kimsungwhee/apple-docs-mcp/llms.txt Use the `browse_wwdc_topics` tool to list all available WWDC topic categories and their video counts. No arguments are required. ```jsonc // List all topics { "name": "browse_wwdc_topics", "arguments": {} } ``` -------------------------------- ### Initialize and Use HttpClient Source: https://context7.com/kimsungwhee/apple-docs-mcp/llms.txt Shows how to use the singleton httpClient for fetching JSON and text, with options for timeouts, retries, and custom headers. This client includes automatic User-Agent rotation and performance telemetry. ```typescript import { httpClient } from './src/utils/http-client.js'; // Fetch JSON (auto-retries on 5xx, rotates UA per attempt) const json = await httpClient.getJson( "https://developer.apple.com/tutorials/data/documentation/swiftui/view.json" ); // Fetch HTML (sets text/html Accept header automatically) const html = await httpClient.getText( "https://developer.apple.com/search/?q=URLSession", { timeout: 15_000, retries: 2, retryDelay: 500, headers: { "X-Custom": "value" } } ); // Monitor performance at runtime const stats = httpClient.getPerformanceStats(); // Get formatted markdown report const report = httpClient.getPerformanceReport(); // Check concurrency queue status const status = httpClient.getStatus(); // UA pool status (bundled into same report) const uaStats = httpClient.getUserAgentPoolStats(); ``` -------------------------------- ### Initialize and Use UserAgentPool Source: https://context7.com/kimsungwhee/apple-docs-mcp/llms.txt Demonstrates initializing a UserAgentPool with custom strategies and reporting success/failure of User-Agent requests. Use this to manage a dynamic set of User-Agents for requests. ```typescript import { UserAgentPool } from './src/utils/user-agent-pool.js'; import { SAFARI_USER_AGENTS } from './src/utils/constants.js'; const pool = new UserAgentPool([...SAFARI_USER_AGENTS], { strategy: 'smart', disableDuration: 5 * 60 * 1000, failureThreshold: 3, minSuccessRate: 0.5, }); // Get next User-Agent (respects current strategy) const ua = await pool.getNextUserAgent(); // Report outcomes back to the pool await pool.markSuccess(ua); await pool.markFailure(ua, 429); // Pool-wide statistics const stats = pool.getStats(); // Per-agent breakdown const agentStats = pool.getAgentStats(); ``` -------------------------------- ### Fetch Documentation with TypeScript Source: https://context7.com/kimsungwhee/apple-docs-mcp/llms.txt The TypeScript equivalent for fetching documentation using `get_apple_doc_content`, demonstrating how to pass arguments for enhanced analysis. ```typescript // TypeScript equivalent const doc = await server.getAppleDocContent( "https://developer.apple.com/documentation/swiftui/view", true, // includeRelatedApis false, // includeReferences false, // includeSimilarApis true // includePlatformAnalysis ); ``` -------------------------------- ### Configure HttpClient Headers via Environment Variables Source: https://context7.com/kimsungwhee/apple-docs-mcp/llms.txt Shows how to control various HTTP headers, such as Sec-Fetch, DNT, Language, and Accept-Language, using environment variables. This enables fine-grained control over request headers for different scenarios. ```bash # Header generation controls export DISABLE_SEC_FETCH=true # omit Sec-Fetch-* headers export DISABLE_DNT=true # omit DNT header export DISABLE_LANGUAGE_ROTATION=true # always use en-US export SIMPLE_HEADERS_MODE=true # minimal header set export DEFAULT_ACCEPT_LANGUAGE="ja-JP,ja;q=0.9,en;q=0.8" ``` -------------------------------- ### Configure UserAgentPool via Environment Variables Source: https://context7.com/kimsungwhee/apple-docs-mcp/llms.txt Illustrates how to configure the UserAgentPool's strategy, rotation, and custom pools using environment variables. This allows for runtime adjustments without code modification. ```bash # User-Agent pool strategy: "random" (default) | "sequential" | "smart" export USER_AGENT_POOL_STRATEGY=smart # Disable UA rotation entirely (uses static default Safari UA) export USER_AGENT_ROTATION_ENABLED=false # Override max retries export USER_AGENT_MAX_RETRIES=5 # Provide a fully custom UA pool as JSON export USER_AGENT_POOL_CONFIG='[ {"userAgent": "MyApp/1.0 (compatible)", "weight": 3, "maxUsageCount": 1000}, {"userAgent": "MyApp/2.0 (advanced)", "weight": 2, "maxUsageCount": 800} ]' ``` -------------------------------- ### List WWDC Videos by Topic and Code Availability Source: https://context7.com/kimsungwhee/apple-docs-mcp/llms.txt Browse the WWDC video library, filtering by year, topic category, and code availability. This tool leverages bundled offline data for instant responses. ```jsonc { "name": "list_wwdc_videos", "arguments": { "year": "2024", "topic": "swiftui-ui-frameworks", // exact topic ID or keyword "hasCode": true, "limit": 25 } } ``` -------------------------------- ### List all WWDC years Source: https://context7.com/kimsungwhee/apple-docs-mcp/llms.txt The `list_wwdc_years` tool retrieves a list of all available WWDC years in the dataset, along with the count of videos for each year. No arguments are needed. ```jsonc { "name": "list_wwdc_years", "arguments": {} } ``` -------------------------------- ### Run All Tests Source: https://github.com/kimsungwhee/apple-docs-mcp/blob/main/tests/README.md Execute all tests in the project using the pnpm test command. ```bash pnpm test ``` -------------------------------- ### Configure Apple Docs MCP in Cursor Source: https://github.com/kimsungwhee/apple-docs-mcp/blob/main/README.md Add this JSON configuration to your `~/.cursor/mcp.json` file to set up the Apple Docs MCP server in Cursor. ```json { "mcpServers": { "apple-docs": { "command": "npx", "args": ["-y", "@kimsungwhee/apple-docs-mcp"] } } } ``` -------------------------------- ### Configure Apple Docs MCP in Zed Source: https://github.com/kimsungwhee/apple-docs-mcp/blob/main/README.md Add this JSON configuration to your Zed `settings.json` to set up the Apple Docs MCP server. ```json { "context_servers": { "Apple Docs": { "command": { "path": "npx", "args": ["-y", "@kimsungwhee/apple-docs-mcp"] }, "settings": {} } } } ``` -------------------------------- ### Fetch Documentation with get_apple_doc_content Source: https://context7.com/kimsungwhee/apple-docs-mcp/llms.txt Use `get_apple_doc_content` to fetch documentation JSON for a given URL. Optionally enrich the response with related APIs, resolved cross-references, similar APIs, and platform compatibility. ```jsonc // Basic fetch { "name": "get_apple_doc_content", "arguments": { "url": "https://developer.apple.com/documentation/swiftui/view" } } ``` ```jsonc // Full enhanced analysis { "name": "get_apple_doc_content", "arguments": { "url": "https://developer.apple.com/documentation/swiftui/view", "includeRelatedApis": true, // inheritance + protocol conformances "includeReferences": true, // resolved types used in the doc "includeSimilarApis": true, // functionally similar APIs "includePlatformAnalysis": true // iOS/macOS/watchOS/tvOS/visionOS availability } } ``` -------------------------------- ### Configure Apple Docs MCP for Windows Source: https://github.com/kimsungwhee/apple-docs-mcp/blob/main/README.md This JSON configuration is for setting up the Apple Docs MCP server on Windows systems. ```json { "mcpServers": { "apple-docs": { "command": "cmd", "args": ["/c", "npx", "-y", "@kimsungwhee/apple-docs-mcp"], "disabled": false, "autoApprove": [] } } } ``` -------------------------------- ### Configure Apple Docs MCP in Cline Source: https://github.com/kimsungwhee/apple-docs-mcp/blob/main/README.md Add this JSON configuration to your `cline_mcp_settings.json` file to set up the Apple Docs MCP server in Cline. ```json { "mcpServers": { "apple-docs": { "command": "npx", "args": ["-y", "@kimsungwhee/apple-docs-mcp"], "disabled": false, "autoApprove": [] } } } ``` -------------------------------- ### Run Tests with Coverage Source: https://github.com/kimsungwhee/apple-docs-mcp/blob/main/tests/README.md Generate a test coverage report by adding the -- --coverage flag to the pnpm test command. ```bash pnpm test -- --coverage ``` -------------------------------- ### Configure Claude Desktop with Apple Docs MCP Server Source: https://github.com/kimsungwhee/apple-docs-mcp/blob/main/README.md Add this configuration to your Claude Desktop settings to enable access to the Apple Docs MCP server. Ensure you are using the latest version by appending '@latest' if necessary. ```json { "mcpServers": { "apple-docs": { "command": "npx", "args": ["-y", "@kimsungwhee/apple-docs-mcp"] } } } ``` ```json { "mcpServers": { "apple-docs": { "command": "npx", "args": ["-y", "@kimsungwhee/apple-docs-mcp@latest"] } } } ``` -------------------------------- ### Configure Logging via Environment Variables Source: https://context7.com/kimsungwhee/apple-docs-mcp/llms.txt Demonstrates setting the NODE_ENV environment variable to control logging levels. Setting it to 'development' enables debug-level logging for the HTTP client. ```bash # Logging export NODE_ENV=development # enables debug-level logging ``` -------------------------------- ### Import and use pre-configured MemoryCache instances Source: https://context7.com/kimsungwhee/apple-docs-mcp/llms.txt Import and use various pre-configured `MemoryCache` instances exported for different data types, each with specific entry limits and TTLs. ```typescript // Pre-configured exports (ready to use) import { apiCache, searchCache, indexCache, technologiesCache, updatesCache, sampleCodeCache, technologyOverviewsCache, wwdcDataCache, } from './src/utils/cache.js'; ``` -------------------------------- ### Run Specific Test File Source: https://github.com/kimsungwhee/apple-docs-mcp/blob/main/tests/README.md Execute a single test file by providing its path to the pnpm test command. ```bash pnpm test tests/tools/search-framework-symbols.test.ts ``` -------------------------------- ### Configure Custom UserAgent Pool Source: https://github.com/kimsungwhee/apple-docs-mcp/blob/main/README.md Set custom UserAgent configurations and rotation strategies using environment variables. Ensure NODE_ENV is set to development for debugging. ```bash export USER_AGENT_POOL_CONFIG='[ {"userAgent": "MyApp/1.0 (compatible)", "weight": 3, "maxUsageCount": 1000}, {"userAgent": "MyApp/2.0 (advanced)", "weight": 2, "maxUsageCount": 800} ]' export USER_AGENT_POOL_STRATEGY=smart export NODE_ENV=development ``` -------------------------------- ### List Technologies with list_technologies Source: https://context7.com/kimsungwhee/apple-docs-mcp/llms.txt Use `list_technologies` to browse the Apple technology catalog. Filter by category, programming language, and beta status. Returns framework names, identifiers, and availability info. ```jsonc { "name": "list_technologies", "arguments": { "category": "App frameworks", // "Graphics and games" | "App services" | "Media" | "System" | ... "language": "swift", // "swift" | "occ" (Objective-C) — omit for all "includeBeta": false, // exclude iOS 26 / macOS 26 beta frameworks "limit": 50 } } ``` -------------------------------- ### Run Apple Docs MCP Directly Source: https://github.com/kimsungwhee/apple-docs-mcp/blob/main/README.md Execute the Apple Docs MCP package directly using npx to view its help information. ```bash npx @kimsungwhee/apple-docs-mcp --help ``` -------------------------------- ### Run Tests with Verbose Output Source: https://github.com/kimsungwhee/apple-docs-mcp/blob/main/tests/README.md Enable verbose output for tests, showing detailed information about test execution, by adding the -- --verbose flag. ```bash pnpm test -- --verbose ``` -------------------------------- ### Find related WWDC videos Source: https://context7.com/kimsungwhee/apple-docs-mcp/llms.txt Use the `find_related_wwdc_videos` tool to discover videos related to a given `videoId`. You can specify whether to include explicitly recommended videos, same-topic sessions, and same-year sessions. ```jsonc { "name": "find_related_wwdc_videos", "arguments": { "videoId": "10187", "year": "2023", "includeExplicitRelated": true, // Apple's curated "Related Videos" "includeTopicRelated": true, // other sessions in same topic "includeYearRelated": false, // other WWDC23 sessions (noisy) "limit": 10 } } ``` -------------------------------- ### Perform Type Checking Source: https://github.com/kimsungwhee/apple-docs-mcp/blob/main/README.md Run this command to ensure type safety across the project. Requires pnpm or npm and TypeScript. ```bash # Type checking pnpm exec tsc --noEmit # or: npx tsc --noEmit ``` -------------------------------- ### Clean Build Artifacts Source: https://github.com/kimsungwhee/apple-docs-mcp/blob/main/README.md Use this command to remove generated build files and clean the project directory. Requires pnpm or npm. ```bash # Clean build artifacts pnpm run clean # or: npm run clean ``` -------------------------------- ### Configure MCP Server for AI Hosts Source: https://context7.com/kimsungwhee/apple-docs-mcp/llms.txt Configure the server in your AI host's MCP config file. This JSON configuration works for Claude Desktop, Cursor, VS Code, Windsurf, Zed, and Cline. ```json // ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) // %APPDATA%\Claude\claude_desktop_config.json (Windows) { "mcpServers": { "apple-docs": { "command": "npx", "args": ["-y", "@kimsungwhee/apple-docs-mcp@latest"] } } } ``` -------------------------------- ### Generate URL cache keys and use pre-configured caches Source: https://context7.com/kimsungwhee/apple-docs-mcp/llms.txt Generate cache keys based on URLs and optional parameters using `generateUrlCacheKey`. Utilize pre-configured cache instances like `apiCache` for common caching needs. ```typescript // URL-keyed cache (used throughout the codebase) const cacheKey = generateUrlCacheKey( "https://developer.apple.com/documentation/swiftui/view", { includeRelatedApis: true, includeReferences: false } ); apiCache.set(cacheKey, documentData); ``` -------------------------------- ### Windows MCP Server Configuration Source: https://context7.com/kimsungwhee/apple-docs-mcp/llms.txt Configuration for the Apple Docs MCP server on Windows, using a cmd wrapper for the npx command. This ensures compatibility within the Windows command prompt environment. ```json # Windows variant (use cmd wrapper) # "command": "cmd", "args": ["/c", "npx", "-y", "@kimsungwhee/apple-docs-mcp"] ``` -------------------------------- ### Find Similar APIs Source: https://context7.com/kimsungwhee/apple-docs-mcp/llms.txt Discover API alternatives with `find_similar_apis`. Use `searchDepth` for the extent of the search and `includeAlternatives` to find modern replacements for deprecated APIs. ```jsonc { "name": "find_similar_apis", "arguments": { "apiUrl": "https://developer.apple.com/documentation/uikit/uialertview", "searchDepth": "deep", // "shallow" | "medium" | "deep" "filterByCategory": "Alerts", // optional category focus "includeAlternatives": true } } ``` ```typescript // TypeScript const similar = await server.findSimilarApis( "https://developer.apple.com/documentation/uikit/uialertview", "deep", undefined, true ); ``` -------------------------------- ### Git Workflow for Contributions Source: https://github.com/kimsungwhee/apple-docs-mcp/blob/main/README.md Standard Git commands for forking the repository, creating a feature branch, committing changes, and pushing to a new branch for a Pull Request. ```git # Fork the repository # Create a feature branch: `git checkout -b feature/amazing-feature` # Commit your changes: `git commit -m 'Add amazing feature'` # Push to the branch: `git push origin feature/amazing-feature` # Open a Pull Request ``` -------------------------------- ### Search Framework Symbols with TypeScript Source: https://context7.com/kimsungwhee/apple-docs-mcp/llms.txt The TypeScript equivalent for searching framework symbols using `search_framework_symbols`, demonstrating parameter usage for framework, symbol type, name pattern, language, and limit. ```typescript // TypeScript const symbols = await server.searchFrameworkSymbols("SwiftUI", "struct", "List*", "swift", 30); ``` -------------------------------- ### Run Tests in Watch Mode Source: https://github.com/kimsungwhee/apple-docs-mcp/blob/main/tests/README.md Continuously run tests and re-run them automatically on file changes by using the -- --watch flag. ```bash pnpm test -- --watch ``` -------------------------------- ### List Technologies with TypeScript Source: https://context7.com/kimsungwhee/apple-docs-mcp/llms.txt The TypeScript equivalent for listing technologies using `list_technologies`, showing how to specify filters and limits. ```typescript // TypeScript const techs = await server.listTechnologies("App frameworks", "swift", false, 50); ``` -------------------------------- ### Register MCP Server via Claude Code CLI Source: https://context7.com/kimsungwhee/apple-docs-mcp/llms.txt Register the Apple Docs MCP server using the Claude Code CLI. This command-line approach is an alternative to editing configuration files directly. ```bash # Claude Code CLI claude mcp add apple-docs -- npx -y @kimsungwhee/apple-docs-mcp@latest ``` -------------------------------- ### Configure Apple Docs MCP in VS Code Source: https://github.com/kimsungwhee/apple-docs-mcp/blob/main/README.md Add this JSON configuration to your VS Code MCP settings to integrate the Apple Docs MCP server. ```json { "mcp": { "servers": { "apple-docs": { "type": "stdio", "command": "npx", "args": ["-y", "@kimsungwhee/apple-docs-mcp"] } } } } ``` -------------------------------- ### Search Apple Docs Server-Side Call Source: https://context7.com/kimsungwhee/apple-docs-mcp/llms.txt Equivalent server-side call in TypeScript for the `search_apple_docs` tool. This demonstrates how the server processes the search request internally. ```typescript // Equivalent server-side call (TypeScript) const results = await server.searchAppleDocs("NSPersistentContainer", "documentation"); ``` -------------------------------- ### Add Apple Docs MCP to Claude Code Source: https://github.com/kimsungwhee/apple-docs-mcp/blob/main/README.md Use this command to add the Apple Docs MCP server to Claude Code. ```bash claude mcp add apple-docs -- npx -y @kimsungwhee/apple-docs-mcp@latest ``` -------------------------------- ### search_apple_docs Source: https://context7.com/kimsungwhee/apple-docs-mcp/llms.txt Searches Apple Developer Documentation by API name, framework, or technical term. It utilizes Apple's official search endpoint and returns ranked results including URLs, types, and abstracts. This tool is ideal for locating specific symbols, classes, or methods before fetching their full documentation. ```APIDOC ## Tool: `search_apple_docs` ### Description Search Apple Developer Documentation by API name, framework, or technical term. Uses Apple's official search endpoint and returns ranked results with URLs, types, and abstracts. Best for locating specific symbols, classes, or methods before fetching full docs. ### Parameters #### Query Parameters - **query** (string) - Required - The search term for documentation. - **type** (string) - Optional - The type of documentation to search for. Allowed values: "all", "documentation", "sample". Defaults to "documentation" if not specified. ### Request Example (MCP tool call) ```json { "name": "search_apple_docs", "arguments": { "query": "NSPersistentContainer", "type": "documentation" } } ``` ### Response Example (markdown text) ```markdown ## Search Results for "NSPersistentContainer" ### NSPersistentContainer **Type:** Class **Framework:** Core Data **URL:** https://developer.apple.com/documentation/coredata/nspersistentcontainer A container that encapsulates the Core Data stack in your application. ### NSPersistentContainer (SwiftData) ... ``` ``` -------------------------------- ### Implement cache-aside pattern with MemoryCache Source: https://context7.com/kimsungwhee/apple-docs-mcp/llms.txt Use `getOrSet` to fetch data from a source if it's not already in the cache, setting a specified TTL. This pattern ensures data is fetched only when necessary. ```typescript // Cache-aside pattern const result = await myCache.getOrSet( "doc:swiftui-view", () => fetch("https://developer.apple.com/tutorials/data/documentation/swiftui/view.json") .then(r => r.json()), 30 * 60 * 1000 // 30 min TTL ); ``` -------------------------------- ### Search Framework Symbols with search_framework_symbols Source: https://context7.com/kimsungwhee/apple-docs-mcp/llms.txt Use `search_framework_symbols` to find symbols within a specific Apple framework. Supports wildcard name patterns and type filtering. ```jsonc { "name": "search_framework_symbols", "arguments": { "framework": "SwiftUI", "symbolType": "struct", // "all" | "class" | "struct" | "enum" | "func" | "var" "namePattern": "List*", // wildcard — matches ListView, ListStyle, etc. "language": "swift", // "swift" | "occ" "limit": 30 } } ``` -------------------------------- ### Resolve References in Batch Source: https://context7.com/kimsungwhee/apple-docs-mcp/llms.txt Use `resolve_references_batch` to map types and symbols within a documentation page. Specify `maxReferences` to limit results and `filterByType` to narrow down the search. ```jsonc { "name": "resolve_references_batch", "arguments": { "sourceUrl": "https://developer.apple.com/documentation/swiftui/view", "maxReferences": 20, // 1–50, default 20 "filterByType": "protocol" // "all" | "symbol" | "collection" | "article" | "protocol" | "class" | "struct" | "enum" } } ``` ```typescript // TypeScript const refs = await server.resolveReferencesBatch( "https://developer.apple.com/documentation/swiftui/view", 20, "protocol" ); ``` -------------------------------- ### Access MemoryCache statistics Source: https://context7.com/kimsungwhee/apple-docs-mcp/llms.txt Retrieve statistics for a cache instance, including its current size, maximum capacity, hit rate, total hits, and misses. ```typescript // Statistics const stats = apiCache.getStats(); // { size: 42, maxSize: 500, hitRate: "87.50%", hits: 175, misses: 25 } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.