An MCP server providing curated Swift and SwiftUI best practices from leading iOS developers — with intelligent search, persistent memory, and optional premium integrations. 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, an
Add this skill
npx mdskills install efremidze/swift-patterns-mcpWell-documented MCP server with comprehensive setup guides and clear feature descriptions
1# swift-patterns-mcp23[](https://lobehub.com/mcp/efremidze-swift-patterns-mcp)45An MCP server providing curated Swift and SwiftUI best practices from leading iOS developers — with intelligent search, persistent memory, and optional premium integrations.67## Want an Agent Skill?89If you want a **lightweight, portable Swift/SwiftUI best-practices package** without runtime tooling, check out:1011**[swift-patterns-skill](https://github.com/efremidze/swift-patterns-skill)**: Designed as a portable Agent Skill focused on Swift/SwiftUI patterns, architecture guidance, and decision-making frameworks.1213**Key difference:**14- **swift-patterns-skill** = Static guidance (portable, no runtime)15- **swift-patterns-mcp** = Dynamic tooling (search, retrieval, premium features)1617**Note:** This repo is an MCP server only. It does **not** ship an Agent Skill (`SKILL.md`) or skill references.1819## What does this MCP provide?2021**swift-patterns-mcp** delivers runtime tools for accessing Swift/SwiftUI best practices:2223- 🔎 **Search & retrieval** across curated sources24- 🧠 **Persistent memory** with cross-session recall25- 🔄 **Auto-refreshing content** from RSS feeds and GitHub26- 🎯 **Intelligent filtering** by quality and relevance27- 🔐 **Premium integrations** (optional Patreon support)2829### Ideal for:3031- **Active Development**: "How do I implement pull-to-refresh in SwiftUI?" answered instantly without leaving your IDE32- **Architecture Decisions**: Compare MVVM vs. TCA patterns with concrete examples from trusted sources33- **Staying Current**: Access the latest patterns and best practices as they're published by leading iOS developers34- **Team Standards**: Build a searchable reference of approved patterns for your organization35- **AI-Powered Workflows**: Enable agents to query "Show me Sundell's approach to dependency injection" with consistent, quality responses3637## 🌟 Features3839- 🎓 **Expert Knowledge Base**: Patterns from Swift by Sundell, Antoine van der Lee, Nil Coalescing, and more40- 🔍 **Intelligent Search**: Query by topic, pattern, or specific iOS concept41- 💾 **Persistent Memory**: Cross-session recall with Memvid storage42- 🧠 **Semantic Search**: Optional AI-powered fallback for better conceptual matches43- 📚 **Multiple Sources**: Aggregates knowledge from trusted educators44- 🔄 **Auto-Updates**: Content refreshes automatically from RSS feeds45- ⚡ **Fast Performance**: Efficient caching and indexed search4647## Content Sources4849### Free Sources5051These sources are publicly available but benefit from MCP's fetching, caching, and search capabilities:5253| Source | Content Type | Updates |54|--------|--------------|---------|55| **Swift by Sundell** | Articles, patterns, best practices | Weekly |56| **SwiftLee** | Tutorials, tips, deep dives | Weekly |57| **Nil Coalescing** | SwiftUI patterns, Swift tips | Weekly |58| **Point-Free** | Open-source libraries, patterns | On release |5960### Premium Sources6162Premium content requires OAuth authentication and active subscriptions:6364| Source | What You Get | Authentication |65|--------|--------------|-------|66| **Patreon** | Premium content from supported creators | OAuth 2.0 |6768Access 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.6970## 📋 Prerequisites7172- **Node.js** 18.0.0 or higher73- **MCP-Compatible AI Assistant**: Claude Desktop, Cursor, Windsurf, VS Code with Copilot, or Claude Code7475## 🚀 Quick Start7677### Run Setup7879```bash80npx -y swift-patterns-mcp@latest81```8283In an interactive terminal, this opens the setup wizard.84When launched by an MCP client (non-interactive stdio), it runs as the MCP server automatically.8586### Interactive Setup Wizard8788```bash89npx -y swift-patterns-mcp@latest setup90```9192If installed globally, you can also run:9394```bash95swift-patterns-mcp setup96```9798The wizard helps you choose:99- Config scope (local project vs global)100- MCP client (Cursor, Claude Code, Windsurf, VS Code)101- Optional Patreon setup prompt102103### Non-interactive Setup (CI/Scripts)104105```bash106# Cursor107npx -y swift-patterns-mcp@latest setup --cursor --global108npx -y swift-patterns-mcp@latest setup --cursor --local109110# Claude Code111npx -y swift-patterns-mcp@latest setup --claude --global112113# Windsurf114npx -y swift-patterns-mcp@latest setup --windsurf --global115116# VS Code117npx -y swift-patterns-mcp@latest setup --vscode --local118119# All clients120npx -y swift-patterns-mcp@latest setup --all --global121```122123Use `--global` (`-g`) or `--local` (`-l`) to skip the location prompt.124Use `--cursor`, `--claude`, `--windsurf`, `--vscode`, or `--all` to skip the client prompt.125126### Configure Your AI Assistant127128#### Cursor129130[](https://cursor.com/en-US/install-mcp?name=swift-patterns&config=eyJjb21tYW5kIjoibnB4IC15IHN3aWZ0LXBhdHRlcm5zLW1jcEBsYXRlc3QifQ%3D%3D)131132Or manually add to **Cursor Settings** → **Tools** → **MCP Servers**:133134`.cursor/mcp.json`:135```json136{137 "mcpServers": {138 "swift-patterns": {139 "command": "npx",140 "args": ["-y", "swift-patterns-mcp@latest"]141 }142 }143}144```145146Alternatively, add to `~/.cursor/mcp.json`. See [Cursor documentation](https://docs.cursor.com) for details.147148#### Claude Code149150Run in your terminal:151152```bash153claude mcp add swift-patterns -- npx -y swift-patterns-mcp@latest154```155156Or manually add to `.mcp.json`:157158```json159{160 "mcpServers": {161 "swift-patterns": {162 "command": "npx",163 "args": ["-y", "swift-patterns-mcp@latest"]164 }165 }166}167```168169Restart Claude Code and run `/mcp` to verify. See [Claude Code MCP documentation](https://docs.claude.ai/claude-code) for details.170171#### Windsurf172173Add to `.windsurf/mcp.json`:174175```json176{177 "mcpServers": {178 "swift-patterns": {179 "command": "npx",180 "args": ["-y", "swift-patterns-mcp@latest"]181 }182 }183}184```185186Restart Windsurf to activate. See [Windsurf MCP documentation](https://docs.windsurf.com) for details.187188#### VS Code189190Add to `.vscode/mcp.json`:191192```json193{194 "mcp": {195 "servers": {196 "swift-patterns": {197 "command": "npx",198 "args": ["-y", "swift-patterns-mcp@latest"]199 }200 }201 }202}203```204205Open `.vscode/mcp.json` and click **Start** next to the swift-patterns server. See [VS Code MCP documentation](https://code.visualstudio.com/docs/copilot/mcp) for details.206207### Test It Out208209Try these queries:210211```212"Show me SwiftUI animation patterns"213"What does Sundell say about testing?"214"Explain navigation patterns in SwiftUI"215```216217## 🔧 Configuration218219Configuration is automatically created at `~/.swift-patterns-mcp/config.json`:220221```json222{223 "sources": {224 "sundell": { "enabled": true },225 "vanderlee": { "enabled": true },226 "nilcoalescing": { "enabled": true },227 "pointfree": { "enabled": true },228 "patreon": { "enabled": false, "configured": false }229 },230 "prefetchSources": true,231 "semanticRecall": {232 "enabled": false,233 "minLexicalScore": 0.35,234 "minRelevanceScore": 70235 },236 "memvid": {237 "enabled": true,238 "autoStore": true,239 "useEmbeddings": false,240 "embeddingModel": "bge-small"241 }242}243```244245Note: `configured` only applies to premium sources. Free sources are treated as configured by default.246247### Persistent Memory with Memvid248249Memvid 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.250251**Features:**252- 💾 **Persistent Storage**: Patterns stored in `~/.swift-patterns-mcp/swift-patterns-memory.mv2`253- 🔁 **Cross-Session Recall**: Find patterns from previous searches after server restart254- 🧠 **Semantic Search**: Optional embedding-based similarity search255- 🚀 **Automatic Storage**: Patterns stored during searches256- ⚡ **Fast Retrieval**: Built-in BM25 + optional vector search257258**Configuration:**259260```json261{262 "memvid": {263 "enabled": true, // Enable Memvid persistent memory264 "autoStore": true, // Automatically store patterns during searches265 "useEmbeddings": false, // Use semantic embeddings (requires model download)266 "embeddingModel": "bge-small" // Options: "bge-small", "openai-small"267 }268}269```270271**When to enable:**272- You want patterns to persist across server restarts273- You frequently search for similar topics274- You need cross-session semantic memory275276**Note:** Memvid complements MiniSearch (fast in-session search) and semantic recall (in-session fallback). All three work together:2771. **MiniSearch**: Fast lexical search within current session2782. **Semantic recall**: Activates for poor lexical results (in-session)2793. **Memvid**: Cross-session persistent memory and recall280281### Semantic Recall (Optional AI Enhancement)282283Semantic 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.284285**Features:**286- 🧠 Automatically activates when keyword search scores are low287- 🎯 Uses sentence transformers to understand meaning beyond keywords288- 📊 Quality filtering to index only high-relevance patterns289- ⚡ Efficient embedding caching290291**Configuration:**292293```json294{295 "semanticRecall": {296 "enabled": false, // Enable semantic recall297 "minLexicalScore": 0.35, // Activate when keyword search < 0.35298 "minRelevanceScore": 70 // Only index patterns with score >= 70299 }300}301```302303**When to enable:**304- Your queries use conceptual terms that don't match exact keywords305- You want more intelligent, context-aware search results306- You're okay with slightly slower first-time searches (embeddings need to compute)307308**Note:** Requires downloading a ~50MB transformer model on first use. Embeddings are cached for performance.309310### Environment Variables (Optional)311312#### Patreon313314All three variables are required for Patreon content fetching:315316| Variable | Description |317|----------|-------------|318| `PATREON_CLIENT_ID` | OAuth client ID from your Patreon app |319| `PATREON_CLIENT_SECRET` | OAuth client secret from your Patreon app |320| `YOUTUBE_API_KEY` | Enables searching YouTube videos from Patreon creators. [Get API key](https://console.cloud.google.com/apis/credentials) |321322Add to your MCP client config:323324```json325{326 "mcpServers": {327 "swift-patterns": {328 "command": "npx",329 "args": ["-y", "swift-patterns-mcp@latest"],330 "env": {331 "PATREON_CLIENT_ID": "your_client_id",332 "PATREON_CLIENT_SECRET": "your_client_secret",333 "YOUTUBE_API_KEY": "your_youtube_api_key"334 }335 }336 }337}338```339340## 💡 Usage Examples341342### Basic Queries343344```345"How can I use lazy var in @Observable classes?"346"Show me modern SwiftUI animation best practices using symbolEffect (with button + state examples)"347"Explain common SwiftUI navigation patterns (NavigationStack, NavigationPath, enum routing) and when to use each"348```349350### Advanced Queries351352```353"Build a coordinator-style architecture for SwiftUI: MVVM + dependency injection + type-safe routing"354"Give me a clean infinite scrolling implementation: pagination, dedupe, cancellation, and loading states"355"Explain how @Observable improves SwiftUI performance vs ObservableObject, then refactor my view model to @Observable"356```357358### With Patreon Integration359360```361"Build a SwiftUI parallax + sticky header screen like a profile page (include reusable component version)"362"Show me how to build a photo editor flow: PhotosPicker -> crop -> filters -> export/share"363"Give me 5 advanced SwiftUI micro-interactions (toasts, sheets, draggable cards, haptics) with production-ready code"364```365366## 🔐 Premium Integration (Optional)367368### Patreon Setup369370Access premium content from iOS creators you support:371372```bash373swift-patterns-mcp patreon setup374```375376Follow the interactive wizard to:3771. Verify environment variables are configured3782. Complete OAuth authentication3793. Fetch and verify content from your subscriptions380381📖 **Detailed Guide**: [Patreon Setup Documentation](docs/PATREON_SETUP.md)382383#### Requirements384385- Active Patreon account with at least one iOS creator subscription386- Patreon Creator account (free - no need to launch a creator page)387- 10 minutes for one-time OAuth setup388389#### Why Creator Account?390391Patreon 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.392393#### What You Get394395- ✅ Access to premium tutorials and patterns from creators you support396- ✅ Automatic extraction of code from downloadable content397- ✅ Quality filtering and advanced search398- ✅ Multi-creator support399- ✅ Private, secure authentication400401## ⚙️ Commands402403```bash404# List all content sources and status405swift-patterns-mcp sources406407# Interactive onboarding/configuration wizard408swift-patterns-mcp setup409410# Patreon integration411swift-patterns-mcp patreon setup # Connect your Patreon account412swift-patterns-mcp patreon status # Check connection status413swift-patterns-mcp patreon reset # Clear authentication data414```415416## 🗃️ How It Works417418```mermaid419graph LR420 A[AI Assistant] --> B[swift-patterns-mcp Server]421 B --> C[Free Sources]422 B --> D[Premium Sources]423 C --> E[Swift by Sundell RSS]424 C --> F[Antoine van der Lee RSS]425 C --> G[Nil Coalescing RSS]426 C --> H[Point-Free GitHub]427 D --> I[Patreon API]428```4294301. **Query**: Receives a query through the MCP protocol4312. **Processing**: Searches enabled sources based on the query4323. **Content Retrieval**: Fetches and parses content from RSS feeds, APIs, and cached data4334. **Quality Filtering**: Applies configurable quality thresholds4345. **Response**: Returns formatted, relevant patterns and examples435436## 🔧 Troubleshooting437438### Common Issues439440**Node version incompatible**441```bash442node --version # Should be >= 18.0.0443```444445**Sources not returning results**446```bash447swift-patterns-mcp sources448ls ~/.swift-patterns-mcp/config.json449```450451### Patreon Integration Issues452453**OAuth redirect not working**454- Ensure redirect URI is exactly: `http://localhost:3000/patreon/callback`455- Check no other process is using port 3000456- Verify OAuth credentials are correctly set457458**No premium content showing**459- Confirm you have active Patreon subscriptions to iOS creators460- Check status: `swift-patterns-mcp patreon status`461- Re-authenticate: `swift-patterns-mcp patreon setup`462463## 🗺️ Roadmap464465### Current (v1.x)466- [x] Core MCP server467- [x] Swift by Sundell RSS468- [x] Antoine van der Lee RSS469- [x] Nil Coalescing RSS470- [x] Patreon OAuth471- [x] Point-Free GitHub472- [ ] Advanced filtering473474### Future (v2.x)475- [ ] Additional premium sources476- [ ] More free sources477- [ ] Code validation478479## 🤝 Contributing480481We welcome contributions! See our [contributing guidelines](CONTRIBUTING.md).482483## 📄 License484485MIT License - Copyright (c) 2026 Lasha Efremidze486487## 🙏 Credits488489**Created by** [Lasha Efremidze](https://github.com/efremidze)490491**Content Sources**492- [John Sundell](https://swiftbysundell.com) - Swift by Sundell493- [Antoine van der Lee](https://www.avanderlee.com) - SwiftLee494- [Nil Coalescing](https://nilcoalescing.com) - SwiftUI patterns and Swift tips495- [Point-Free](https://www.pointfree.co) - Advanced Swift education496497**Built with** [Model Context Protocol](https://modelcontextprotocol.io)498499**Made with ❤️ for the Swift community**500501[⭐ Star this repo](https://github.com/efremidze/swift-patterns-mcp) • [🐛 Report Bug](https://github.com/efremidze/swift-patterns-mcp/issues) • [✨ Request Feature](https://github.com/efremidze/swift-patterns-mcp/issues)502
Full transparency — inspect the skill content before installing.