swift-patterns-mcp 1.0.7 → 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 +153 -84
- package/build/config/sources.d.ts +19 -0
- package/build/config/sources.d.ts.map +1 -1
- package/build/config/sources.js +24 -13
- package/build/config/sources.js.map +1 -1
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/build/integration/response-quality.test.js +20 -26
- package/build/integration/response-quality.test.js.map +1 -1
- package/build/sources/free/vanderlee.d.ts.map +1 -1
- package/build/sources/free/vanderlee.js +28 -19
- package/build/sources/free/vanderlee.js.map +1 -1
- 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/build/tools/handlers/getSwiftPattern.d.ts.map +1 -1
- package/build/tools/handlers/getSwiftPattern.js +30 -7
- package/build/tools/handlers/getSwiftPattern.js.map +1 -1
- package/build/tools/handlers/handlers.test.js +15 -5
- package/build/tools/handlers/handlers.test.js.map +1 -1
- package/build/tools/handlers/searchSwiftContent.d.ts.map +1 -1
- package/build/tools/handlers/searchSwiftContent.js +82 -54
- package/build/tools/handlers/searchSwiftContent.js.map +1 -1
- package/build/utils/cache.d.ts +2 -0
- package/build/utils/cache.d.ts.map +1 -1
- package/build/utils/cache.js +33 -2
- package/build/utils/cache.js.map +1 -1
- package/build/utils/intent-cache.d.ts.map +1 -1
- package/build/utils/intent-cache.js +3 -46
- package/build/utils/intent-cache.js.map +1 -1
- package/build/utils/intent-cache.test.js +2 -25
- package/build/utils/intent-cache.test.js.map +1 -1
- package/build/utils/logger.js +1 -1
- package/build/utils/logger.js.map +1 -1
- package/build/utils/memvid-memory.d.ts +73 -0
- package/build/utils/memvid-memory.d.ts.map +1 -0
- package/build/utils/memvid-memory.js +238 -0
- package/build/utils/memvid-memory.js.map +1 -0
- package/build/utils/memvid-memory.test.d.ts +2 -0
- package/build/utils/memvid-memory.test.d.ts.map +1 -0
- package/build/utils/memvid-memory.test.js +117 -0
- package/build/utils/memvid-memory.test.js.map +1 -0
- package/build/utils/pattern-formatter.d.ts +8 -0
- package/build/utils/pattern-formatter.d.ts.map +1 -1
- package/build/utils/pattern-formatter.js +16 -0
- package/build/utils/pattern-formatter.js.map +1 -1
- package/build/utils/search-terms.d.ts +17 -0
- package/build/utils/search-terms.d.ts.map +1 -0
- package/build/utils/search-terms.js +71 -0
- package/build/utils/search-terms.js.map +1 -0
- package/build/utils/search-terms.test.d.ts +2 -0
- package/build/utils/search-terms.test.d.ts.map +1 -0
- package/build/utils/search-terms.test.js +107 -0
- package/build/utils/search-terms.test.js.map +1 -0
- package/build/utils/search.d.ts.map +1 -1
- package/build/utils/search.js +3 -51
- package/build/utils/search.js.map +1 -1
- package/build/utils/source-registry.d.ts +6 -0
- package/build/utils/source-registry.d.ts.map +1 -1
- package/build/utils/source-registry.js +14 -0
- package/build/utils/source-registry.js.map +1 -1
- package/build/utils/source-registry.test.js +24 -1
- package/build/utils/source-registry.test.js.map +1 -1
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -1,45 +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
|
-
|
|
14
|
-
- ✅ **Always Up-to-Date**: Automatically fetches the latest articles and patterns
|
|
15
|
-
- ✅ **MCP Native**: Works seamlessly with Claude, Cursor, Windsurf, and other MCP-compatible tools
|
|
16
|
-
- ✅ **Privacy First**: Free sources require no authentication
|
|
17
|
-
- ✅ **Extensible**: Optional Patreon integration for premium content
|
|
15
|
+
**Note:** This repo is an MCP server only. It does **not** ship an Agent Skill (`SKILL.md`) or skill references.
|
|
18
16
|
|
|
19
|
-
##
|
|
17
|
+
## What does this MCP provide?
|
|
18
|
+
|
|
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)
|
|
26
|
+
|
|
27
|
+
### Ideal for:
|
|
20
28
|
|
|
21
|
-
|
|
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
|
|
22
34
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
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
|
|
28
43
|
- ⚡ **Fast Performance**: Efficient caching and indexed search
|
|
29
44
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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 |
|
|
35
65
|
|
|
36
|
-
### Premium Sources (Optional)
|
|
37
|
-
- 🔐 **Patreon Integration** - Access premium content from creators you support
|
|
38
66
|
|
|
39
67
|
## 📋 Prerequisites
|
|
40
68
|
|
|
41
|
-
- **Node.js
|
|
42
|
-
- **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
|
|
43
71
|
|
|
44
72
|
## 🚀 Quick Start
|
|
45
73
|
|
|
@@ -69,19 +97,18 @@ Or manually add to **Cursor Settings** → **Tools** → **MCP Servers**:
|
|
|
69
97
|
}
|
|
70
98
|
```
|
|
71
99
|
|
|
72
|
-
Alternatively, add
|
|
100
|
+
Alternatively, add to `~/.cursor/mcp.json`. See [Cursor documentation](https://docs.cursor.com) for details.
|
|
73
101
|
|
|
74
102
|
#### Claude Code
|
|
75
103
|
|
|
76
|
-
Run
|
|
104
|
+
Run in your terminal:
|
|
77
105
|
|
|
78
106
|
```bash
|
|
79
107
|
claude mcp add swift-patterns -- npx -y swift-patterns-mcp@latest
|
|
80
108
|
```
|
|
81
109
|
|
|
82
|
-
Or manually add to
|
|
110
|
+
Or manually add to `.mcp.json`:
|
|
83
111
|
|
|
84
|
-
`.mcp.json`
|
|
85
112
|
```json
|
|
86
113
|
{
|
|
87
114
|
"mcpServers": {
|
|
@@ -93,15 +120,12 @@ Or manually add to your project's `.mcp.json` file:
|
|
|
93
120
|
}
|
|
94
121
|
```
|
|
95
122
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
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.
|
|
99
124
|
|
|
100
125
|
#### Windsurf
|
|
101
126
|
|
|
102
|
-
Add
|
|
127
|
+
Add to `.windsurf/mcp.json`:
|
|
103
128
|
|
|
104
|
-
`.windsurf/mcp.json`
|
|
105
129
|
```json
|
|
106
130
|
{
|
|
107
131
|
"mcpServers": {
|
|
@@ -113,15 +137,12 @@ Add the swift-patterns server to your project's `.windsurf/mcp.json` configurati
|
|
|
113
137
|
}
|
|
114
138
|
```
|
|
115
139
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
See the Windsurf MCP documentation for more details.
|
|
140
|
+
Restart Windsurf to activate. See [Windsurf MCP documentation](https://docs.windsurf.com) for details.
|
|
119
141
|
|
|
120
142
|
#### VS Code
|
|
121
143
|
|
|
122
|
-
|
|
144
|
+
Add to `.vscode/mcp.json`:
|
|
123
145
|
|
|
124
|
-
`.vscode/mcp.json`
|
|
125
146
|
```json
|
|
126
147
|
{
|
|
127
148
|
"mcp": {
|
|
@@ -135,9 +156,7 @@ To configure MCP in VS Code with GitHub Copilot, add the swift-patterns-mcp serv
|
|
|
135
156
|
}
|
|
136
157
|
```
|
|
137
158
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
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.
|
|
141
160
|
|
|
142
161
|
### Test It Out
|
|
143
162
|
|
|
@@ -151,22 +170,95 @@ Try these queries:
|
|
|
151
170
|
|
|
152
171
|
## 🔧 Configuration
|
|
153
172
|
|
|
154
|
-
|
|
173
|
+
Configuration is automatically created at `~/.swift-patterns-mcp/config.json`:
|
|
155
174
|
|
|
156
175
|
```json
|
|
157
176
|
{
|
|
158
177
|
"sources": {
|
|
159
|
-
"sundell": { "enabled": true, "
|
|
160
|
-
"vanderlee": { "enabled": true, "
|
|
161
|
-
"
|
|
162
|
-
"
|
|
178
|
+
"sundell": { "enabled": true, "configured": true },
|
|
179
|
+
"vanderlee": { "enabled": true, "configured": true },
|
|
180
|
+
"nilcoalescing": { "enabled": true, "configured": true },
|
|
181
|
+
"pointfree": { "enabled": true, "configured": true },
|
|
182
|
+
"patreon": { "enabled": false, "configured": false }
|
|
183
|
+
},
|
|
184
|
+
"prefetchSources": true,
|
|
185
|
+
"semanticRecall": {
|
|
186
|
+
"enabled": false,
|
|
187
|
+
"minLexicalScore": 0.35,
|
|
188
|
+
"minRelevanceScore": 70
|
|
163
189
|
},
|
|
164
|
-
"
|
|
165
|
-
"
|
|
190
|
+
"memvid": {
|
|
191
|
+
"enabled": true,
|
|
192
|
+
"autoStore": true,
|
|
193
|
+
"useEmbeddings": false,
|
|
194
|
+
"embeddingModel": "bge-small"
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Persistent Memory with Memvid
|
|
200
|
+
|
|
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.
|
|
202
|
+
|
|
203
|
+
**Features:**
|
|
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
|
|
206
|
+
- 🧠 **Semantic Search**: Optional embedding-based similarity search
|
|
207
|
+
- 🚀 **Automatic Storage**: Patterns stored during searches
|
|
208
|
+
- ⚡ **Fast Retrieval**: Built-in BM25 + optional vector search
|
|
209
|
+
|
|
210
|
+
**Configuration:**
|
|
211
|
+
|
|
212
|
+
```json
|
|
213
|
+
{
|
|
214
|
+
"memvid": {
|
|
215
|
+
"enabled": true, // Enable Memvid persistent memory
|
|
216
|
+
"autoStore": true, // Automatically store patterns during searches
|
|
217
|
+
"useEmbeddings": false, // Use semantic embeddings (requires model download)
|
|
218
|
+
"embeddingModel": "bge-small" // Options: "bge-small", "openai-small"
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
**When to enable:**
|
|
224
|
+
- You want patterns to persist across server restarts
|
|
225
|
+
- You frequently search for similar topics
|
|
226
|
+
- You need cross-session semantic memory
|
|
227
|
+
|
|
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
|
|
232
|
+
|
|
233
|
+
### Semantic Recall (Optional AI Enhancement)
|
|
234
|
+
|
|
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.
|
|
236
|
+
|
|
237
|
+
**Features:**
|
|
238
|
+
- 🧠 Automatically activates when keyword search scores are low
|
|
239
|
+
- 🎯 Uses sentence transformers to understand meaning beyond keywords
|
|
240
|
+
- 📊 Quality filtering to index only high-relevance patterns
|
|
241
|
+
- ⚡ Efficient embedding caching
|
|
242
|
+
|
|
243
|
+
**Configuration:**
|
|
244
|
+
|
|
245
|
+
```json
|
|
246
|
+
{
|
|
247
|
+
"semanticRecall": {
|
|
248
|
+
"enabled": false, // Enable semantic recall
|
|
249
|
+
"minLexicalScore": 0.35, // Activate when keyword search < 0.35
|
|
250
|
+
"minRelevanceScore": 70 // Only index patterns with score >= 70
|
|
166
251
|
}
|
|
167
252
|
}
|
|
168
253
|
```
|
|
169
254
|
|
|
255
|
+
**When to enable:**
|
|
256
|
+
- Your queries use conceptual terms that don't match exact keywords
|
|
257
|
+
- You want more intelligent, context-aware search results
|
|
258
|
+
- You're okay with slightly slower first-time searches (embeddings need to compute)
|
|
259
|
+
|
|
260
|
+
**Note:** Requires downloading a ~50MB transformer model on first use. Embeddings are cached for performance.
|
|
261
|
+
|
|
170
262
|
### Environment Variables (Optional)
|
|
171
263
|
|
|
172
264
|
For premium features, add to your MCP client config:
|
|
@@ -191,47 +283,27 @@ For premium features, add to your MCP client config:
|
|
|
191
283
|
### Basic Queries
|
|
192
284
|
|
|
193
285
|
```
|
|
194
|
-
"
|
|
195
|
-
"
|
|
196
|
-
"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"
|
|
197
289
|
```
|
|
198
290
|
|
|
199
291
|
### Advanced Queries
|
|
200
292
|
|
|
201
293
|
```
|
|
202
|
-
"
|
|
203
|
-
"
|
|
204
|
-
"
|
|
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"
|
|
205
297
|
```
|
|
206
298
|
|
|
207
299
|
### With Patreon Integration
|
|
208
300
|
|
|
209
301
|
```
|
|
210
|
-
"
|
|
211
|
-
"
|
|
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"
|
|
212
305
|
```
|
|
213
306
|
|
|
214
|
-
## 📚 Content Sources
|
|
215
|
-
|
|
216
|
-
### Free Sources
|
|
217
|
-
|
|
218
|
-
Currently supported, no authentication needed:
|
|
219
|
-
|
|
220
|
-
| Source | Creator | Content Type | Update Frequency |
|
|
221
|
-
|--------|---------|--------------|------------------|
|
|
222
|
-
| **Swift by Sundell** | John Sundell | Articles, patterns, best practices | Weekly |
|
|
223
|
-
| **Antoine van der Lee** | Antoine van der Lee | Tutorials, tips, deep dives | Weekly |
|
|
224
|
-
| **Nil Coalescing** | Nil Coalescing | SwiftUI patterns, Swift tips | Weekly |
|
|
225
|
-
| **Point-Free** | Point-Free | Open source libraries, patterns | On release |
|
|
226
|
-
|
|
227
|
-
### Premium Sources
|
|
228
|
-
|
|
229
|
-
Requires authentication and active subscriptions:
|
|
230
|
-
|
|
231
|
-
| Source | What You Get | Setup Method | Status |
|
|
232
|
-
|--------|--------------|--------------|--------|
|
|
233
|
-
| **Patreon** | Premium content from iOS creators | OAuth 2.0 | ✅ Available |
|
|
234
|
-
|
|
235
307
|
## 🔐 Premium Integration (Optional)
|
|
236
308
|
|
|
237
309
|
### Patreon Setup
|
|
@@ -284,7 +356,7 @@ swift-patterns-mcp auth patreon
|
|
|
284
356
|
swift-patterns-mcp auth status
|
|
285
357
|
```
|
|
286
358
|
|
|
287
|
-
##
|
|
359
|
+
## 🗃️ How It Works
|
|
288
360
|
|
|
289
361
|
```mermaid
|
|
290
362
|
graph LR
|
|
@@ -320,7 +392,7 @@ ls ~/.swift-patterns-mcp/config.json
|
|
|
320
392
|
swift-patterns-mcp setup
|
|
321
393
|
```
|
|
322
394
|
|
|
323
|
-
|
|
395
|
+
### Patreon Integration Issues
|
|
324
396
|
|
|
325
397
|
**OAuth redirect not working**
|
|
326
398
|
- Ensure redirect URI is exactly: `http://localhost:3000/patreon/callback`
|
|
@@ -346,7 +418,6 @@ swift-patterns-mcp setup
|
|
|
346
418
|
### Future (v2.x)
|
|
347
419
|
- [ ] Additional premium sources
|
|
348
420
|
- [ ] More free sources
|
|
349
|
-
- [ ] Advanced search (with vector embeddings)
|
|
350
421
|
- [ ] Code validation
|
|
351
422
|
|
|
352
423
|
## 🤝 Contributing
|
|
@@ -369,8 +440,6 @@ MIT License - Copyright (c) 2026 Lasha Efremidze
|
|
|
369
440
|
|
|
370
441
|
**Built with** [Model Context Protocol](https://modelcontextprotocol.io)
|
|
371
442
|
|
|
372
|
-
---
|
|
373
|
-
|
|
374
443
|
**Made with ❤️ for the Swift community**
|
|
375
444
|
|
|
376
445
|
[⭐ Star this repo](https://github.com/efremidze/swift-patterns-mcp) • [🐛 Report Bug](./issues) • [✨ Request Feature](./issues)
|
|
@@ -24,6 +24,12 @@ export interface SourceConfig {
|
|
|
24
24
|
minLexicalScore: number;
|
|
25
25
|
minRelevanceScore: number;
|
|
26
26
|
};
|
|
27
|
+
memvid?: {
|
|
28
|
+
enabled: boolean;
|
|
29
|
+
autoStore: boolean;
|
|
30
|
+
useEmbeddings: boolean;
|
|
31
|
+
embeddingModel?: string;
|
|
32
|
+
};
|
|
27
33
|
}
|
|
28
34
|
export declare class SourceManager {
|
|
29
35
|
private config;
|
|
@@ -86,6 +92,19 @@ export declare class SourceManager {
|
|
|
86
92
|
* Check if semantic recall is enabled
|
|
87
93
|
*/
|
|
88
94
|
isSemanticRecallEnabled(): boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Get memvid configuration
|
|
97
|
+
*/
|
|
98
|
+
getMemvidConfig(): {
|
|
99
|
+
enabled: boolean;
|
|
100
|
+
autoStore: boolean;
|
|
101
|
+
useEmbeddings: boolean;
|
|
102
|
+
embeddingModel?: string;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Check if memvid is enabled
|
|
106
|
+
*/
|
|
107
|
+
isMemvidEnabled(): boolean;
|
|
89
108
|
}
|
|
90
109
|
export default SourceManager;
|
|
91
110
|
//# sourceMappingURL=sources.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sources.d.ts","sourceRoot":"","sources":["../../src/config/sources.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,SAAS,CAAC;AAC5C,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,UAAU,GAAG,gBAAgB,CAAC;AAErE,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,MAAM,EAAE,YAAY,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,eAAO,MAAM,iBAAiB,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"sources.d.ts","sourceRoot":"","sources":["../../src/config/sources.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,SAA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G,SAAS;IAIhD;;OAEG;IACH,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAqBjC;;OAEG;IACH,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAQlC;;OAEG;IACH,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAYvC;;OAEG;IACH,oBAAoB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAUtC;;OAEG;IACH,aAAa,IAAI,KAAK,CAAC,aAAa,GAAG;QACrC,SAAS,EAAE,OAAO,CAAC;QACnB,YAAY,EAAE,OAAO,CAAC;KACvB,CAAC;IAQF;;OAEG;IACH,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,aAAa,EAAE;IAInD;;OAEG;IACH,iBAAiB,IAAI,OAAO;IAI5B;;OAEG;IACH,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAK1C;;OAEG;IACH,uBAAuB;iBAjNZ,OAAO;yBACC,MAAM;2BACJ,MAAM;;IAmN3B;;OAEG;IACH,uBAAuB,IAAI,OAAO;IAIlC;;OAEG;IACH,eAAe;iBA1NJ,OAAO;mBACL,OAAO;uBACH,OAAO;yBACL,MAAM;;IA2NzB;;OAEG;IACH,eAAe,IAAI,OAAO;CAG3B;AAED,eAAe,aAAa,CAAC"}
|
package/build/config/sources.js
CHANGED
|
@@ -57,18 +57,6 @@ export const AVAILABLE_SOURCES = [
|
|
|
57
57
|
setupFunction: 'setupPatreon',
|
|
58
58
|
configKeys: ['PATREON_CLIENT_ID', 'PATREON_CLIENT_SECRET'],
|
|
59
59
|
},
|
|
60
|
-
// Future premium sources
|
|
61
|
-
{
|
|
62
|
-
id: 'github-sponsors',
|
|
63
|
-
name: 'GitHub Sponsors',
|
|
64
|
-
description: 'Access content from developers you sponsor on GitHub (Coming soon)',
|
|
65
|
-
type: 'premium',
|
|
66
|
-
enabled: false,
|
|
67
|
-
requiresAuth: true,
|
|
68
|
-
status: 'not-configured',
|
|
69
|
-
setupFunction: 'setupGitHubSponsors',
|
|
70
|
-
configKeys: ['GITHUB_TOKEN'],
|
|
71
|
-
},
|
|
72
60
|
];
|
|
73
61
|
const sourceConfigSchema = z.object({
|
|
74
62
|
sources: z.record(z.string(), z.object({
|
|
@@ -82,6 +70,12 @@ const sourceConfigSchema = z.object({
|
|
|
82
70
|
minLexicalScore: z.number(),
|
|
83
71
|
minRelevanceScore: z.number(),
|
|
84
72
|
}).optional(),
|
|
73
|
+
memvid: z.object({
|
|
74
|
+
enabled: z.boolean(),
|
|
75
|
+
autoStore: z.boolean(),
|
|
76
|
+
useEmbeddings: z.boolean(),
|
|
77
|
+
embeddingModel: z.string().optional(),
|
|
78
|
+
}).optional(),
|
|
85
79
|
});
|
|
86
80
|
const DEFAULT_CONFIG = {
|
|
87
81
|
sources: {
|
|
@@ -90,7 +84,6 @@ const DEFAULT_CONFIG = {
|
|
|
90
84
|
nilcoalescing: { enabled: true, configured: true },
|
|
91
85
|
pointfree: { enabled: true, configured: true },
|
|
92
86
|
patreon: { enabled: false, configured: false },
|
|
93
|
-
'github-sponsors': { enabled: false, configured: false },
|
|
94
87
|
},
|
|
95
88
|
prefetchSources: true,
|
|
96
89
|
semanticRecall: {
|
|
@@ -98,6 +91,12 @@ const DEFAULT_CONFIG = {
|
|
|
98
91
|
minLexicalScore: 0.35,
|
|
99
92
|
minRelevanceScore: 70,
|
|
100
93
|
},
|
|
94
|
+
memvid: {
|
|
95
|
+
enabled: true,
|
|
96
|
+
autoStore: true,
|
|
97
|
+
useEmbeddings: false,
|
|
98
|
+
embeddingModel: 'bge-small',
|
|
99
|
+
},
|
|
101
100
|
};
|
|
102
101
|
export class SourceManager {
|
|
103
102
|
config;
|
|
@@ -239,6 +238,18 @@ export class SourceManager {
|
|
|
239
238
|
isSemanticRecallEnabled() {
|
|
240
239
|
return this.config.semanticRecall?.enabled ?? false;
|
|
241
240
|
}
|
|
241
|
+
/**
|
|
242
|
+
* Get memvid configuration
|
|
243
|
+
*/
|
|
244
|
+
getMemvidConfig() {
|
|
245
|
+
return this.config.memvid || DEFAULT_CONFIG.memvid;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Check if memvid is enabled
|
|
249
|
+
*/
|
|
250
|
+
isMemvidEnabled() {
|
|
251
|
+
return this.config.memvid?.enabled ?? true;
|
|
252
|
+
}
|
|
242
253
|
}
|
|
243
254
|
export default SourceManager;
|
|
244
255
|
//# sourceMappingURL=sources.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sources.js","sourceRoot":"","sources":["../../src/config/sources.ts"],"names":[],"mappings":"AAAA,wBAAwB;AAExB,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAiBlD,MAAM,CAAC,MAAM,iBAAiB,GAAoB;IAChD,+EAA+E;IAC/E,qDAAqD;IACrD,+EAA+E;IAE/E;QACE,EAAE,EAAE,SAAS;QACb,IAAI,EAAE,kBAAkB;QACxB,WAAW,EAAE,wDAAwD;QACrE,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,IAAI;QACb,YAAY,EAAE,KAAK;QACnB,MAAM,EAAE,SAAS;KAClB;IAED;QACE,EAAE,EAAE,WAAW;QACf,IAAI,EAAE,qBAAqB;QAC3B,WAAW,EAAE,uDAAuD;QACpE,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,IAAI;QACb,YAAY,EAAE,KAAK;QACnB,MAAM,EAAE,SAAS;KAClB;IAED;QACE,EAAE,EAAE,eAAe;QACnB,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE,kEAAkE;QAC/E,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,IAAI;QACb,YAAY,EAAE,KAAK;QACnB,MAAM,EAAE,SAAS;KAClB;IAED;QACE,EAAE,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,eAAe,IAAI,IAAI,CAAC;IAC7C,CAAC;IAED;;OAEG;IACH,kBAAkB,CAAC,OAAgB;QACjC,IAAI,CAAC,MAAM,CAAC,eAAe,GAAG,OAAO,CAAC;QACtC,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;IAED;;OAEG;IACH,uBAAuB;QACrB,OAAO,IAAI,CAAC,MAAM,CAAC,cAAc,IAAI,cAAc,CAAC,cAAe,CAAC;IACtE,CAAC;IAED;;OAEG;IACH,uBAAuB;QACrB,OAAO,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,OAAO,IAAI,KAAK,CAAC;IACtD,CAAC;IAED;;OAEG;IACH,eAAe;QACb,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,cAAc,CAAC,MAAO,CAAC;IACtD,CAAC;IAED;;OAEG;IACH,eAAe;QACb,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,IAAI,IAAI,CAAC;IAC7C,CAAC;CACF;AAED,eAAe,aAAa,CAAC"}
|
package/build/index.js
CHANGED
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,eAAe;AAEf,OAAO,eAAe,CAAC;AAEvB,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GAEvB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,aAAa,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAyC,MAAM,kBAAkB,CAAC;AACrF,OAAO,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,2CAA2C;AAC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,CAAC,KAAK,EAAE,EAAE;YACjB,MAAM,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,4BAA4B,CAAC,CAAC;QAC5D,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,aAAa,CAAC,CAAC;IAC5C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -6,37 +6,36 @@ import { MCPTestClient, isCI } from './test-client.js';
|
|
|
6
6
|
const describeIntegration = isCI ? describe.skip : describe;
|
|
7
7
|
describeIntegration('Response Quality Validation', () => {
|
|
8
8
|
let client;
|
|
9
|
+
let listSourcesResponse;
|
|
9
10
|
beforeAll(async () => {
|
|
10
11
|
client = new MCPTestClient();
|
|
11
12
|
await client.start();
|
|
13
|
+
// Cache expensive list_content_sources call
|
|
14
|
+
listSourcesResponse = await client.callToolText('list_content_sources');
|
|
12
15
|
}, 10000);
|
|
13
16
|
afterAll(async () => {
|
|
14
17
|
await client.stop();
|
|
15
18
|
});
|
|
16
19
|
describe('list_content_sources response format', () => {
|
|
17
|
-
it('should have clear markdown structure',
|
|
18
|
-
|
|
19
|
-
expect(
|
|
20
|
-
expect(
|
|
21
|
-
expect(
|
|
22
|
-
expect(response).toContain('Premium Sources');
|
|
20
|
+
it('should have clear markdown structure', () => {
|
|
21
|
+
expect(listSourcesResponse).toMatch(/^# /m);
|
|
22
|
+
expect(listSourcesResponse).toMatch(/## /m);
|
|
23
|
+
expect(listSourcesResponse).toContain('Free Sources');
|
|
24
|
+
expect(listSourcesResponse).toContain('Premium Sources');
|
|
23
25
|
});
|
|
24
|
-
it('should list all expected free sources',
|
|
25
|
-
const response = await client.callToolText('list_content_sources');
|
|
26
|
+
it('should list all expected free sources', () => {
|
|
26
27
|
// Verify all free sources are listed
|
|
27
|
-
expect(
|
|
28
|
-
expect(
|
|
29
|
-
expect(
|
|
30
|
-
expect(
|
|
28
|
+
expect(listSourcesResponse).toContain('Swift by Sundell');
|
|
29
|
+
expect(listSourcesResponse).toContain('Antoine van der Lee');
|
|
30
|
+
expect(listSourcesResponse).toContain('Nil Coalescing');
|
|
31
|
+
expect(listSourcesResponse).toContain('Point-Free');
|
|
31
32
|
});
|
|
32
|
-
it('should show status indicators for each source',
|
|
33
|
-
const response = await client.callToolText('list_content_sources');
|
|
33
|
+
it('should show status indicators for each source', () => {
|
|
34
34
|
// Each source should have a status indicator
|
|
35
|
-
expect(
|
|
35
|
+
expect(listSourcesResponse).toMatch(/✅|⚙️|⬜/);
|
|
36
36
|
});
|
|
37
|
-
it('should include actionable setup instructions',
|
|
38
|
-
|
|
39
|
-
expect(response).toContain('swift-patterns-mcp setup');
|
|
37
|
+
it('should include actionable setup instructions', () => {
|
|
38
|
+
expect(listSourcesResponse).toContain('swift-patterns-mcp setup');
|
|
40
39
|
});
|
|
41
40
|
});
|
|
42
41
|
describe('get_swift_pattern response validation', () => {
|
|
@@ -120,7 +119,7 @@ describeIntegration('Response Quality Validation', () => {
|
|
|
120
119
|
}, 30000);
|
|
121
120
|
});
|
|
122
121
|
describe('search_swift_content response validation', () => {
|
|
123
|
-
it('should return results
|
|
122
|
+
it('should return relevant results with excerpts and proper formatting', async () => {
|
|
124
123
|
const response = await client.callToolText('search_swift_content', {
|
|
125
124
|
query: 'async await',
|
|
126
125
|
});
|
|
@@ -131,6 +130,8 @@ describeIntegration('Response Quality Validation', () => {
|
|
|
131
130
|
lowerResponse.includes('await') ||
|
|
132
131
|
lowerResponse.includes('concurrency');
|
|
133
132
|
expect(hasRelevantContent).toBe(true);
|
|
133
|
+
// Results should have some content beyond just titles (excerpts)
|
|
134
|
+
expect(response.length).toBeGreaterThan(200);
|
|
134
135
|
}, 60000);
|
|
135
136
|
it('should filter by requireCode when specified', async () => {
|
|
136
137
|
const withCodeResponse = await client.callToolText('search_swift_content', {
|
|
@@ -141,13 +142,6 @@ describeIntegration('Response Quality Validation', () => {
|
|
|
141
142
|
// This is hard to verify without parsing, but at minimum we should get results
|
|
142
143
|
expect(withCodeResponse.length).toBeGreaterThan(50);
|
|
143
144
|
}, 60000);
|
|
144
|
-
it('should include excerpts in search results', async () => {
|
|
145
|
-
const response = await client.callToolText('search_swift_content', {
|
|
146
|
-
query: 'concurrency',
|
|
147
|
-
});
|
|
148
|
-
// Results should have some content beyond just titles
|
|
149
|
-
expect(response.length).toBeGreaterThan(200);
|
|
150
|
-
}, 60000);
|
|
151
145
|
});
|
|
152
146
|
describe('enable_source response validation', () => {
|
|
153
147
|
it('should confirm enabling a valid free source', async () => {
|