swift-patterns-mcp
Provides access to curated Swift and SwiftUI patterns, best practices, and code examples for iOS application development.
Integrates with Patreon to unlock and access premium iOS development content from supported creators via OAuth authentication.
Aggregates and automatically synchronizes the latest Swift development articles and patterns from trusted creator RSS feeds.
Offers a knowledge base of curated Swift code examples, architectural patterns, and design principles from community experts.
Integrates with YouTube via API to fetch and index iOS development tutorials and educational content.
swift-patterns-mcp
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 lightweight, portable Swift/SwiftUI best-practices package without runtime tooling, check out:
swift-patterns-skill: Designed as a portable Agent Skill focused on Swift/SwiftUI patterns, architecture guidance, and decision-making frameworks.
Key difference:
swift-patterns-skill = Static guidance (portable, no runtime)
swift-patterns-mcp = Dynamic tooling (search, retrieval, premium features)
Note: This repo is an MCP server only. It does not ship an Agent Skill (SKILL.md) or skill references.
Related MCP server: Swift MCP Server
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@latestIn 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 setupIf installed globally, you can also run:
swift-patterns-mcp setupThe wizard helps you choose:
Config scope (local project vs global)
MCP client (Cursor, Claude Code, Windsurf, VS Code)
Optional Patreon setup prompt
Non-interactive Setup (CI/Scripts)
# Cursor
npx -y swift-patterns-mcp@latest setup --cursor --global
npx -y swift-patterns-mcp@latest setup --cursor --local
# Claude Code
npx -y swift-patterns-mcp@latest setup --claude --global
# Windsurf
npx -y swift-patterns-mcp@latest setup --windsurf --global
# VS Code
npx -y swift-patterns-mcp@latest setup --vscode --local
# All clients
npx -y swift-patterns-mcp@latest setup --all --globalUse --global (-g) or --local (-l) to skip the location prompt.
Use --cursor, --claude, --windsurf, --vscode, or --all to skip the client prompt.
Configure Your AI Assistant
Cursor
Or manually add to Cursor Settings β Tools β MCP Servers:
.cursor/mcp.json:
{
"mcpServers": {
"swift-patterns": {
"command": "npx",
"args": ["-y", "swift-patterns-mcp@latest"]
}
}
}Alternatively, add to ~/.cursor/mcp.json. See Cursor documentation for details.
Claude Code
Run in your terminal:
claude mcp add swift-patterns -- npx -y swift-patterns-mcp@latestOr manually add to .mcp.json:
{
"mcpServers": {
"swift-patterns": {
"command": "npx",
"args": ["-y", "swift-patterns-mcp@latest"]
}
}
}Restart Claude Code and run /mcp to verify. See Claude Code MCP documentation for details.
Windsurf
Add to .windsurf/mcp.json:
{
"mcpServers": {
"swift-patterns": {
"command": "npx",
"args": ["-y", "swift-patterns-mcp@latest"]
}
}
}Restart Windsurf to activate. See Windsurf MCP documentation for details.
VS Code
Add to .vscode/mcp.json:
{
"mcp": {
"servers": {
"swift-patterns": {
"command": "npx",
"args": ["-y", "swift-patterns-mcp@latest"]
}
}
}
}Open .vscode/mcp.json and click Start next to the swift-patterns server. See VS Code MCP documentation for details.
Test It Out
Try these queries:
"Show me SwiftUI animation patterns"
"What does Sundell say about testing?"
"Explain navigation patterns in SwiftUI"π§ Configuration
Configuration is automatically created at ~/.swift-patterns-mcp/config.json:
{
"sources": {
"sundell": { "enabled": true },
"vanderlee": { "enabled": true },
"nilcoalescing": { "enabled": true },
"pointfree": { "enabled": true },
"patreon": { "enabled": false, "configured": false }
},
"prefetchSources": true,
"semanticRecall": {
"enabled": false,
"minLexicalScore": 0.35,
"minRelevanceScore": 70
},
"memvid": {
"enabled": true,
"autoStore": true,
"useEmbeddings": false,
"embeddingModel": "bge-small"
}
}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
π§ Semantic Search: Optional embedding-based similarity search
π 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 |
| OAuth client ID from your Patreon app |
| OAuth client secret from your Patreon app |
| Enables searching YouTube videos from Patreon creators. Get API key |
Add to your MCP client config:
{
"mcpServers": {
"swift-patterns": {
"command": "npx",
"args": ["-y", "swift-patterns-mcp@latest"],
"env": {
"PATREON_CLIENT_ID": "your_client_id",
"PATREON_CLIENT_SECRET": "your_client_secret",
"YOUTUBE_API_KEY": "your_youtube_api_key"
}
}
}
}π‘ Usage Examples
Basic Queries
"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:
swift-patterns-mcp patreon setupFollow the interactive wizard to:
Verify environment variables are configured
Complete OAuth authentication
Fetch and verify content from your subscriptions
π Detailed Guide: Patreon Setup Documentation
Requirements
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
Quality Filtering: Applies configurable quality thresholds
Response: Returns formatted, relevant patterns and examples
π§ Troubleshooting
Common Issues
Node version incompatible
node --version # Should be >= 18.0.0Sources not returning results
swift-patterns-mcp sources
ls ~/.swift-patterns-mcp/config.jsonPatreon Integration Issues
OAuth redirect not working
Ensure redirect URI is exactly:
http://localhost:3000/patreon/callbackCheck no other process is using port 3000
Verify OAuth credentials are correctly set
No premium content showing
Confirm you have active Patreon subscriptions to iOS creators
Check status:
swift-patterns-mcp patreon statusRe-authenticate:
swift-patterns-mcp patreon setup
πΊοΈ Roadmap
Current (v1.x)
Core MCP server
Swift by Sundell RSS
Antoine van der Lee RSS
Nil Coalescing RSS
Patreon OAuth
Point-Free GitHub
Advanced filtering
Future (v2.x)
Additional premium sources
More free sources
Code validation
π€ Contributing
We welcome contributions! See our contributing guidelines.
π License
MIT License - Copyright (c) 2026 Lasha Efremidze
π Credits
Created by Lasha Efremidze
Content Sources
John Sundell - Swift by Sundell
Antoine van der Lee - SwiftLee
Nil Coalescing - SwiftUI patterns and Swift tips
Point-Free - Advanced Swift education
Built with Model Context Protocol
Made with β€οΈ for the Swift community
β Star this repo β’ π Report Bug β’ β¨ Request Feature
Available Tools
4 toolsenable_sourceB
Enable a content source (requires setup for premium sources)
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | Source ID (e.g., 'patreon') |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must disclose behavioral traits. It only mentions setup requirements, omitting details on side effects, permissions, or what happens upon success/failure.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single, front-loaded sentence with no padding, effectively conveying the core action and a key constraint.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple one-parameter tool, the description hints at setup requirements but lacks details on expected outcomes or error conditions, leaving some gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema already describes the single parameter with an example. The description adds no extra semantic value beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'Enable' and the resource 'content source', and adds a caveat about setup for premium sources, distinguishing it from sibling query tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies that enabling premium sources requires prior setup, but does not explicitly state when to use this tool vs alternatives or provide exclusion conditions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_swift_patternA
Get Swift/SwiftUI reference patterns from curated free sources (Sundell, van der Lee, Nil Coalescing, Point-Free). Best for conceptual guidance and free-source examples.
| Name | Required | Description | Default |
|---|---|---|---|
| topic | Yes | Topic to search (e.g., 'swiftui', 'testing', 'async-await', 'performance') | |
| source | No | Specific source to search (default: all free sources) | |
| minQuality | No | Minimum quality score 0-100 (default: 60) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description only implies a read-only operation via 'Get,' but does not explicitly state safety, side effects, or dependencies like network access. For a simple retrieval tool, this is adequate but not thorough.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, front-loaded with the verb 'Get' and resource, efficiently conveying purpose and context without unnecessary words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema, the description could specify return format (e.g., code snippets, links), but the tool's simplicity and clear purpose make the current level adequate for selection and invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, and the description adds context about 'curated free sources' but does not elaborate on individual parameters beyond what the schema provides, resulting in marginal added value.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool retrieves Swift/SwiftUI reference patterns from specific free sources (Sundell, van der Lee, etc.), making its purpose distinct from siblings like search_swift_content or list_content_sources.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description notes it is 'best for conceptual guidance and free-source examples,' implying appropriate use cases, but does not explicitly exclude scenarios like paid sources or advanced topics, nor mention sibling alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_content_sourcesA
List all available content sources and their status
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden. It correctly indicates a read operation (list) without side effects, but does not elaborate on rate limits, authentication, or status meaning.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
One sentence of 7 words, front-loaded with the core action. No wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a zero-parameter tool without output schema, the description states the return of 'all available content sources and their status', which is adequate but lacks details on the data structure or status values.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
There are zero parameters, so baseline is 4. The description adds no parameter meaning since none exist, but this is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses the specific verb 'list' and resource 'content sources', and includes 'status', clearly distinguishing it from sibling tools like enable_source and search_swift_content.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives. The description simply states what it does, leaving the agent to infer context from sibling names.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_swift_contentA
Unified search across all enabled sources (free + premium). Use this for broad natural-language queries. When Patreon is enabled, includes premium creator posts and downloadable code.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Natural-language search query | |
| requireCode | No | Prioritize and return only results with code examples |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must fully disclose behavior. It mentions inclusion of premium content when Patreon is enabled but omits details on rate limits, authentication, read-only nature, pagination, or result limits, which are critical for an AI agent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences with no extraneous content. Purpose is front-loaded, and each sentence serves a distinct function (explaining scope and conditional inclusion).
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Tool has 2 parameters, no annotations, and no output schema. Description fails to specify return value format, pagination, result limits, or behavior when no sources are enabled. This leaves significant gaps for an agent to correctly invoke and interpret results.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% (both parameters have descriptions). The description adds minimal value beyond the schema: it repeats the query usage hint and notes premium inclusion, but does not explain parameter formatting or constraints beyond what is in the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it performs unified search across all enabled sources, including premium when Patreon is enabled. The verb 'search' and resource 'swift content' are specific, and it is distinct from sibling tools (enable_source, get_swift_pattern, list_content_sources).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides explicit instruction to use for 'broad natural-language queries.' Does not state when not to use, but no conflicting sibling search tools exist, so exclusion is unnecessary.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
4 tool updates
v1.0.22- First observed
enable_source - First observed
get_swift_pattern - First observed
list_content_sources - First observed
search_swift_content
TDQS
Each tool serves a distinct purpose: enabling sources, retrieving patterns, listing sources, and searching content. No overlapping functionality.
All tools follow a consistent verb_noun pattern using snake_case: enable_source, get_swift_pattern, list_content_sources, search_swift_content.
Four tools is an appropriate number for a focused server that provides access to Swift/SwiftUI patterns from curated sources, covering key operations without bloat.
The tool set covers enabling sources, listing them, retrieving patterns, and searching. A minor gap is the absence of a tool to disable a source, but core functionality is present.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
A MCP server built for developers enabling Git based project management with project and personalβ¦
The official Svelte MCP server providing docs and autofixing tools for Svelte development
- LovableOAuthdev.lovable
Official MCP server for Lovable, the AI-powered full-stack app builder.
MCP server for AI agent profiles and smart notes. 60+ coding prompt packs with expert personas.
Related MCP Servers
- FlicenseNot gradedqualityFmaintenanceMCP server that provides semantic-level analysis of Swift codebases to AI agents by integrating with Apple's SourceKit-LSP, enabling compiler-grade code understanding and cross-file navigation.126-
- FlicenseNot gradedqualityDmaintenanceAn MCP server that provides Swift and SwiftUI best practices, acting as a senior iOS/macOS developer expert.194-
- AlicenseNot gradedqualityBmaintenanceAn MCP server that helps developers migrate Swift projects to Apple's 2026 platforms by adopting new frameworks and best practices from WWDC 2026.MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that provides 63 Clean Code principles for AI-assisted code review and development.14MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/efremidze/swift-patterns-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server