@cosmocoder/mcp-web-docs 1.2.0 → 1.4.0
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 +158 -0
- package/build/index.js +490 -8
- package/build/index.js.map +1 -1
- package/build/storage/storage.d.ts +64 -1
- package/build/storage/storage.js +373 -4
- package/build/storage/storage.js.map +1 -1
- package/build/storage/storage.test.js +361 -0
- package/build/storage/storage.test.js.map +1 -1
- package/build/types.d.ts +26 -0
- package/build/util/security.d.ts +56 -0
- package/build/util/security.js +63 -0
- package/build/util/security.js.map +1 -1
- package/package.json +12 -12
package/README.md
CHANGED
|
@@ -38,7 +38,9 @@ AI assistants struggle with documentation:
|
|
|
38
38
|
|
|
39
39
|
- **🌐 Universal Crawler** - Works with any documentation site, not just GitHub
|
|
40
40
|
- **🔍 Hybrid Search** - Combines full-text search (FTS) with semantic vector search
|
|
41
|
+
- **📂 Collections** - Group related docs into named collections for project-based organization
|
|
41
42
|
- **🏷️ Tags & Categories** - Organize docs with tags and filter searches by project, team, or category
|
|
43
|
+
- **📦 Version Support** - Index multiple versions of the same package (e.g., React 18 and 19)
|
|
42
44
|
- **🔐 Authentication Support** - Crawl private/protected docs with interactive browser login (auto-detects your default browser)
|
|
43
45
|
- **📊 Smart Extraction** - Automatically extracts code blocks, props tables, and structured content
|
|
44
46
|
- **⚡ Local Embeddings** - Uses FastEmbed for fast, private embedding generation (no API keys)
|
|
@@ -320,6 +322,7 @@ add_documentation({
|
|
|
320
322
|
title: "Example Docs", // Optional
|
|
321
323
|
id: "example-docs", // Optional custom ID
|
|
322
324
|
tags: ["frontend", "mycompany"], // Optional tags for categorization
|
|
325
|
+
version: "2.0", // Optional version for versioned packages
|
|
323
326
|
auth: { // Optional authentication
|
|
324
327
|
requiresAuth: true,
|
|
325
328
|
// browser auto-detected from OS settings if omitted
|
|
@@ -388,6 +391,95 @@ Delete an indexed documentation site and all its data.
|
|
|
388
391
|
|
|
389
392
|
Clear saved authentication session for a domain.
|
|
390
393
|
|
|
394
|
+
### Collection Tools
|
|
395
|
+
|
|
396
|
+
Collections let you group related documentation sites together for project-based organization. Unlike tags (which categorize individual docs), collections create named workspaces like "My React Project" containing React + Next.js + TypeScript docs.
|
|
397
|
+
|
|
398
|
+
#### `create_collection`
|
|
399
|
+
|
|
400
|
+
Create a new collection to group documentation sites.
|
|
401
|
+
|
|
402
|
+
```typescript
|
|
403
|
+
create_collection({
|
|
404
|
+
name: "My React Project",
|
|
405
|
+
description: "React, Next.js, and TypeScript docs for my project" // Optional
|
|
406
|
+
})
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
#### `add_to_collection`
|
|
410
|
+
|
|
411
|
+
Add indexed documentation sites to a collection.
|
|
412
|
+
|
|
413
|
+
```typescript
|
|
414
|
+
add_to_collection({
|
|
415
|
+
name: "My React Project",
|
|
416
|
+
urls: [
|
|
417
|
+
"https://react.dev/",
|
|
418
|
+
"https://nextjs.org/docs/",
|
|
419
|
+
"https://www.typescriptlang.org/docs/"
|
|
420
|
+
]
|
|
421
|
+
})
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
#### `search_collection`
|
|
425
|
+
|
|
426
|
+
Search within a specific collection. Uses the same hybrid search as `search_documentation` but limited to docs in the collection.
|
|
427
|
+
|
|
428
|
+
```typescript
|
|
429
|
+
search_collection({
|
|
430
|
+
name: "My React Project",
|
|
431
|
+
query: "server components data fetching",
|
|
432
|
+
limit: 10 // Optional
|
|
433
|
+
})
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
#### `list_collections`
|
|
437
|
+
|
|
438
|
+
List all collections with their document counts.
|
|
439
|
+
|
|
440
|
+
#### `get_collection`
|
|
441
|
+
|
|
442
|
+
Get details of a specific collection including all its documentation sites.
|
|
443
|
+
|
|
444
|
+
```typescript
|
|
445
|
+
get_collection({
|
|
446
|
+
name: "My React Project"
|
|
447
|
+
})
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
#### `update_collection`
|
|
451
|
+
|
|
452
|
+
Rename a collection or update its description.
|
|
453
|
+
|
|
454
|
+
```typescript
|
|
455
|
+
update_collection({
|
|
456
|
+
name: "My React Project",
|
|
457
|
+
newName: "Frontend Stack", // Optional
|
|
458
|
+
description: "Updated description" // Optional
|
|
459
|
+
})
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
#### `remove_from_collection`
|
|
463
|
+
|
|
464
|
+
Remove documentation sites from a collection. The sites remain indexed, just removed from the collection.
|
|
465
|
+
|
|
466
|
+
```typescript
|
|
467
|
+
remove_from_collection({
|
|
468
|
+
name: "My React Project",
|
|
469
|
+
urls: ["https://old-library.dev/docs/"]
|
|
470
|
+
})
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
#### `delete_collection`
|
|
474
|
+
|
|
475
|
+
Delete a collection. The documentation sites in the collection are **not** deleted, only the collection grouping.
|
|
476
|
+
|
|
477
|
+
```typescript
|
|
478
|
+
delete_collection({
|
|
479
|
+
name: "Old Project"
|
|
480
|
+
})
|
|
481
|
+
```
|
|
482
|
+
|
|
391
483
|
---
|
|
392
484
|
|
|
393
485
|
## 💡 Tips
|
|
@@ -469,6 +561,72 @@ search_documentation({
|
|
|
469
561
|
|
|
470
562
|
You can also add tags to existing documentation with `set_tags`.
|
|
471
563
|
|
|
564
|
+
### Using Collections for Project Organization
|
|
565
|
+
|
|
566
|
+
Collections provide a higher-level grouping than tags — they let you organize documentation by project or context, making it easy to switch between different work contexts.
|
|
567
|
+
|
|
568
|
+
**Create a collection for your project:**
|
|
569
|
+
```typescript
|
|
570
|
+
create_collection({
|
|
571
|
+
name: "E-commerce Backend",
|
|
572
|
+
description: "All docs for the backend rewrite project"
|
|
573
|
+
})
|
|
574
|
+
```
|
|
575
|
+
|
|
576
|
+
**Add relevant documentation:**
|
|
577
|
+
```typescript
|
|
578
|
+
add_to_collection({
|
|
579
|
+
name: "E-commerce Backend",
|
|
580
|
+
urls: [
|
|
581
|
+
"https://fastapi.tiangolo.com/",
|
|
582
|
+
"https://docs.sqlalchemy.org/",
|
|
583
|
+
"https://redis.io/docs/"
|
|
584
|
+
]
|
|
585
|
+
})
|
|
586
|
+
```
|
|
587
|
+
|
|
588
|
+
**Search within your project context:**
|
|
589
|
+
```typescript
|
|
590
|
+
search_collection({
|
|
591
|
+
name: "E-commerce Backend",
|
|
592
|
+
query: "connection pooling best practices"
|
|
593
|
+
})
|
|
594
|
+
```
|
|
595
|
+
|
|
596
|
+
**Collections vs Tags:**
|
|
597
|
+
| Feature | Collections | Tags |
|
|
598
|
+
|---------|-------------|------|
|
|
599
|
+
| Purpose | Group docs as a project/workspace | Categorize individual docs |
|
|
600
|
+
| Structure | Named container with multiple docs | Labels on individual docs |
|
|
601
|
+
| Use case | "My React Project" with React + Next.js + TS | "This doc is about React" |
|
|
602
|
+
| Searching | `search_collection` for focused results | `tags` filter in `search_documentation` |
|
|
603
|
+
|
|
604
|
+
You can use both together — a document can have tags AND belong to multiple collections.
|
|
605
|
+
|
|
606
|
+
### Versioning Package Documentation
|
|
607
|
+
|
|
608
|
+
When indexing documentation for versioned packages (React, Vue, Python libraries, etc.), you can specify the version to track which version you've indexed:
|
|
609
|
+
|
|
610
|
+
```typescript
|
|
611
|
+
// Index React 18 docs
|
|
612
|
+
add_documentation({
|
|
613
|
+
url: "https://18.react.dev/",
|
|
614
|
+
title: "React 18 Docs",
|
|
615
|
+
version: "18"
|
|
616
|
+
})
|
|
617
|
+
|
|
618
|
+
// Index React 19 docs (different URL)
|
|
619
|
+
add_documentation({
|
|
620
|
+
url: "https://react.dev/",
|
|
621
|
+
title: "React 19 Docs",
|
|
622
|
+
version: "19"
|
|
623
|
+
})
|
|
624
|
+
```
|
|
625
|
+
|
|
626
|
+
The version is displayed in `list_documentation` output and preserved when re-indexing. Version formats are flexible — use whatever makes sense for your package (e.g., `"18"`, `"v6.4"`, `"3.11"`, `"latest"`).
|
|
627
|
+
|
|
628
|
+
**Note:** Version is optional and mainly useful for software packages with multiple versions. For internal documentation, wikis, or single-version products, you can skip the version field.
|
|
629
|
+
|
|
472
630
|
---
|
|
473
631
|
|
|
474
632
|
## 🚨 Troubleshooting
|