SuperAPI AI Directory

swift-patterns-mcp

Curated Swift and SwiftUI patterns and real-world code examples from sources like Swift by Sundell and SwiftLee.

Open website

About this tool

Purpose swift-patterns-mcp is an MCP (Model Context Protocol) server that provides AI programming assistants with access to curated Swift and SwiftUI best practices at runtime. It gathers patterns and real code examples from leading iOS development sources, giving developers instant answers without leaving the IDE.

Key capabilities

  • Expert knowledge base: includes patterns from sources such as Swift by Sundell, Antoine van der Lee, Nil Coalescing, and others.
  • Smart search: query by topic, pattern, or specific iOS concept.
  • Persistent memory: cross-session recall based on Memvid storage, with data saved at ~/.swift-patterns-mcp/swift-patterns-memory.mv2.
  • Semantic search: an optional AI-driven fallback mechanism that uses transformer embeddings to understand query intent when keyword search results are poor.
  • Multi-source aggregation: aggregates knowledge from trusted educators.
  • Automatic updates: content is automatically refreshed from RSS sources, with support for RSS feeds and GitHub.
  • Fast performance: efficient caching and indexed search.
  • Intelligent filtering for quality and relevance.
  • Optional paid integration: access to premium content through Patreon support.

How to use Prerequisites: Node.js 18.0.0 or higher; an MCP-compatible AI assistant such as Claude Desktop, Cursor, Windsurf, VS Code with Copilot, or Claude Code.

Installation and configuration: launching in an interactive terminal opens the setup wizard; when launched non-interactively via stdio by an MCP client, it automatically runs as an MCP server. It can also be run after a global installation. The wizard helps choose the configuration scope (local project or global), the MCP client (Cursor, Claude Code, Windsurf, VS Code), and optional Patreon setup prompts.

Non-interactive setup (CI/scripts): use --global (-g) or --local (-l) to skip the location prompt; use --cursor, --claude, --windsurf, --vscode, or --all to skip the clientTip.

Manual configuration examples:

  • Cursor: Add in Settings → Tools → MCP Servers, or edit .cursor/mcp.json, or ~/.cursor/mcp.json.
  • Claude Code: Run in the terminal, or manually add to .mcp.json, then restart Claude Code and run /mcp to verify.
  • Windsurf: Add to .windsurf/mcp.json, restart Windsurf to activate.
  • VS Code: Add to .vscode/mcp.json, open that file and click Start next to the swift-patterns server.

By default, the configuration is created at ~/.swift-patterns-mcp/config.json, where configured applies only to paid sources; free sources are considered configured by default.

Persistent memory (Memvid): Provides semantic memory across sessions. Unlike in-memory caching, Memvid stores patterns in a single-file database that persists after the server restarts. It supports persistent storage, cross-session recall, optional embedding similarity search, automatic storage during search, built-in BM25 plus optional vector retrieval. Memvid works together with MiniSearch (fast in-session lexical search) and semantic recall (in-session fallback): MiniSearch handles fast lexical search for the current session, semantic recall activates when lexical results are poor, and Memvid handles persistent memory and recall across sessions.

Semantic recall (optional AI enhancement): Automatically activates when keyword search scores are low, uses a sentence transformer to understand meaning beyond keywords, indexes only highly relevant patterns, and efficiently caches embeddings. First use requires downloading a transformer model of about 50MB. It is suitable for scenarios where queries use conceptual terms, do not match exact keywords, or require smarter, context-aware results.

Patreon paid integration (optional): Access premium content from the iOS creators you support, including Kavsoft, SwiftUI Codes, sucodee, and others. Requires an active Patreon account and a subscription to at least one iOS creator; a Patreon creator account (free, no need to publish a creator page); one-time OAuth setup takes about 10 minutes. Patreon requires OAuth tobe registered by the creator; you do not need to publish a creator page or become an active creator, you only need to register as a creator to create an OAuth app for personal use. All three environment variables are required to access Patreon content. The OAuth redirect URI must be exactly http://localhost:3000/patreon/callback,并确认端口 3000 is not occupied. The status can be checked via swift-patterns-mcp patreon status, and re-authentication can be done via swift-patterns-mcp patreon setup.

Use cases

  • Active development: answer questions such as "how to implement pull-to-refresh in SwiftUI" instantly within the IDE.
  • Architecture decisions: compare MVVM and TCA patterns with concrete examples from trusted sources.
  • Stay up to date: get the latest patterns and best practices published by leading iOS developers.
  • Team standards: build a searchable reference of approved patterns for an organization.
  • AI-driven workflows: let agents query "show Sundell's dependency injection approach" and receive consistent, high-quality responses.

How it works Queries are received through the MCP protocol; enabled sources are searched based on the query; content is fetched and parsed from RSS feeds, APIs, and cached data; configurable quality thresholds are applied for filtering; formatted, relevant patterns and examples are returned.

Limitations and notes

  • This repository is only an MCP server and does not include an Agent Skill (SKILL.md) or skill reference. If you need a lightweight, portable Swift/SwiftUI best-practices package that does not require runtime tools, you can use swift-patterns-skill (static guidance, no runtime). swift-patterns-mcp, by contrast, is a dynamic tool (search, retrieval, paid features).
  • Paid sources require OAuth authentication and an active subscription.
  • Semantic recall requires downloading a model of about 50MB for the first time, so the first search may be somewhat slow.
  • Troubleshooting: incompatible Node versions, no results from sources, Patreon integration issues (redirects, port occupation, OAuth credentials, subscription status), etc.
  • License: MIT License, Copyright (c) 2026 Lasha Efremidze. The author is Lasha Efremidze.
  • Other plans or projects: core MCP server, advanced filtering, additional paid sources, more free sources, code validation.

Not yet provided: specific pricing, charge amounts, the complete list of each premium source, and performance data beyond detailed usage steps are not given in the materials.