Labsco
angelodipaolo logo

DocC MCP

โ˜… 2

from angelodipaolo

Exposes Apple DocC documentation archives to AI agents, enabling real-time access to Swift documentation.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeQuick setup

docc-mcp

A Model Context Protocol (MCP) server that exposes Apple DocC documentation archives to AI agents, enabling real-time access to Swift documentation without requiring training data or massive context windows.

Features

  • ๐Ÿ” Search Documentation: Find symbols, types, functions across all DocC archives
  • ๐Ÿ“– Symbol Details: Get detailed information about specific Swift symbols
  • ๐Ÿ“„ Article Access: Get detailed information about tutorials and articles
  • ๐Ÿ—‚๏ธ Browse Archives: Navigate DocC archive structures interactively
  • โšก Real-time Access: Query current documentation without stale data
  • ๐ŸŽฏ Filtered Search: Search by symbol type (class, struct, enum, protocol, etc.)

Archive Structure

The server expects DocC archives in directories specified by --archive-path:

Testing

Run the test script to validate functionality:

node test-server.js

This will:

  • List all available archives
  • Test search functionality
  • Browse archive structures
  • Validate symbol retrieval

Example Queries

Find all SwiftUI navigation components:

{
  "name": "search_docc",
  "arguments": {
    "query": "navigation",
    "type": "struct"
  }
}

Get details about TokenSyntax:

{
  "name": "get_symbol",
  "arguments": {
    "symbolId": "documentation/swiftsyntax/tokensyntax", 
    "archive": "SwiftSyntax"
  }
}

Browse SwiftSyntax types:

{
  "name": "browse_archive",
  "arguments": {
    "archive": "SwiftSyntax",
    "path": "documentation/swiftsyntax"
  }
}

Performance

  • Caching: Archives and symbols are cached for fast repeated access
  • Search limits: Results limited to 50 per query for performance
  • Lazy loading: Archives loaded on-demand
  • File limits: Search limited to 100 files per archive for performance

DocC Integration

This server works with standard DocC archives. To generate compatible archives:

# Using Swift-DocC
swift package generate-documentation --target MyLibrary

# Using Xcode
# Product โ†’ Build Documentation

Supported DocC Features

  • โœ… Symbol metadata (title, kind, role, platforms)
  • โœ… Documentation hierarchy
  • โœ… Symbol references and relationships
  • โœ… Code declarations with syntax highlighting
  • โœ… Abstract/summary text
  • โœ… Platform availability information
  • โœ… Module organization