knowzcode 0.1.0 → 0.2.1
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/.claude-plugin/marketplace.json +6 -3
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +132 -73
- package/agents/analyst.md +24 -62
- package/agents/architect.md +34 -43
- package/agents/builder.md +35 -86
- package/agents/closer.md +29 -87
- package/agents/context-scout.md +54 -0
- package/agents/knowledge-migrator.md +7 -7
- package/agents/knowz-scout.md +83 -0
- package/agents/knowz-scribe.md +155 -0
- package/agents/microfix-specialist.md +1 -6
- package/agents/reviewer.md +43 -91
- package/agents/update-coordinator.md +7 -18
- package/bin/knowzcode.mjs +94 -7
- package/commands/audit.md +156 -25
- package/commands/connect-mcp.md +525 -507
- package/commands/fix.md +8 -8
- package/commands/init.md +9 -5
- package/commands/learn.md +327 -308
- package/commands/plan.md +160 -26
- package/commands/register.md +21 -12
- package/commands/status.md +309 -291
- package/commands/telemetry.md +188 -188
- package/commands/work.md +577 -114
- package/knowzcode/automation_manifest.md +59 -59
- package/knowzcode/claude_code_execution.md +228 -22
- package/knowzcode/enterprise/compliance_manifest.md +2 -0
- package/knowzcode/knowzcode_loop.md +111 -45
- package/knowzcode/knowzcode_project.md +48 -233
- package/knowzcode/knowzcode_vaults.md +183 -54
- package/knowzcode/mcp_config.md +72 -47
- package/knowzcode/platform_adapters.md +43 -4
- package/knowzcode/prompts/Execute_Micro_Fix.md +57 -57
- package/knowzcode/prompts/Investigate_Codebase.md +227 -227
- package/knowzcode/prompts/Migrate_Knowledge.md +301 -301
- package/knowzcode/prompts/Refactor_Node.md +72 -72
- package/knowzcode/prompts/Spec_Verification_Checkpoint.md +59 -59
- package/knowzcode/prompts/[LOOP_1A]__Propose_Change_Set.md +52 -52
- package/knowzcode/prompts/[LOOP_1B]__Draft_Specs.md +75 -75
- package/knowzcode/prompts/[LOOP_2A]__Implement_Change_Set.md +55 -55
- package/knowzcode/prompts/[LOOP_2B]__Verify_Implementation.md +72 -72
- package/knowzcode/prompts/[LOOP_3]__Finalize_And_Commit.md +67 -67
- package/package.json +1 -1
- package/skills/alias-resolver.json +1 -1
- package/skills/architecture-diff.json +1 -1
- package/skills/check-installation-status.json +1 -1
- package/skills/continue.md +24 -4
- package/skills/environment-guard.json +1 -1
- package/skills/generate-workgroup-id.json +1 -1
- package/skills/install-knowzcode.json +1 -1
- package/skills/load-core-context.json +1 -1
- package/skills/log-entry-builder.json +1 -1
- package/skills/spec-quality-check.json +1 -1
- package/skills/spec-template.json +1 -1
- package/skills/spec-validator.json +1 -1
- package/skills/tracker-scan.json +1 -1
- package/skills/tracker-update.json +1 -1
- package/skills/validate-installation.json +1 -1
package/commands/connect-mcp.md
CHANGED
|
@@ -1,507 +1,525 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Configure KnowzCode MCP server for vector-powered code search and context
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# KnowzCode MCP Server Connection
|
|
6
|
-
|
|
7
|
-
You are the **KnowzCode MCP Connection Agent**. Your task is to configure the KnowzCode MCP (Model Context Protocol) server to enable
|
|
8
|
-
|
|
9
|
-
## Command Syntax
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
/kc:connect-mcp <api-key> [--endpoint <url>] [--scope <local|project|user>] [--dev] [--configure-vaults]
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
**Note:** If you don't have an API key yet, run `/kc:register` to create an account and get one automatically.
|
|
16
|
-
Registration also auto-configures your vault - no manual setup needed!
|
|
17
|
-
|
|
18
|
-
**Parameters:**
|
|
19
|
-
- `<api-key>` - Required. Your KnowzCode API key (or omit for interactive prompt)
|
|
20
|
-
- `--endpoint <url>` - Optional. Custom MCP endpoint (overrides environment default)
|
|
21
|
-
- `--scope <scope>` - Optional. Configuration scope: local (default), project, or user
|
|
22
|
-
- `--dev` - Optional. Use development environment instead of production
|
|
23
|
-
- `--configure-vaults` - Optional. Force vault configuration prompts (even if already configured)
|
|
24
|
-
|
|
25
|
-
**Environments:**
|
|
26
|
-
| Environment | Endpoint | When to Use |
|
|
27
|
-
|:------------|:---------|:------------|
|
|
28
|
-
| **Production** (default) | `https://mcp.knowz.io/mcp` | Normal usage |
|
|
29
|
-
| **Development** | `https://mcp.dev.knowz.io/mcp` | Testing new features |
|
|
30
|
-
|
|
31
|
-
**Examples:**
|
|
32
|
-
```bash
|
|
33
|
-
# Basic usage (production - default)
|
|
34
|
-
/kc:connect-mcp kz_live_abc123...
|
|
35
|
-
|
|
36
|
-
# Interactive mode (production)
|
|
37
|
-
/kc:connect-mcp
|
|
38
|
-
|
|
39
|
-
# Development environment
|
|
40
|
-
/kc:connect-mcp kz_test_abc123... --dev
|
|
41
|
-
|
|
42
|
-
# Self-hosted endpoint
|
|
43
|
-
/kc:connect-mcp kz_live_abc123... --endpoint https://your-domain.com/mcp
|
|
44
|
-
|
|
45
|
-
# Project-wide configuration (production)
|
|
46
|
-
/kc:connect-mcp kz_live_team456... --scope project
|
|
47
|
-
|
|
48
|
-
# Development with project scope
|
|
49
|
-
/kc:connect-mcp kz_test_team456... --dev --scope project
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
## What This Enables
|
|
53
|
-
|
|
54
|
-
Once connected, you
|
|
55
|
-
|
|
56
|
-
- **`search_knowledge`** - Vector similarity search across vaults
|
|
57
|
-
- **`ask_question`** -
|
|
58
|
-
- **`create_knowledge`** - Save learnings to
|
|
59
|
-
- **`update_knowledge`** - Update existing knowledge items
|
|
60
|
-
- **`find_entities`** - Find people, locations, or events in your knowledge
|
|
61
|
-
|
|
62
|
-
###
|
|
63
|
-
|
|
64
|
-
KnowzCode
|
|
65
|
-
|
|
66
|
-
| Vault Type | Purpose | Query Examples |
|
|
67
|
-
|------------|---------|----------------|
|
|
68
|
-
| **Code
|
|
69
|
-
| **
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
-
|
|
82
|
-
- Parse `--
|
|
83
|
-
-
|
|
84
|
-
-
|
|
85
|
-
-
|
|
86
|
-
- Parse `--
|
|
87
|
-
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
-
|
|
92
|
-
- If
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
- **
|
|
107
|
-
- **
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
-
|
|
114
|
-
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
│
|
|
154
|
-
│
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
•
|
|
191
|
-
•
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
• "
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
- If "
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
- **
|
|
227
|
-
- **
|
|
228
|
-
- **
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
- **
|
|
233
|
-
- **
|
|
234
|
-
- **
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
- **
|
|
242
|
-
- **
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
```
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
-
|
|
287
|
-
|
|
288
|
-
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
-
|
|
342
|
-
-
|
|
343
|
-
- **
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
- **
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
-
|
|
353
|
-
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
```
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
/
|
|
426
|
-
```
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
- Uses `
|
|
465
|
-
|
|
466
|
-
**
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
-
|
|
486
|
-
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
-
|
|
503
|
-
-
|
|
504
|
-
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
1
|
+
---
|
|
2
|
+
description: Configure KnowzCode MCP server for vector-powered code search and context
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# KnowzCode MCP Server Connection
|
|
6
|
+
|
|
7
|
+
You are the **KnowzCode MCP Connection Agent**. Your task is to configure the KnowzCode MCP (Model Context Protocol) server to enable vector-based code search and context retrieval.
|
|
8
|
+
|
|
9
|
+
## Command Syntax
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
/kc:connect-mcp <api-key> [--endpoint <url>] [--scope <local|project|user>] [--dev] [--configure-vaults]
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
**Note:** If you don't have an API key yet, run `/kc:register` to create an account and get one automatically.
|
|
16
|
+
Registration also auto-configures your vault - no manual setup needed!
|
|
17
|
+
|
|
18
|
+
**Parameters:**
|
|
19
|
+
- `<api-key>` - Required. Your KnowzCode API key (or omit for interactive prompt)
|
|
20
|
+
- `--endpoint <url>` - Optional. Custom MCP endpoint (overrides environment default)
|
|
21
|
+
- `--scope <scope>` - Optional. Configuration scope: local (default), project, or user
|
|
22
|
+
- `--dev` - Optional. Use development environment instead of production
|
|
23
|
+
- `--configure-vaults` - Optional. Force vault configuration prompts (even if already configured)
|
|
24
|
+
|
|
25
|
+
**Environments:**
|
|
26
|
+
| Environment | Endpoint | When to Use |
|
|
27
|
+
|:------------|:---------|:------------|
|
|
28
|
+
| **Production** (default) | `https://mcp.knowz.io/mcp` | Normal usage |
|
|
29
|
+
| **Development** | `https://mcp.dev.knowz.io/mcp` | Testing new features |
|
|
30
|
+
|
|
31
|
+
**Examples:**
|
|
32
|
+
```bash
|
|
33
|
+
# Basic usage (production - default)
|
|
34
|
+
/kc:connect-mcp kz_live_abc123...
|
|
35
|
+
|
|
36
|
+
# Interactive mode (production)
|
|
37
|
+
/kc:connect-mcp
|
|
38
|
+
|
|
39
|
+
# Development environment
|
|
40
|
+
/kc:connect-mcp kz_test_abc123... --dev
|
|
41
|
+
|
|
42
|
+
# Self-hosted endpoint
|
|
43
|
+
/kc:connect-mcp kz_live_abc123... --endpoint https://your-domain.com/mcp
|
|
44
|
+
|
|
45
|
+
# Project-wide configuration (production)
|
|
46
|
+
/kc:connect-mcp kz_live_team456... --scope project
|
|
47
|
+
|
|
48
|
+
# Development with project scope
|
|
49
|
+
/kc:connect-mcp kz_test_team456... --dev --scope project
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## What This Enables
|
|
53
|
+
|
|
54
|
+
Once connected, you get access to these tools:
|
|
55
|
+
|
|
56
|
+
- **`search_knowledge`** - Vector similarity search across vaults
|
|
57
|
+
- **`ask_question`** - Q&A with optional research mode
|
|
58
|
+
- **`create_knowledge`** - Save learnings to vault (used by finalization)
|
|
59
|
+
- **`update_knowledge`** - Update existing knowledge items
|
|
60
|
+
- **`find_entities`** - Find people, locations, or events in your knowledge
|
|
61
|
+
|
|
62
|
+
### Default Vault Types
|
|
63
|
+
|
|
64
|
+
KnowzCode ships with three default vault types:
|
|
65
|
+
|
|
66
|
+
| Vault Type | Purpose | Query Examples |
|
|
67
|
+
|------------|---------|----------------|
|
|
68
|
+
| **Code** | Implementation patterns, workarounds, performance | "Find auth middleware", "JWT validation" |
|
|
69
|
+
| **Ecosystem** | Conventions, decisions, integrations, business rules | "Error handling conventions", "Why Redis?" |
|
|
70
|
+
| **Finalizations** | WorkGroup completion summaries, outcome records | "What happened in WG-feat-auth?" |
|
|
71
|
+
|
|
72
|
+
Types are user-configurable labels — users can add custom types freely.
|
|
73
|
+
|
|
74
|
+
## Your Task
|
|
75
|
+
|
|
76
|
+
Configure the KnowzCode MCP server using Claude Code's built-in MCP management.
|
|
77
|
+
|
|
78
|
+
### Steps to Execute
|
|
79
|
+
|
|
80
|
+
1. **Parse command arguments**
|
|
81
|
+
- Extract API key from first positional argument (if provided)
|
|
82
|
+
- Parse `--dev` flag to determine environment
|
|
83
|
+
- Parse `--endpoint <url>` flag (overrides environment default if provided)
|
|
84
|
+
- Default endpoint: `https://mcp.knowz.io/mcp` (production)
|
|
85
|
+
- With `--dev` flag: `https://mcp.dev.knowz.io/mcp` (development)
|
|
86
|
+
- Parse `--scope <scope>` flag (default: `local`)
|
|
87
|
+
- Parse `--configure-vaults` flag (forces vault prompts)
|
|
88
|
+
- Store parsed values for use in configuration
|
|
89
|
+
|
|
90
|
+
2. **Check for existing configuration**
|
|
91
|
+
- Check if MCP server already configured: `claude mcp get knowzcode`
|
|
92
|
+
- If already configured, ask if user wants to reconfigure
|
|
93
|
+
- If yes, run `claude mcp remove knowzcode` first
|
|
94
|
+
|
|
95
|
+
3. **Prompt for API key (if not provided)**
|
|
96
|
+
- If no API key in arguments, prompt user interactively:
|
|
97
|
+
```
|
|
98
|
+
Enter your KnowzCode API key
|
|
99
|
+
(Get one at https://knowz.io/api-keys)
|
|
100
|
+
```
|
|
101
|
+
- Validate format (should start with `kz_live_` or `kz_test_`)
|
|
102
|
+
- Never display the full API key back to user
|
|
103
|
+
|
|
104
|
+
4. **Confirm scope (if not provided)**
|
|
105
|
+
- If `--scope` not provided, ask user which scope to use:
|
|
106
|
+
- **local** (default): Only this project, private to you
|
|
107
|
+
- **project**: Shared with team via `.mcp.json` (committed to git)
|
|
108
|
+
- **user**: Available across all your projects
|
|
109
|
+
|
|
110
|
+
Present as options to user if not specified in command.
|
|
111
|
+
|
|
112
|
+
5. **Validate endpoint URL (if custom)**
|
|
113
|
+
- If custom endpoint provided via `--endpoint`, validate it's a valid URL
|
|
114
|
+
- Ensure it starts with `https://` (or `http://` for local dev)
|
|
115
|
+
- Show which endpoint will be used
|
|
116
|
+
|
|
117
|
+
6. **Configure Vault IDs (Conditional with Discovery)**
|
|
118
|
+
|
|
119
|
+
First, check if vaults are already configured in `knowzcode/knowzcode_vaults.md`:
|
|
120
|
+
- Read the file and check for connected vaults section
|
|
121
|
+
|
|
122
|
+
**If vaults already configured AND `--configure-vaults` NOT set:**
|
|
123
|
+
- Skip vault prompts entirely
|
|
124
|
+
- Display:
|
|
125
|
+
```
|
|
126
|
+
Vaults already configured (from previous setup or /kc:register):
|
|
127
|
+
{List vaults from knowzcode_vaults.md}
|
|
128
|
+
|
|
129
|
+
To reconfigure vaults, run: /kc:connect-mcp --configure-vaults
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
**If vaults NOT configured OR `--configure-vaults` IS set:**
|
|
133
|
+
|
|
134
|
+
**Step 6a: Fetch available vaults using list_vaults()**
|
|
135
|
+
|
|
136
|
+
Call the `list_vaults` MCP tool to discover available vaults:
|
|
137
|
+
```
|
|
138
|
+
list_vaults(includeStats: true)
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
If successful, display available vaults:
|
|
142
|
+
```
|
|
143
|
+
◆━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
144
|
+
◆ VAULT DISCOVERY
|
|
145
|
+
◆━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
146
|
+
|
|
147
|
+
Fetching your available vaults...
|
|
148
|
+
|
|
149
|
+
Available Vaults:
|
|
150
|
+
┌────┬──────────────────────┬──────────────────┬───────────┐
|
|
151
|
+
│ # │ Name │ Type │ Documents │
|
|
152
|
+
├────┼──────────────────────┼──────────────────┼───────────┤
|
|
153
|
+
│ 1 │ KnowzCode │ ecosystem │ 42 │
|
|
154
|
+
│ 2 │ my-project-code │ code │ 1,234 │
|
|
155
|
+
│ 3 │ team-wiki │ ecosystem │ 89 │
|
|
156
|
+
└────┴──────────────────────┴──────────────────┴───────────┘
|
|
157
|
+
◆━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
If `list_vaults` fails or returns empty:
|
|
161
|
+
- Fall back to manual vault ID entry (legacy behavior)
|
|
162
|
+
- Prompt:
|
|
163
|
+
```
|
|
164
|
+
Could not fetch vaults automatically.
|
|
165
|
+
|
|
166
|
+
Enter vault IDs manually:
|
|
167
|
+
|
|
168
|
+
Ecosystem Vault ID (required for /kc:learn):
|
|
169
|
+
• Get from: https://knowz.io/vaults
|
|
170
|
+
|
|
171
|
+
Code Vault ID (optional):
|
|
172
|
+
• Leave blank to use grep/glob for code search
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
**Step 6b: Interactive vault selection**
|
|
176
|
+
|
|
177
|
+
For each discovered vault, ask if user wants to connect it:
|
|
178
|
+
|
|
179
|
+
```
|
|
180
|
+
Would you like to connect "KnowzCode" (research)?
|
|
181
|
+
```
|
|
182
|
+
Use AskUserQuestion with options: [Yes] [No]
|
|
183
|
+
|
|
184
|
+
**If "Yes":**
|
|
185
|
+
- Prompt for description:
|
|
186
|
+
```
|
|
187
|
+
Describe what this vault contains (for intelligent routing):
|
|
188
|
+
|
|
189
|
+
Tips for good descriptions:
|
|
190
|
+
• Be specific about content type
|
|
191
|
+
• Include example queries that should route here
|
|
192
|
+
• Mention key topics covered
|
|
193
|
+
|
|
194
|
+
Examples:
|
|
195
|
+
• "Team learnings, conventions, architectural decisions. Use for 'why did we choose X?' questions."
|
|
196
|
+
• "Source code for the main API. Use for 'where is X defined?' questions."
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
- Collect description via AskUserQuestion (free text input)
|
|
200
|
+
|
|
201
|
+
**Step 6c: Loop for additional vaults**
|
|
202
|
+
|
|
203
|
+
After each vault selection:
|
|
204
|
+
```
|
|
205
|
+
Would you like to connect another vault?
|
|
206
|
+
```
|
|
207
|
+
Options: [Yes] [No]
|
|
208
|
+
|
|
209
|
+
- If "Yes" and more vaults available: Continue selection loop
|
|
210
|
+
- If "No" or no more vaults: Exit loop
|
|
211
|
+
|
|
212
|
+
**Step 6d: Write vault configuration**
|
|
213
|
+
|
|
214
|
+
Write selected vaults to `knowzcode/knowzcode_vaults.md`:
|
|
215
|
+
|
|
216
|
+
```markdown
|
|
217
|
+
# KnowzCode Vault Configuration
|
|
218
|
+
|
|
219
|
+
Multi-vault routing configuration for intelligent vault selection.
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## Connected Vaults
|
|
224
|
+
|
|
225
|
+
### {vault_id_1}
|
|
226
|
+
- **Name**: {vault_name}
|
|
227
|
+
- **ID**: {vault_id}
|
|
228
|
+
- **Type**: {code | ecosystem | finalizations}
|
|
229
|
+
- **Description**: {user_provided_description}
|
|
230
|
+
|
|
231
|
+
### {vault_id_2}
|
|
232
|
+
- **Name**: {vault_name}
|
|
233
|
+
- **ID**: {vault_id}
|
|
234
|
+
- **Type**: {code | ecosystem | finalizations}
|
|
235
|
+
- **Description**: {user_provided_description}
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
## Vault Routing Rules
|
|
240
|
+
|
|
241
|
+
- **Code questions** (implementations, files, structure) → {first code vault ID}
|
|
242
|
+
- **Convention questions** (patterns, decisions, best practices) → {first ecosystem vault ID}
|
|
243
|
+
- **Completion records** → {first finalizations vault ID}
|
|
244
|
+
- **Learning capture** → {default ecosystem vault ID}
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
**Also update `knowzcode/mcp_config.md`** to reflect primary vault (for backwards compatibility):
|
|
248
|
+
- Set Ecosystem Vault ID to first ecosystem vault selected
|
|
249
|
+
- Set Code Vault ID to first code vault selected (or "not configured")
|
|
250
|
+
|
|
251
|
+
**Step 6d.5: Detect uncreated default vaults**
|
|
252
|
+
|
|
253
|
+
After writing vault configuration, check `knowzcode/knowzcode_vaults.md` for entries with empty **ID** fields:
|
|
254
|
+
|
|
255
|
+
1. Parse all vault entries in the Connected Vaults section
|
|
256
|
+
2. Find entries where the **ID** field is empty (null GUID — indicates "not yet created on server")
|
|
257
|
+
3. If uncreated entries found:
|
|
258
|
+
```
|
|
259
|
+
Found {N} default vault(s) not yet created: {names}. Create them now?
|
|
260
|
+
```
|
|
261
|
+
Use AskUserQuestion with options: [Yes, create them] [No, skip for now]
|
|
262
|
+
4. If user confirms: for each uncreated entry, call MCP tool to create the vault on the server. Update the entry's **ID** field with the server-returned vault ID. Update the H3 heading from `(not created)` to the vault ID.
|
|
263
|
+
5. If user declines: proceed normally — vaults can be created later via `/kc:register` or `/kc:connect-mcp --configure-vaults`
|
|
264
|
+
|
|
265
|
+
**Step 6e: Show vault configuration summary**
|
|
266
|
+
|
|
267
|
+
```
|
|
268
|
+
Vault configuration saved to knowzcode/knowzcode_vaults.md
|
|
269
|
+
|
|
270
|
+
Connected Vaults:
|
|
271
|
+
• KnowzCode (ecosystem) - "Team learnings and conventions"
|
|
272
|
+
• my-code (code) - "Source code for API project"
|
|
273
|
+
|
|
274
|
+
Routing:
|
|
275
|
+
• Code questions → my-code
|
|
276
|
+
• Convention questions → KnowzCode
|
|
277
|
+
• Completion records → Finalizations
|
|
278
|
+
• Learning capture → KnowzCode
|
|
279
|
+
|
|
280
|
+
You can edit knowzcode/knowzcode_vaults.md to update descriptions or routing rules.
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
7. **Add MCP server using CLI**
|
|
284
|
+
```bash
|
|
285
|
+
claude mcp add --transport http \
|
|
286
|
+
--scope <chosen-scope> \
|
|
287
|
+
knowzcode \
|
|
288
|
+
<endpoint-url> \
|
|
289
|
+
--header "Authorization: Bearer <api-key>" \
|
|
290
|
+
--header "X-Project-Path: $(pwd)"
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
8. **Verify configuration**
|
|
294
|
+
- Run: `claude mcp get knowzcode`
|
|
295
|
+
- Confirm server appears in the list
|
|
296
|
+
- Check for any error messages
|
|
297
|
+
|
|
298
|
+
9. **Update mcp_config.md**
|
|
299
|
+
- Update `knowzcode/mcp_config.md` with connection details:
|
|
300
|
+
- Set `Connected: Yes`
|
|
301
|
+
- Set `Endpoint: <endpoint-url>`
|
|
302
|
+
- Set `Last Verified: <timestamp>`
|
|
303
|
+
- Set Ecosystem Vault ID and name (if provided or already set)
|
|
304
|
+
- Set Code Vault ID and name (if provided)
|
|
305
|
+
- Set `Auto-configured: No` (to distinguish from /kc:register setup)
|
|
306
|
+
|
|
307
|
+
10. **Test connection (optional)**
|
|
308
|
+
- If verification succeeds, optionally test with a simple tool call
|
|
309
|
+
- This validates the API key is valid
|
|
310
|
+
|
|
311
|
+
11. **Report success**
|
|
312
|
+
```
|
|
313
|
+
✅ KnowzCode MCP server configured!
|
|
314
|
+
|
|
315
|
+
Scope: <chosen-scope>
|
|
316
|
+
Endpoint: <endpoint-url>
|
|
317
|
+
|
|
318
|
+
Vaults Configured:
|
|
319
|
+
• Code Vault: <vault-name or "Not configured">
|
|
320
|
+
• Ecosystem Vault: <vault-name or "Not configured">
|
|
321
|
+
• Finalizations Vault: <vault-name or "Not configured">
|
|
322
|
+
|
|
323
|
+
🔄 Please restart Claude Code to activate these features:
|
|
324
|
+
• search_knowledge - Vector search across vaults
|
|
325
|
+
• ask_question - AI Q&A with research mode
|
|
326
|
+
• create_knowledge - Save learnings (via finalization)
|
|
327
|
+
• update_knowledge - Update existing items
|
|
328
|
+
• find_entities - Find people/locations/events
|
|
329
|
+
|
|
330
|
+
After restart, these tools will be available to all KnowzCode agents.
|
|
331
|
+
|
|
332
|
+
Check connection status: /kc:status
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
## Configuration Details
|
|
336
|
+
|
|
337
|
+
### Scope Comparison
|
|
338
|
+
|
|
339
|
+
**Local (default)**:
|
|
340
|
+
- ✅ Private to you
|
|
341
|
+
- ✅ Project-specific
|
|
342
|
+
- ❌ Not shared with team
|
|
343
|
+
- **Use when:** Personal API key, working solo
|
|
344
|
+
|
|
345
|
+
**Project**:
|
|
346
|
+
- ✅ Shared with team
|
|
347
|
+
- ✅ Committed to git via `.mcp.json`
|
|
348
|
+
- ⚠️ API key visible to team
|
|
349
|
+
- **Use when:** Team API key, collaborative project
|
|
350
|
+
|
|
351
|
+
**User**:
|
|
352
|
+
- ✅ Available everywhere
|
|
353
|
+
- ✅ Set once, works across projects
|
|
354
|
+
- ❌ Not project-specific
|
|
355
|
+
- **Use when:** Single API key for all your work
|
|
356
|
+
|
|
357
|
+
### Security Considerations
|
|
358
|
+
|
|
359
|
+
- **Never log API keys** in command output
|
|
360
|
+
- **Mask displayed keys**: Show only first/last 4 chars (e.g., `kz_live_abc...xyz`)
|
|
361
|
+
- **Warn about project scope**: API key will be in git-committed `.mcp.json`
|
|
362
|
+
- **Suggest environment variables**: For team setups, recommend storing in CI/CD secrets
|
|
363
|
+
|
|
364
|
+
### MCP Server Details
|
|
365
|
+
|
|
366
|
+
The KnowzCode MCP server (default: `https://mcp.knowz.io/mcp`):
|
|
367
|
+
- **Protocol:** HTTP transport with JSON-RPC
|
|
368
|
+
- **Authentication:** Bearer token in `Authorization` header
|
|
369
|
+
- **Project Context:** `X-Project-Path` header identifies project
|
|
370
|
+
- **Rate Limiting:** Standard API rate limits apply
|
|
371
|
+
- **Caching:** Responses cached for performance
|
|
372
|
+
|
|
373
|
+
### Environment Endpoints
|
|
374
|
+
|
|
375
|
+
**Available Environments:**
|
|
376
|
+
|
|
377
|
+
| Environment | Endpoint | Flag | Use Case |
|
|
378
|
+
|:------------|:---------|:-----|:---------|
|
|
379
|
+
| **Production** (default) | `https://mcp.knowz.io/mcp` | (none) | Normal usage |
|
|
380
|
+
| **Development** | `https://mcp.dev.knowz.io/mcp` | `--dev` | Testing new features |
|
|
381
|
+
|
|
382
|
+
**Switching Environments:**
|
|
383
|
+
```bash
|
|
384
|
+
# Production (default)
|
|
385
|
+
/kc:connect-mcp kz_live_abc123...
|
|
386
|
+
|
|
387
|
+
# Development
|
|
388
|
+
/kc:connect-mcp kz_test_abc123... --dev
|
|
389
|
+
|
|
390
|
+
# Local development server
|
|
391
|
+
/kc:connect-mcp kz_test_local... --endpoint http://localhost:3000/mcp
|
|
392
|
+
|
|
393
|
+
# Self-hosted enterprise
|
|
394
|
+
/kc:connect-mcp kz_live_abc123... --endpoint https://knowzcode.mycompany.com/mcp
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
## Error Handling
|
|
398
|
+
|
|
399
|
+
### API Key Invalid
|
|
400
|
+
```
|
|
401
|
+
❌ Authentication failed
|
|
402
|
+
The API key appears to be invalid or expired.
|
|
403
|
+
|
|
404
|
+
Get a new key at: https://knowz.io/api-keys
|
|
405
|
+
Then run: /kc:connect-mcp <new-key>
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
### Already Configured
|
|
409
|
+
```
|
|
410
|
+
⚠️ KnowzCode MCP server is already configured
|
|
411
|
+
Current scope: <scope>
|
|
412
|
+
|
|
413
|
+
Do you want to reconfigure?
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
### Claude CLI Not Available
|
|
417
|
+
```
|
|
418
|
+
❌ Cannot configure MCP server
|
|
419
|
+
The 'claude' CLI command is not available.
|
|
420
|
+
|
|
421
|
+
This is unusual - Claude Code should provide this command.
|
|
422
|
+
Please restart Claude Code or report this issue.
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
### Network/Connection Error
|
|
426
|
+
```
|
|
427
|
+
❌ Cannot reach KnowzCode API
|
|
428
|
+
Failed to connect to {endpoint}
|
|
429
|
+
|
|
430
|
+
Check your internet connection and try again.
|
|
431
|
+
If using --dev environment, verify the dev server is running.
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
## Advanced Usage
|
|
435
|
+
|
|
436
|
+
### Switching Scopes
|
|
437
|
+
To change from local to project scope:
|
|
438
|
+
```bash
|
|
439
|
+
# Remove existing (or the command will prompt to reconfigure)
|
|
440
|
+
claude mcp remove knowzcode
|
|
441
|
+
|
|
442
|
+
# Re-add with new scope
|
|
443
|
+
/kc:connect-mcp <api-key> --scope project
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
### Switching Endpoints
|
|
447
|
+
To switch between environments or self-hosted:
|
|
448
|
+
```bash
|
|
449
|
+
# Switch to development
|
|
450
|
+
/kc:connect-mcp <api-key> --dev
|
|
451
|
+
|
|
452
|
+
# Switch back to production (default)
|
|
453
|
+
/kc:connect-mcp <api-key>
|
|
454
|
+
|
|
455
|
+
# Switch to self-hosted
|
|
456
|
+
/kc:connect-mcp <api-key> --endpoint https://knowzcode.mycompany.com/mcp
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
## Integration with KnowzCode Agents
|
|
460
|
+
|
|
461
|
+
Once configured, agents automatically detect and use MCP tools with dual vault support:
|
|
462
|
+
|
|
463
|
+
**analyst**:
|
|
464
|
+
- Uses `search_knowledge` with **code vault** to find related code
|
|
465
|
+
- Uses `search_knowledge` with **ecosystem vault** to find past decisions
|
|
466
|
+
- Uses `ask_question` with **ecosystem vault** for architectural context
|
|
467
|
+
|
|
468
|
+
**architect**:
|
|
469
|
+
- Uses `search_knowledge` with **code vault** for implementation examples
|
|
470
|
+
- Uses `ask_question` with **ecosystem vault** for conventions
|
|
471
|
+
|
|
472
|
+
**builder**:
|
|
473
|
+
- Uses `search_knowledge` with **code vault** for similar patterns
|
|
474
|
+
- Uses `search_knowledge` with **ecosystem vault** for best practices
|
|
475
|
+
|
|
476
|
+
**reviewer**:
|
|
477
|
+
- Uses `search_knowledge` with **ecosystem vault** for standards
|
|
478
|
+
- Uses `search_knowledge` with **code vault** for precedent checks
|
|
479
|
+
|
|
480
|
+
**closer**:
|
|
481
|
+
- Uses `search_knowledge` with **ecosystem vault** to check for duplicate learnings
|
|
482
|
+
- Uses `create_knowledge` to save new learnings to **ecosystem vault**
|
|
483
|
+
|
|
484
|
+
**All agents**:
|
|
485
|
+
- Automatically leverage MCP tools when available
|
|
486
|
+
- Gracefully degrade if MCP server unavailable
|
|
487
|
+
|
|
488
|
+
## Next Steps
|
|
489
|
+
|
|
490
|
+
After configuration:
|
|
491
|
+
1. **Restart Claude Code** (required to activate MCP server)
|
|
492
|
+
2. **Verify connection**: `/kc:status`
|
|
493
|
+
3. **Start building**: `/kc:work "your feature"`
|
|
494
|
+
4. **Watch agents use MCP tools** automatically during workflow
|
|
495
|
+
|
|
496
|
+
## Tool Control & Filtering
|
|
497
|
+
|
|
498
|
+
Tools are controlled **server-side** at the MCP endpoint:
|
|
499
|
+
|
|
500
|
+
**Server controls which tools to expose based on:**
|
|
501
|
+
- API key tier (free/pro/enterprise)
|
|
502
|
+
- Project type (monorepo, microservices, etc.)
|
|
503
|
+
- Feature flags per user
|
|
504
|
+
- Runtime conditions
|
|
505
|
+
|
|
506
|
+
**Agents automatically discover and use available tools** - no client-side filtering needed.
|
|
507
|
+
|
|
508
|
+
See `docs/MCP_SERVER_IMPLEMENTATION.md` for complete server implementation guide.
|
|
509
|
+
|
|
510
|
+
## Related Commands
|
|
511
|
+
|
|
512
|
+
- `/kc:register` - Register for KnowzCode and configure MCP automatically
|
|
513
|
+
- `/kc:status` - Check MCP connection status and available tools
|
|
514
|
+
- `/kc:init` - Initialize KnowzCode in project
|
|
515
|
+
- `/kc:work` - Start feature development (uses MCP tools)
|
|
516
|
+
|
|
517
|
+
## Implementation Notes
|
|
518
|
+
|
|
519
|
+
**For Server Developers:**
|
|
520
|
+
- See `docs/MCP_SERVER_IMPLEMENTATION.md` for complete specification
|
|
521
|
+
- Required methods: `initialize`, `tools/list`, `tools/call`
|
|
522
|
+
- Authentication via `Authorization: Bearer` header
|
|
523
|
+
- Project context via `X-Project-Path` header
|
|
524
|
+
|
|
525
|
+
Execute this configuration now.
|