swift-patterns-mcp 1.0.8 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +90 -96
- package/build/sources/premium/patreon-dl.d.ts.map +1 -1
- package/build/sources/premium/patreon-dl.js +4 -2
- package/build/sources/premium/patreon-dl.js.map +1 -1
- package/build/sources/premium/patreon-fetch.js +3 -1
- package/build/sources/premium/patreon-fetch.js.map +1 -1
- package/package.json +1 -2
package/README.md
CHANGED
|
@@ -1,47 +1,73 @@
|
|
|
1
1
|
# swift-patterns-mcp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
An MCP server providing curated Swift and SwiftUI best practices from leading iOS developers — with intelligent search, persistent memory, and optional premium integrations.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Want an Agent Skill?
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
If you want a **lightweight, portable Swift/SwiftUI best-practices package** without runtime tooling, check out:
|
|
8
8
|
|
|
9
|
-
[
|
|
9
|
+
**[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.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
**Key difference:**
|
|
12
|
+
- **swift-patterns-skill** = Static guidance (portable, no runtime)
|
|
13
|
+
- **swift-patterns-mcp** = Dynamic tooling (search, retrieval, premium features)
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
**Note:** This repo is an MCP server only. It does **not** ship an Agent Skill (`SKILL.md`) or skill references.
|
|
14
16
|
|
|
15
|
-
|
|
16
|
-
- ✅ **Always Up-to-Date**: Automatically fetches the latest articles and patterns
|
|
17
|
-
- ✅ **MCP Native**: Works seamlessly with Claude, Cursor, Windsurf, and other MCP-compatible tools
|
|
18
|
-
- ✅ **Privacy First**: Free sources require no authentication
|
|
19
|
-
- ✅ **Extensible**: Optional Patreon integration for premium content
|
|
17
|
+
## What does this MCP provide?
|
|
20
18
|
|
|
21
|
-
|
|
19
|
+
**swift-patterns-mcp** delivers runtime tools for accessing Swift/SwiftUI best practices:
|
|
20
|
+
|
|
21
|
+
- 🔎 **Search & retrieval** across curated sources
|
|
22
|
+
- 🧠 **Persistent memory** with cross-session recall
|
|
23
|
+
- 🔄 **Auto-refreshing content** from RSS feeds and GitHub
|
|
24
|
+
- 🎯 **Intelligent filtering** by quality and relevance
|
|
25
|
+
- 🔐 **Premium integrations** (optional Patreon support)
|
|
22
26
|
|
|
23
|
-
###
|
|
27
|
+
### Ideal for:
|
|
24
28
|
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
29
|
+
- **Active Development**: "How do I implement pull-to-refresh in SwiftUI?" answered instantly without leaving your IDE
|
|
30
|
+
- **Architecture Decisions**: Compare MVVM vs. TCA patterns with concrete examples from trusted sources
|
|
31
|
+
- **Staying Current**: Access the latest patterns and best practices as they're published by leading iOS developers
|
|
32
|
+
- **Team Standards**: Build a searchable reference of approved patterns for your organization
|
|
33
|
+
- **AI-Powered Workflows**: Enable agents to query "Show me Sundell's approach to dependency injection" with consistent, quality responses
|
|
34
|
+
|
|
35
|
+
## 🌟 Features
|
|
36
|
+
|
|
37
|
+
- 🎓 **Expert Knowledge Base**: Patterns from Swift by Sundell, Antoine van der Lee, Nil Coalescing, and more
|
|
38
|
+
- 🔍 **Intelligent Search**: Query by topic, pattern, or specific iOS concept
|
|
39
|
+
- 💾 **Persistent Memory**: Cross-session recall with Memvid storage
|
|
40
|
+
- 🧠 **Semantic Search**: Optional AI-powered fallback for better conceptual matches
|
|
41
|
+
- 📚 **Multiple Sources**: Aggregates knowledge from trusted educators
|
|
42
|
+
- 🔄 **Auto-Updates**: Content refreshes automatically from RSS feeds
|
|
30
43
|
- ⚡ **Fast Performance**: Efficient caching and indexed search
|
|
31
44
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
45
|
+
## Content Sources
|
|
46
|
+
|
|
47
|
+
### Free Sources
|
|
48
|
+
|
|
49
|
+
These sources are publicly available but benefit from MCP's fetching, caching, and search capabilities:
|
|
50
|
+
|
|
51
|
+
| Source | Content Type | Updates |
|
|
52
|
+
|--------|--------------|---------|
|
|
53
|
+
| **Swift by Sundell** | Articles, patterns, best practices | Weekly |
|
|
54
|
+
| **SwiftLee** | Tutorials, tips, deep dives | Weekly |
|
|
55
|
+
| **Nil Coalescing** | SwiftUI patterns, Swift tips | Weekly |
|
|
56
|
+
| **Point-Free** | Open-source libraries, patterns | On release |
|
|
57
|
+
|
|
58
|
+
### Premium Sources
|
|
59
|
+
|
|
60
|
+
Premium content requires OAuth authentication and active subscriptions:
|
|
61
|
+
|
|
62
|
+
| Source | What You Get | Authentication |
|
|
63
|
+
|--------|--------------|-------|
|
|
64
|
+
| **Patreon** | Premium content from supported creators | OAuth 2.0 |
|
|
37
65
|
|
|
38
|
-
### Premium Sources (Optional)
|
|
39
|
-
- 🔐 **Patreon Integration** - Access premium content from creators you support
|
|
40
66
|
|
|
41
67
|
## 📋 Prerequisites
|
|
42
68
|
|
|
43
|
-
- **Node.js
|
|
44
|
-
- **MCP-Compatible AI Assistant**: Claude Desktop, Cursor, Windsurf,
|
|
69
|
+
- **Node.js** 18.0.0 or higher
|
|
70
|
+
- **MCP-Compatible AI Assistant**: Claude Desktop, Cursor, Windsurf, VS Code with Copilot, or Claude Code
|
|
45
71
|
|
|
46
72
|
## 🚀 Quick Start
|
|
47
73
|
|
|
@@ -71,19 +97,18 @@ Or manually add to **Cursor Settings** → **Tools** → **MCP Servers**:
|
|
|
71
97
|
}
|
|
72
98
|
```
|
|
73
99
|
|
|
74
|
-
Alternatively, add
|
|
100
|
+
Alternatively, add to `~/.cursor/mcp.json`. See [Cursor documentation](https://docs.cursor.com) for details.
|
|
75
101
|
|
|
76
102
|
#### Claude Code
|
|
77
103
|
|
|
78
|
-
Run
|
|
104
|
+
Run in your terminal:
|
|
79
105
|
|
|
80
106
|
```bash
|
|
81
107
|
claude mcp add swift-patterns -- npx -y swift-patterns-mcp@latest
|
|
82
108
|
```
|
|
83
109
|
|
|
84
|
-
Or manually add to
|
|
110
|
+
Or manually add to `.mcp.json`:
|
|
85
111
|
|
|
86
|
-
`.mcp.json`
|
|
87
112
|
```json
|
|
88
113
|
{
|
|
89
114
|
"mcpServers": {
|
|
@@ -95,15 +120,12 @@ Or manually add to your project's `.mcp.json` file:
|
|
|
95
120
|
}
|
|
96
121
|
```
|
|
97
122
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
See the Claude Code MCP documentation for more details.
|
|
123
|
+
Restart Claude Code and run `/mcp` to verify. See [Claude Code MCP documentation](https://docs.claude.ai/claude-code) for details.
|
|
101
124
|
|
|
102
125
|
#### Windsurf
|
|
103
126
|
|
|
104
|
-
Add
|
|
127
|
+
Add to `.windsurf/mcp.json`:
|
|
105
128
|
|
|
106
|
-
`.windsurf/mcp.json`
|
|
107
129
|
```json
|
|
108
130
|
{
|
|
109
131
|
"mcpServers": {
|
|
@@ -115,15 +137,12 @@ Add the swift-patterns server to your project's `.windsurf/mcp.json` configurati
|
|
|
115
137
|
}
|
|
116
138
|
```
|
|
117
139
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
See the Windsurf MCP documentation for more details.
|
|
140
|
+
Restart Windsurf to activate. See [Windsurf MCP documentation](https://docs.windsurf.com) for details.
|
|
121
141
|
|
|
122
142
|
#### VS Code
|
|
123
143
|
|
|
124
|
-
|
|
144
|
+
Add to `.vscode/mcp.json`:
|
|
125
145
|
|
|
126
|
-
`.vscode/mcp.json`
|
|
127
146
|
```json
|
|
128
147
|
{
|
|
129
148
|
"mcp": {
|
|
@@ -137,9 +156,7 @@ To configure MCP in VS Code with GitHub Copilot, add the swift-patterns-mcp serv
|
|
|
137
156
|
}
|
|
138
157
|
```
|
|
139
158
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
See the VS Code MCP documentation for more details.
|
|
159
|
+
Open `.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.
|
|
143
160
|
|
|
144
161
|
### Test It Out
|
|
145
162
|
|
|
@@ -153,7 +170,7 @@ Try these queries:
|
|
|
153
170
|
|
|
154
171
|
## 🔧 Configuration
|
|
155
172
|
|
|
156
|
-
|
|
173
|
+
Configuration is automatically created at `~/.swift-patterns-mcp/config.json`:
|
|
157
174
|
|
|
158
175
|
```json
|
|
159
176
|
{
|
|
@@ -179,15 +196,15 @@ The configuration file is automatically created at `~/.swift-patterns-mcp/config
|
|
|
179
196
|
}
|
|
180
197
|
```
|
|
181
198
|
|
|
182
|
-
### Persistent Memory with Memvid
|
|
199
|
+
### Persistent Memory with Memvid
|
|
183
200
|
|
|
184
|
-
Memvid provides persistent semantic memory that improves recall across sessions
|
|
201
|
+
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.
|
|
185
202
|
|
|
186
203
|
**Features:**
|
|
187
|
-
- 💾 **Persistent Storage**: Patterns
|
|
188
|
-
-
|
|
204
|
+
- 💾 **Persistent Storage**: Patterns stored in `~/.swift-patterns-mcp/swift-patterns-memory.mv2`
|
|
205
|
+
- 🔁 **Cross-Session Recall**: Find patterns from previous searches after server restart
|
|
189
206
|
- 🧠 **Semantic Search**: Optional embedding-based similarity search
|
|
190
|
-
- 🚀 **Automatic Storage**: Patterns
|
|
207
|
+
- 🚀 **Automatic Storage**: Patterns stored during searches
|
|
191
208
|
- ⚡ **Fast Retrieval**: Built-in BM25 + optional vector search
|
|
192
209
|
|
|
193
210
|
**Configuration:**
|
|
@@ -195,34 +212,33 @@ Memvid provides persistent semantic memory that improves recall across sessions
|
|
|
195
212
|
```json
|
|
196
213
|
{
|
|
197
214
|
"memvid": {
|
|
198
|
-
"enabled": true, // Enable
|
|
215
|
+
"enabled": true, // Enable Memvid persistent memory
|
|
199
216
|
"autoStore": true, // Automatically store patterns during searches
|
|
200
217
|
"useEmbeddings": false, // Use semantic embeddings (requires model download)
|
|
201
|
-
"embeddingModel": "bge-small" //
|
|
218
|
+
"embeddingModel": "bge-small" // Options: "bge-small", "openai-small"
|
|
202
219
|
}
|
|
203
220
|
}
|
|
204
221
|
```
|
|
205
222
|
|
|
206
|
-
**When to
|
|
223
|
+
**When to enable:**
|
|
207
224
|
- You want patterns to persist across server restarts
|
|
208
225
|
- You frequently search for similar topics
|
|
209
|
-
- You want improved recall for evolving source content
|
|
210
226
|
- You need cross-session semantic memory
|
|
211
227
|
|
|
212
|
-
**Note:** Memvid complements MiniSearch (
|
|
213
|
-
1. MiniSearch
|
|
214
|
-
2. Semantic recall
|
|
215
|
-
3. Memvid
|
|
228
|
+
**Note:** Memvid complements MiniSearch (fast in-session search) and semantic recall (in-session fallback). All three work together:
|
|
229
|
+
1. **MiniSearch**: Fast lexical search within current session
|
|
230
|
+
2. **Semantic recall**: Activates for poor lexical results (in-session)
|
|
231
|
+
3. **Memvid**: Cross-session persistent memory and recall
|
|
216
232
|
|
|
217
233
|
### Semantic Recall (Optional AI Enhancement)
|
|
218
234
|
|
|
219
|
-
Semantic recall provides AI-powered semantic search as a fallback when
|
|
235
|
+
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.
|
|
220
236
|
|
|
221
237
|
**Features:**
|
|
222
238
|
- 🧠 Automatically activates when keyword search scores are low
|
|
223
|
-
- 🎯 Uses sentence transformers to understand meaning
|
|
224
|
-
- 📊 Quality filtering to only
|
|
225
|
-
- ⚡ Efficient caching
|
|
239
|
+
- 🎯 Uses sentence transformers to understand meaning beyond keywords
|
|
240
|
+
- 📊 Quality filtering to index only high-relevance patterns
|
|
241
|
+
- ⚡ Efficient embedding caching
|
|
226
242
|
|
|
227
243
|
**Configuration:**
|
|
228
244
|
|
|
@@ -236,7 +252,7 @@ Semantic recall provides AI-powered semantic search as a fallback when tradition
|
|
|
236
252
|
}
|
|
237
253
|
```
|
|
238
254
|
|
|
239
|
-
**When to
|
|
255
|
+
**When to enable:**
|
|
240
256
|
- Your queries use conceptual terms that don't match exact keywords
|
|
241
257
|
- You want more intelligent, context-aware search results
|
|
242
258
|
- You're okay with slightly slower first-time searches (embeddings need to compute)
|
|
@@ -267,47 +283,27 @@ For premium features, add to your MCP client config:
|
|
|
267
283
|
### Basic Queries
|
|
268
284
|
|
|
269
285
|
```
|
|
270
|
-
"
|
|
271
|
-
"
|
|
272
|
-
"Explain navigation patterns
|
|
286
|
+
"How can I use lazy var in @Observable classes?"
|
|
287
|
+
"Show me modern SwiftUI animation best practices using symbolEffect (with button + state examples)"
|
|
288
|
+
"Explain common SwiftUI navigation patterns (NavigationStack, NavigationPath, enum routing) and when to use each"
|
|
273
289
|
```
|
|
274
290
|
|
|
275
291
|
### Advanced Queries
|
|
276
292
|
|
|
277
293
|
```
|
|
278
|
-
"
|
|
279
|
-
"
|
|
280
|
-
"
|
|
294
|
+
"Build a coordinator-style architecture for SwiftUI: MVVM + dependency injection + type-safe routing"
|
|
295
|
+
"Give me a clean infinite scrolling implementation: pagination, dedupe, cancellation, and loading states"
|
|
296
|
+
"Explain how @Observable improves SwiftUI performance vs ObservableObject, then refactor my view model to @Observable"
|
|
281
297
|
```
|
|
282
298
|
|
|
283
299
|
### With Patreon Integration
|
|
284
300
|
|
|
285
301
|
```
|
|
286
|
-
"
|
|
287
|
-
"
|
|
302
|
+
"Build a SwiftUI parallax + sticky header screen like a profile page (include reusable component version)"
|
|
303
|
+
"Show me how to build a photo editor flow: PhotosPicker -> crop -> filters -> export/share"
|
|
304
|
+
"Give me 5 advanced SwiftUI micro-interactions (toasts, sheets, draggable cards, haptics) with production-ready code"
|
|
288
305
|
```
|
|
289
306
|
|
|
290
|
-
## 📚 Content Sources
|
|
291
|
-
|
|
292
|
-
### Free Sources
|
|
293
|
-
|
|
294
|
-
Currently supported, no authentication needed:
|
|
295
|
-
|
|
296
|
-
| Source | Creator | Content Type | Update Frequency |
|
|
297
|
-
|--------|---------|--------------|------------------|
|
|
298
|
-
| **Swift by Sundell** | John Sundell | Articles, patterns, best practices | Weekly |
|
|
299
|
-
| **Antoine van der Lee** | Antoine van der Lee | Tutorials, tips, deep dives | Weekly |
|
|
300
|
-
| **Nil Coalescing** | Nil Coalescing | SwiftUI patterns, Swift tips | Weekly |
|
|
301
|
-
| **Point-Free** | Point-Free | Open source libraries, patterns | On release |
|
|
302
|
-
|
|
303
|
-
### Premium Sources
|
|
304
|
-
|
|
305
|
-
Requires authentication and active subscriptions:
|
|
306
|
-
|
|
307
|
-
| Source | What You Get | Setup Method | Status |
|
|
308
|
-
|--------|--------------|--------------|--------|
|
|
309
|
-
| **Patreon** | Premium content from iOS creators | OAuth 2.0 | ✅ Available |
|
|
310
|
-
|
|
311
307
|
## 🔐 Premium Integration (Optional)
|
|
312
308
|
|
|
313
309
|
### Patreon Setup
|
|
@@ -360,7 +356,7 @@ swift-patterns-mcp auth patreon
|
|
|
360
356
|
swift-patterns-mcp auth status
|
|
361
357
|
```
|
|
362
358
|
|
|
363
|
-
##
|
|
359
|
+
## 🗃️ How It Works
|
|
364
360
|
|
|
365
361
|
```mermaid
|
|
366
362
|
graph LR
|
|
@@ -396,7 +392,7 @@ ls ~/.swift-patterns-mcp/config.json
|
|
|
396
392
|
swift-patterns-mcp setup
|
|
397
393
|
```
|
|
398
394
|
|
|
399
|
-
|
|
395
|
+
### Patreon Integration Issues
|
|
400
396
|
|
|
401
397
|
**OAuth redirect not working**
|
|
402
398
|
- Ensure redirect URI is exactly: `http://localhost:3000/patreon/callback`
|
|
@@ -444,8 +440,6 @@ MIT License - Copyright (c) 2026 Lasha Efremidze
|
|
|
444
440
|
|
|
445
441
|
**Built with** [Model Context Protocol](https://modelcontextprotocol.io)
|
|
446
442
|
|
|
447
|
-
---
|
|
448
|
-
|
|
449
443
|
**Made with ❤️ for the Swift community**
|
|
450
444
|
|
|
451
445
|
[⭐ Star this repo](https://github.com/efremidze/swift-patterns-mcp) • [🐛 Report Bug](./issues) • [✨ Request Feature](./issues)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patreon-dl.d.ts","sourceRoot":"","sources":["../../../src/sources/premium/patreon-dl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"patreon-dl.d.ts","sourceRoot":"","sources":["../../../src/sources/premium/patreon-dl.ts"],"names":[],"mappings":"AAoBA,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,cAAc,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,OAAO,GAAG,KAAK,GAAG,UAAU,GAAG,OAAO,CAAC;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,OAAO,CAAC,CAO7D;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAE5C;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAI/C;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAkB/C;AAED;;GAEG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,CAWzD;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,cAAc,EAAE,CAiCxD;AAmFD;;GAEG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAEtC"}
|
|
@@ -8,6 +8,8 @@ import { CREATORS } from '../../config/creators.js';
|
|
|
8
8
|
import { getPatreonContentDir } from '../../utils/paths.js';
|
|
9
9
|
import logger from '../../utils/logger.js';
|
|
10
10
|
const execAsync = promisify(exec);
|
|
11
|
+
const PATREON_DL_PACKAGE = 'patreon-dl@3.6.0';
|
|
12
|
+
const PATREON_DL_COMMAND = `npx --yes ${PATREON_DL_PACKAGE}`;
|
|
11
13
|
function getCookiePath() {
|
|
12
14
|
// Use .patreon-session in project root (created by extract-cookie.ts)
|
|
13
15
|
return path.join(process.cwd(), '.patreon-session');
|
|
@@ -17,7 +19,7 @@ function getCookiePath() {
|
|
|
17
19
|
*/
|
|
18
20
|
export async function isPatreonDlAvailable() {
|
|
19
21
|
try {
|
|
20
|
-
await execAsync(
|
|
22
|
+
await execAsync(`${PATREON_DL_COMMAND} --version`);
|
|
21
23
|
return true;
|
|
22
24
|
}
|
|
23
25
|
catch {
|
|
@@ -50,7 +52,7 @@ export async function downloadCreatorContent(creatorUrl, creatorName) {
|
|
|
50
52
|
const outDir = path.join(getPatreonContentDir(), creatorName);
|
|
51
53
|
try {
|
|
52
54
|
// Run patreon-dl with session_id cookie format
|
|
53
|
-
const cmd =
|
|
55
|
+
const cmd = `${PATREON_DL_COMMAND} -c "session_id=${cookie}" -o "${outDir}" "${creatorUrl}"`;
|
|
54
56
|
await execAsync(cmd, { timeout: 300000 }); // 5 min timeout
|
|
55
57
|
return { success: true };
|
|
56
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patreon-dl.js","sourceRoot":"","sources":["../../../src/sources/premium/patreon-dl.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,+DAA+D;AAE/D,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO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AC;gBAC1B,IAAI,GAAG,KAAK,CAAC;YACf,CAAC;iBAAM,IAAI,GAAG,KAAK,KAAK,IAAI,GAAG,KAAK,WAAW,EAAE,CAAC;gBAChD,IAAI,GAAG,UAAU,CAAC;gBAClB,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YAC/C,CAAC;YAED,IAAI,IAAI,KAAK,OAAO,EAAE,CAAC;gBACrB,KAAK,CAAC,IAAI,CAAC;oBACT,QAAQ,EAAE,KAAK;oBACf,QAAQ,EAAE,QAAQ;oBAClB,IAAI;oBACJ,OAAO;iBACR,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa;IAC3B,OAAO,oBAAoB,EAAE,CAAC;AAChC,CAAC"}
|
|
@@ -6,6 +6,8 @@ import { fileURLToPath } from 'url';
|
|
|
6
6
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
7
7
|
const [, , url, out] = process.argv;
|
|
8
8
|
const cookieFile = '.patreon-session';
|
|
9
|
+
const PATREON_DL_PACKAGE = 'patreon-dl@3.6.0';
|
|
10
|
+
const PATREON_DL_COMMAND = `npx --yes ${PATREON_DL_PACKAGE}`;
|
|
9
11
|
if (!fs.existsSync(cookieFile)) {
|
|
10
12
|
console.log('No session cookie — running browser auth...');
|
|
11
13
|
// extract-cookie.js is in build/tools/ relative to this file in build/sources/premium/
|
|
@@ -14,5 +16,5 @@ if (!fs.existsSync(cookieFile)) {
|
|
|
14
16
|
}
|
|
15
17
|
const session = fs.readFileSync(cookieFile, 'utf8').trim();
|
|
16
18
|
console.log('Downloading with patreon-dl...');
|
|
17
|
-
execSync(
|
|
19
|
+
execSync(`${PATREON_DL_COMMAND} -c "session_id=${session}" -o "${out}" "${url}"`, { stdio: 'inherit' });
|
|
18
20
|
//# sourceMappingURL=patreon-fetch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patreon-fetch.js","sourceRoot":"","sources":["../../../src/sources/premium/patreon-fetch.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/D,MAAM,CAAC,EAAC,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;AACnC,MAAM,UAAU,GAAG,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"patreon-fetch.js","sourceRoot":"","sources":["../../../src/sources/premium/patreon-fetch.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/D,MAAM,CAAC,EAAC,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;AACnC,MAAM,UAAU,GAAG,kBAAkB,CAAC;AACtC,MAAM,kBAAkB,GAAG,kBAAkB,CAAC;AAC9C,MAAM,kBAAkB,GAAG,aAAa,kBAAkB,EAAE,CAAC;AAE7D,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;IAC/B,OAAO,CAAC,GAAG,CAAC,6CAA6C,CAAC,CAAC;IAC3D,uFAAuF;IACvF,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,mBAAmB,CAAC,CAAC;IACzF,QAAQ,CAAC,SAAS,iBAAiB,GAAG,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;AAChE,CAAC;AAED,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;AAC3D,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;AAC9C,QAAQ,CAAC,GAAG,kBAAkB,mBAAmB,OAAO,SAAS,GAAG,MAAM,GAAG,GAAG,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "swift-patterns-mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "MCP server providing curated Swift/SwiftUI best practices from leading iOS developers, including patterns and real-world code examples from Swift by Sundell, SwiftLee, and other trusted sources.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -60,7 +60,6 @@
|
|
|
60
60
|
"minisearch": "^7.2.0",
|
|
61
61
|
"ml-distance": "^4.0.1",
|
|
62
62
|
"natural": "^8.1.0",
|
|
63
|
-
"patreon-dl": "^3.6.0",
|
|
64
63
|
"pino": "^9.5.0",
|
|
65
64
|
"playwright": "^1.57.0",
|
|
66
65
|
"quick-lru": "^7.3.0",
|