An MCP server providing curated Swift and SwiftUI best practices from leading iOS developers — with intelligent search, persistent memory, and optional premium integrations.
Want an Agent Skill?
If you want a without runtime tooling, check out:
An MCP server providing curated Swift and SwiftUI best practices from leading iOS sources.
Note: This repo is an MCP server only. It does not ship an Agent Skill (SKILL.md) or skill references.
What does this MCP provide?
swift-patterns-mcp delivers runtime tools for accessing Swift/SwiftUI best practices:
🔎 Search & retrieval across curated sources
🧠 Persistent memory with cross-session recall
🔄 Auto-refreshing content from RSS feeds and GitHub
🎯 Intelligent filtering by quality and relevance
🔐 Premium integrations (optional Patreon support)
Ideal for:
Active Development: "How do I implement pull-to-refresh in SwiftUI?" answered instantly without leaving your IDE
Architecture Decisions: Compare MVVM vs. TCA patterns with concrete examples from trusted sources
Staying Current: Access the latest patterns and best practices as they're published by leading iOS developers
Team Standards: Build a searchable reference of approved patterns for your organization
AI-Powered Workflows: Enable agents to query "Show me Sundell's approach to dependency injection" with consistent, quality responses
🌟 Features
🎓 Expert Knowledge Base: Patterns from Swift by Sundell, Antoine van der Lee, Nil Coalescing, and more
🔍 Intelligent Search: Query by topic, pattern, or specific iOS concept
💾 Persistent Memory: Cross-session recall with Memvid storage
🧠 Semantic Search: Optional AI-powered fallback for better conceptual matches
📚 Multiple Sources: Aggregates knowledge from trusted educators
🔄 Auto-Updates: Content refreshes automatically from RSS feeds
⚡ Fast Performance: Efficient caching and indexed search
Content Sources
Free Sources
These sources are publicly available but benefit from MCP's fetching, caching, and search capabilities:
Source
Content Type
Updates
Swift by Sundell
Articles, patterns, best practices
Weekly
SwiftLee
Tutorials, tips, deep dives
Weekly
Nil Coalescing
SwiftUI patterns, Swift tips
Weekly
Point-Free
Open-source libraries, patterns
On release
Premium Sources
Premium content requires OAuth authentication and active subscriptions:
Source
What You Get
Authentication
Patreon
Premium content from supported creators
OAuth 2.0
Access exclusive content from top iOS educators: Kavsoft, SwiftUI Codes, sucodee and many more. Get tutorials, code samples, and expert guidance directly from creators you support.
📋 Prerequisites
Node.js 18.0.0 or higher
MCP-Compatible AI Assistant: Claude Desktop, Cursor, Windsurf, VS Code with Copilot, or Claude Code
🚀 Quick Start
Run Setup
npx -y swift-patterns-mcp@latest
In an interactive terminal, this opens the setup wizard.
When launched by an MCP client (non-interactive stdio), it runs as the MCP server automatically.
Interactive Setup Wizard
npx -y swift-patterns-mcp@latest setup
If installed globally, you can also run:
swift-patterns-mcp setup
The wizard helps you choose:
Config scope (local project vs global)
MCP client (Cursor, Claude Code, Windsurf, VS Code)
Note: configured only applies to premium sources. Free sources are treated as configured by default.
Persistent Memory with Memvid
Memvid provides persistent semantic memory that improves recall across sessions. Unlike in-memory caching, Memvid stores patterns in a single-file database that persists between server restarts.
Features:
💾 Persistent Storage: Patterns stored in ~/.swift-patterns-mcp/swift-patterns-memory.mv2
🔁 Cross-Session Recall: Find patterns from previous searches after server restart
🚀 Automatic Storage: Patterns stored during searches
⚡ Fast Retrieval: Built-in BM25 + optional vector search
Configuration:
{
"memvid": {
"enabled": true, // Enable Memvid persistent memory
"autoStore": true, // Automatically store patterns during searches
"useEmbeddings": false, // Use semantic embeddings (requires model download)
"embeddingModel": "bge-small" // Options: "bge-small", "openai-small"
}
}
When to enable:
You want patterns to persist across server restarts
You frequently search for similar topics
You need cross-session semantic memory
Note: Memvid complements MiniSearch (fast in-session search) and semantic recall (in-session fallback). All three work together:
MiniSearch: Fast lexical search within current session
Semantic recall: Activates for poor lexical results (in-session)
Memvid: Cross-session persistent memory and recall
Semantic Recall (Optional AI Enhancement)
Semantic recall provides AI-powered semantic search as a fallback when keyword search returns poor results. It uses transformer embeddings to understand query intent and find conceptually similar patterns.
Features:
🧠 Automatically activates when keyword search scores are low
🎯 Uses sentence transformers to understand meaning beyond keywords
📊 Quality filtering to index only high-relevance patterns
⚡ Efficient embedding caching
Configuration:
{
"semanticRecall": {
"enabled": false, // Enable semantic recall
"minLexicalScore": 0.35, // Activate when keyword search < 0.35
"minRelevanceScore": 70 // Only index patterns with score >= 70
}
}
When to enable:
Your queries use conceptual terms that don't match exact keywords
You want more intelligent, context-aware search results
You're okay with slightly slower first-time searches (embeddings need to compute)
Note: Requires downloading a ~50MB transformer model on first use. Embeddings are cached for performance.
Environment Variables (Optional)
Patreon
All three variables are required for Patreon content fetching:
Variable
Description
PATREON_CLIENT_ID
OAuth client ID from your Patreon app
PATREON_CLIENT_SECRET
OAuth client secret from your Patreon app
YOUTUBE_API_KEY
Enables searching YouTube videos from Patreon creators. Get API key
"How can I use lazy var in @Observable classes?"
"Show me modern SwiftUI animation best practices using symbolEffect (with button + state examples)"
"Explain common SwiftUI navigation patterns (NavigationStack, NavigationPath, enum routing) and when to use each"
Advanced Queries
"Build a coordinator-style architecture for SwiftUI: MVVM + dependency injection + type-safe routing"
"Give me a clean infinite scrolling implementation: pagination, dedupe, cancellation, and loading states"
"Explain how @Observable improves SwiftUI performance vs ObservableObject, then refactor my view model to @Observable"
With Patreon Integration
"Build a SwiftUI parallax + sticky header screen like a profile page (include reusable component version)"
"Show me how to build a photo editor flow: PhotosPicker -> crop -> filters -> export/share"
"Give me 5 advanced SwiftUI micro-interactions (toasts, sheets, draggable cards, haptics) with production-ready code"
🔐 Premium Integration (Optional)
Patreon Setup
Access premium content from iOS creators you support:
Active Patreon account with at least one iOS creator subscription
Patreon Creator account (free - no need to launch a creator page)
10 minutes for one-time OAuth setup
Why Creator Account?
Patreon requires OAuth apps to be registered by creators. You don't need to launch a creator page or become an active creator - just register as one to create an OAuth app for personal use.
What You Get
✅ Access to premium tutorials and patterns from creators you support
✅ Automatic extraction of code from downloadable content
✅ Quality filtering and advanced search
✅ Multi-creator support
✅ Private, secure authentication
⚙️ Commands
# List all content sources and status
swift-patterns-mcp sources
# Interactive onboarding/configuration wizard
swift-patterns-mcp setup
# Patreon integration
swift-patterns-mcp patreon setup # Connect your Patreon account
swift-patterns-mcp patreon status # Check connection status
swift-patterns-mcp patreon reset # Clear authentication data
🗃️ How It Works
graph LR
A[AI Assistant] --> B[swift-patterns-mcp Server]
B --> C[Free Sources]
B --> D[Premium Sources]
C --> E[Swift by Sundell RSS]
C --> F[Antoine van der Lee RSS]
C --> G[Nil Coalescing RSS]
C --> H[Point-Free GitHub]
D --> I[Patreon API]
Query: Receives a query through the MCP protocol
Processing: Searches enabled sources based on the query
Content Retrieval: Fetches and parses content from RSS feeds, APIs, and cached data