simple-dynamsoft-mcp 6.2.0 → 6.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/.env.example +18 -0
- package/README.md +98 -19
- package/data/metadata/data-manifest.json +140 -0
- package/data/metadata/dynamsoft_sdks.json +203 -3
- package/package.json +11 -2
- package/scripts/prebuild-rag-index.mjs +24 -3
- package/scripts/run-gemini-tests.mjs +25 -0
- package/scripts/update-sdk-versions.mjs +342 -0
- package/scripts/verify-doc-resources.mjs +79 -0
- package/src/gemini-retry.js +148 -0
- package/src/index.js +293 -25
- package/src/normalizers.js +67 -8
- package/src/rag.js +649 -63
- package/src/resource-index/builders.js +294 -0
- package/src/resource-index/config.js +57 -0
- package/src/resource-index/paths.js +15 -0
- package/src/resource-index/samples.js +244 -2
- package/src/resource-index/uri.js +10 -0
- package/src/resource-index/version-policy.js +11 -1
- package/src/resource-index.js +188 -7
package/.env.example
CHANGED
|
@@ -17,10 +17,18 @@ RAG_FALLBACK=fuse
|
|
|
17
17
|
# * GEMINI_EMBED_MODEL: models/embedding-001 | models/gemini-embedding-001 | gemini-embedding-001
|
|
18
18
|
# * GEMINI_API_BASE_URL: override for proxies (default https://generativelanguage.googleapis.com)
|
|
19
19
|
# * GEMINI_EMBED_BATCH_SIZE: batch size for Gemini embedding requests
|
|
20
|
+
# * GEMINI_RETRY_MAX_ATTEMPTS: max retry attempts for retryable Gemini errors
|
|
21
|
+
# * GEMINI_RETRY_BASE_DELAY_MS: base delay for exponential backoff
|
|
22
|
+
# * GEMINI_RETRY_MAX_DELAY_MS: max delay cap for exponential backoff
|
|
23
|
+
# * GEMINI_REQUEST_THROTTLE_MS: fixed delay between Gemini requests
|
|
20
24
|
# GEMINI_API_KEY=your_key
|
|
21
25
|
# GEMINI_EMBED_MODEL=gemini-embedding-001
|
|
22
26
|
# GEMINI_API_BASE_URL=https://generativelanguage.googleapis.com
|
|
23
27
|
# GEMINI_EMBED_BATCH_SIZE=16
|
|
28
|
+
# GEMINI_RETRY_MAX_ATTEMPTS=5
|
|
29
|
+
# GEMINI_RETRY_BASE_DELAY_MS=500
|
|
30
|
+
# GEMINI_RETRY_MAX_DELAY_MS=10000
|
|
31
|
+
# GEMINI_REQUEST_THROTTLE_MS=0
|
|
24
32
|
|
|
25
33
|
# Local embeddings (used when RAG_PROVIDER=local or fallback=local)
|
|
26
34
|
# * RAG_LOCAL_MODEL: Hugging Face model id (default Xenova/all-MiniLM-L6-v2)
|
|
@@ -52,9 +60,19 @@ RAG_FALLBACK=fuse
|
|
|
52
60
|
# * RAG_REBUILD: true to ignore cache and rebuild on startup/search
|
|
53
61
|
# * RAG_PREWARM: true to build the embedding index at startup
|
|
54
62
|
# * RAG_PREWARM_BLOCK: true to block startup until prewarm completes
|
|
63
|
+
# * RAG_PREBUILT_INDEX_AUTO_DOWNLOAD: auto-download prebuilt index when local or gemini embeddings are selected
|
|
64
|
+
# * RAG_PREBUILT_INDEX_URL: global override URL for prebuilt index archive (applies to both local and gemini providers)
|
|
65
|
+
# * RAG_PREBUILT_INDEX_URL_LOCAL: provider-specific URL override for local prebuilt index archive
|
|
66
|
+
# * RAG_PREBUILT_INDEX_URL_GEMINI: provider-specific URL override for gemini prebuilt index archive
|
|
67
|
+
# * RAG_PREBUILT_INDEX_TIMEOUT_MS: timeout for prebuilt index download request
|
|
55
68
|
# RAG_REBUILD=false
|
|
56
69
|
# RAG_PREWARM=false
|
|
57
70
|
# RAG_PREWARM_BLOCK=false
|
|
71
|
+
# RAG_PREBUILT_INDEX_AUTO_DOWNLOAD=true
|
|
72
|
+
# RAG_PREBUILT_INDEX_URL=
|
|
73
|
+
# RAG_PREBUILT_INDEX_URL_LOCAL=
|
|
74
|
+
# RAG_PREBUILT_INDEX_URL_GEMINI=
|
|
75
|
+
# RAG_PREBUILT_INDEX_TIMEOUT_MS=180000
|
|
58
76
|
|
|
59
77
|
# Optional data submodule sync on server startup
|
|
60
78
|
# * DATA_SYNC_ON_START: true to fetch + fast-forward configured submodules
|
package/README.md
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
MCP (Model Context Protocol) server that enables AI assistants to write correct code with Dynamsoft SDKs. It provides actual working code snippets, documentation links, and API guidance for:
|
|
4
4
|
|
|
5
|
+
- **Dynamsoft Capture Vision (DCV)** - Unified workflows for VIN, MRZ, document normalization, driver license parsing, and more
|
|
5
6
|
- **Dynamsoft Barcode Reader Mobile** - Android (Java/Kotlin) and iOS (Swift)
|
|
6
7
|
- **Dynamsoft Barcode Reader Server/Desktop** - Python, .NET, Java, C++, Node.js
|
|
7
8
|
- **Dynamsoft Barcode Reader Web** - JavaScript/TypeScript barcode scanning
|
|
@@ -16,7 +17,7 @@ https://github.com/user-attachments/assets/cc1c5f4b-1461-4462-897a-75abc20d62a6
|
|
|
16
17
|
|
|
17
18
|
- **Code Snippets**: Real, working source code from official Dynamsoft samples
|
|
18
19
|
- **Trial License Included**: Ready-to-use trial license for quick testing
|
|
19
|
-
- **Multiple SDKs**: Barcode Reader (Mobile/Web/Server) + Dynamic Web TWAIN + Document Viewer
|
|
20
|
+
- **Multiple SDKs**: Capture Vision + Barcode Reader (Mobile/Web/Server) + Dynamic Web TWAIN + Document Viewer
|
|
20
21
|
- **Multiple API Levels**: High-level (simple) and low-level (advanced) options
|
|
21
22
|
- **Stdio MCP server**: Runs on stdio. Works with any MCP-capable client.
|
|
22
23
|
- **Resource-efficient discovery**: Resources are discovered via tools (semantic RAG search with fuzzy fallback + resource links). Only a small pinned set is listed by default; heavy content is fetched on-demand with `resources/read`.
|
|
@@ -184,6 +185,11 @@ Example:
|
|
|
184
185
|
Commonly used settings:
|
|
185
186
|
- `RAG_PROVIDER`: `auto` | `gemini` | `local` | `fuse`
|
|
186
187
|
- `RAG_FALLBACK`: `fuse` | `local` | `none`
|
|
188
|
+
- `RAG_PREBUILT_INDEX_AUTO_DOWNLOAD`: `true` by default; auto-fetch prebuilt index when local or gemini embeddings are selected
|
|
189
|
+
- `RAG_PREBUILT_INDEX_URL`: global override release asset URL for prebuilt index archive
|
|
190
|
+
- `RAG_PREBUILT_INDEX_URL_LOCAL`: override release asset URL for local prebuilt index archive
|
|
191
|
+
- `RAG_PREBUILT_INDEX_URL_GEMINI`: override release asset URL for gemini prebuilt index archive
|
|
192
|
+
- `RAG_PREBUILT_INDEX_TIMEOUT_MS`: download timeout for prebuilt index fetch
|
|
187
193
|
- `MCP_DATA_DIR`: use a preloaded local data folder (`metadata/`, `samples/`, `documentation/`)
|
|
188
194
|
- `MCP_DATA_AUTO_DOWNLOAD`: allow startup archive download when bundled data is unavailable
|
|
189
195
|
- `MCP_DATA_REFRESH_ON_START`: force re-download of pinned archives on startup
|
|
@@ -195,17 +201,19 @@ For the complete list and defaults, see `.env.example` and the sections `Submodu
|
|
|
195
201
|
|
|
196
202
|
## Use Release Assets In A Local Project
|
|
197
203
|
|
|
198
|
-
Use this when you want to run from a built `.tgz` package and reuse
|
|
204
|
+
Use this when you want to run from a built `.tgz` package and reuse prebuilt RAG indexes.
|
|
199
205
|
|
|
200
206
|
1. Download release assets from GitHub Releases for the same version:
|
|
201
207
|
- `simple-dynamsoft-mcp-<version>.tgz`
|
|
202
|
-
- `prebuilt-rag-index-<version>.tar.gz`
|
|
208
|
+
- `prebuilt-rag-index-local-<version>.tar.gz`
|
|
209
|
+
- `prebuilt-rag-index-gemini-<version>.tar.gz` (only needed if `RAG_PROVIDER=gemini`)
|
|
203
210
|
2. In your project folder, create a local tools folder, for example:
|
|
204
211
|
- `<project>/.tools/simple-dynamsoft-mcp/`
|
|
205
|
-
3. Copy assets into that folder and extract the prebuilt index:
|
|
212
|
+
3. Copy assets into that folder and extract the prebuilt index you plan to use:
|
|
206
213
|
- Keep `simple-dynamsoft-mcp-<version>.tgz` as-is for `npx --package`.
|
|
207
|
-
- Extract `prebuilt-rag-index-<version>.tar.gz
|
|
208
|
-
-
|
|
214
|
+
- Extract `prebuilt-rag-index-local-<version>.tar.gz` for local embeddings.
|
|
215
|
+
- Extract `prebuilt-rag-index-gemini-<version>.tar.gz` for gemini embeddings.
|
|
216
|
+
- Expected cache output path: `<project>/.tools/simple-dynamsoft-mcp/prebuilt-rag/<provider>/cache/*.json`.
|
|
209
217
|
4. Configure project-local `.vscode/mcp.json` to use the local package and cache path.
|
|
210
218
|
|
|
211
219
|
Example (`.vscode/mcp.json`):
|
|
@@ -218,7 +226,7 @@ Example (`.vscode/mcp.json`):
|
|
|
218
226
|
"args": [
|
|
219
227
|
"-y",
|
|
220
228
|
"--package",
|
|
221
|
-
".tools/simple-dynamsoft-mcp/simple-dynamsoft-mcp
|
|
229
|
+
".tools/simple-dynamsoft-mcp/simple-dynamsoft-mcp-<version>.tgz",
|
|
222
230
|
"simple-dynamsoft-mcp"
|
|
223
231
|
],
|
|
224
232
|
"env": {
|
|
@@ -227,7 +235,7 @@ Example (`.vscode/mcp.json`):
|
|
|
227
235
|
"RAG_REBUILD": "false",
|
|
228
236
|
"RAG_LOCAL_MODEL": "Xenova/all-MiniLM-L6-v2",
|
|
229
237
|
"RAG_LOCAL_QUANTIZED": "true",
|
|
230
|
-
"RAG_CACHE_DIR": ".tools/simple-dynamsoft-mcp/prebuilt-rag/cache"
|
|
238
|
+
"RAG_CACHE_DIR": ".tools/simple-dynamsoft-mcp/prebuilt-rag/local/cache"
|
|
231
239
|
}
|
|
232
240
|
}
|
|
233
241
|
}
|
|
@@ -237,12 +245,29 @@ Example (`.vscode/mcp.json`):
|
|
|
237
245
|
Notes:
|
|
238
246
|
- Use absolute paths if your MCP client does not resolve relative paths from workspace root.
|
|
239
247
|
- `RAG_REBUILD` must stay `false` to reuse prebuilt cache files.
|
|
240
|
-
-
|
|
241
|
-
-
|
|
248
|
+
- Runtime auto-download is enabled by default (`RAG_PREBUILT_INDEX_AUTO_DOWNLOAD=true`) when provider resolution reaches local embeddings (primary or fallback).
|
|
249
|
+
- Default prebuilt URL patterns:
|
|
250
|
+
- `https://github.com/yushulx/simple-dynamsoft-mcp/releases/download/v<version>/prebuilt-rag-index-local-<version>.tar.gz`
|
|
251
|
+
- `https://github.com/yushulx/simple-dynamsoft-mcp/releases/download/v<version>/prebuilt-rag-index-gemini-<version>.tar.gz`
|
|
252
|
+
- Downloaded prebuilt cache is accepted when package version matches (with provider/model/payload sanity checks).
|
|
253
|
+
- Prebuilt cache is used whenever provider execution resolves to local or gemini embeddings (primary or fallback).
|
|
242
254
|
|
|
243
255
|
## Supported SDKs
|
|
244
256
|
|
|
245
|
-
### Dynamsoft
|
|
257
|
+
### Dynamsoft Capture Vision (DCV)
|
|
258
|
+
|
|
259
|
+
DCV is a superset architecture that aggregates DBR, DLR, DDN, DCP, and DCE into one pluggable pipeline.
|
|
260
|
+
|
|
261
|
+
Use **DBR** when you only need barcode decoding.
|
|
262
|
+
Use **DCV** when your workflow includes VIN, MRZ/passport/ID, driver license parsing, document detection/normalization/auto-capture/cropping, or multi-task capture-vision pipelines.
|
|
263
|
+
|
|
264
|
+
**DCV editions covered in this MCP server:**
|
|
265
|
+
- **Core docs** - architecture and cross-product concepts
|
|
266
|
+
- **Web (JavaScript)**
|
|
267
|
+
- **Server/Desktop** - Python, .NET, Java, C++, Node.js
|
|
268
|
+
- **Mobile** - Android, iOS, Flutter, React Native, .NET MAUI (+ SPM package sample)
|
|
269
|
+
|
|
270
|
+
### Dynamsoft Barcode Reader Mobile (latest)
|
|
246
271
|
|
|
247
272
|
**Platforms:** Android, iOS, Flutter, React Native, .NET MAUI
|
|
248
273
|
|
|
@@ -259,7 +284,7 @@ Notes:
|
|
|
259
284
|
- ScanSingleBarcode, ScanMultipleBarcodes, ScanSingleBarcodeSwiftUI
|
|
260
285
|
- DecodeWithCameraEnhancer, DecodeWithAVCaptureSession, DecodeFromAnImage
|
|
261
286
|
|
|
262
|
-
### Dynamsoft Barcode Reader Server/Desktop (
|
|
287
|
+
### Dynamsoft Barcode Reader Server/Desktop (latest)
|
|
263
288
|
|
|
264
289
|
**Platforms:** Python, .NET, Java, C++, Node.js
|
|
265
290
|
|
|
@@ -267,11 +292,11 @@ Notes:
|
|
|
267
292
|
|
|
268
293
|
**Server/Desktop samples:** Pulled from platform-specific sample repositories in `data/samples/`.
|
|
269
294
|
|
|
270
|
-
### Dynamsoft Barcode Reader Web (
|
|
295
|
+
### Dynamsoft Barcode Reader Web (latest)
|
|
271
296
|
|
|
272
297
|
**Installation:** `npm install dynamsoft-barcode-reader-bundle`
|
|
273
298
|
|
|
274
|
-
**CDN:** `https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader-bundle@
|
|
299
|
+
**CDN:** `https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader-bundle@latest/dist/dbr.bundle.min.js`
|
|
275
300
|
|
|
276
301
|
**Samples:**
|
|
277
302
|
- **hello-world** - Basic barcode scanning from camera
|
|
@@ -279,7 +304,7 @@ Notes:
|
|
|
279
304
|
- **frameworks/** - React, Vue, Angular, Next.js, PWA samples
|
|
280
305
|
- **scenarios/** - Multi-image reading, localize an item, driver license parsing
|
|
281
306
|
|
|
282
|
-
### Dynamic Web TWAIN (
|
|
307
|
+
### Dynamic Web TWAIN (latest)
|
|
283
308
|
|
|
284
309
|
**Installation:** `npm install dwt`
|
|
285
310
|
|
|
@@ -292,7 +317,7 @@ Notes:
|
|
|
292
317
|
- **classification** - Document classification and tagging
|
|
293
318
|
- **UI-customization** - Customize viewer and scan UI
|
|
294
319
|
|
|
295
|
-
### Dynamsoft Document Viewer (
|
|
320
|
+
### Dynamsoft Document Viewer (latest)
|
|
296
321
|
|
|
297
322
|
**Installation:** `npm install dynamsoft-document-viewer`
|
|
298
323
|
|
|
@@ -326,6 +351,13 @@ After connecting the MCP server, you can ask your AI assistant:
|
|
|
326
351
|
- "Get the React sample for web barcode scanning"
|
|
327
352
|
- "How do I decode barcodes from an image in JavaScript?"
|
|
328
353
|
|
|
354
|
+
### Capture Vision (DCV)
|
|
355
|
+
- "Find a DCV sample for MRZ scanning in Python"
|
|
356
|
+
- "Get a VIN scanning sample for Java or C++"
|
|
357
|
+
- "Show me DCV document normalization samples for mobile"
|
|
358
|
+
- "I need driver license parsing; should I use DBR or DCV?"
|
|
359
|
+
- "List DCV server samples and generate a project from MRZScanner"
|
|
360
|
+
|
|
329
361
|
### Dynamic Web TWAIN
|
|
330
362
|
- "Create a web page that scans documents from a TWAIN scanner"
|
|
331
363
|
- "Show me how to save scanned documents as PDF"
|
|
@@ -336,6 +368,10 @@ After connecting the MCP server, you can ask your AI assistant:
|
|
|
336
368
|
|
|
337
369
|
## SDK Documentation
|
|
338
370
|
|
|
371
|
+
- **DCV Core**: https://www.dynamsoft.com/capture-vision/docs/core/
|
|
372
|
+
- **DCV Mobile**: https://www.dynamsoft.com/capture-vision/docs/mobile/
|
|
373
|
+
- **DCV Server/Desktop**: https://www.dynamsoft.com/capture-vision/docs/server/
|
|
374
|
+
- **DCV Web**: https://www.dynamsoft.com/capture-vision/docs/web/
|
|
339
375
|
- **Mobile Android**: https://www.dynamsoft.com/barcode-reader/docs/mobile/programming/android/user-guide.html
|
|
340
376
|
- **Mobile iOS**: https://www.dynamsoft.com/barcode-reader/docs/mobile/programming/objectivec-swift/user-guide.html
|
|
341
377
|
- **Python**: https://www.dynamsoft.com/barcode-reader/docs/server/programming/python/user-guide.html
|
|
@@ -360,12 +396,26 @@ data/
|
|
|
360
396
|
| |-- dynamsoft-barcode-reader-java
|
|
361
397
|
| |-- dynamsoft-barcode-reader-c-cpp
|
|
362
398
|
| |-- dynamsoft-capture-vision-nodejs
|
|
399
|
+
| |-- dynamsoft-capture-vision-c-cpp
|
|
400
|
+
| |-- dynamsoft-capture-vision-dotnet
|
|
401
|
+
| |-- dynamsoft-capture-vision-java
|
|
402
|
+
| |-- dynamsoft-capture-vision-python
|
|
403
|
+
| |-- dynamsoft-capture-vision-mobile
|
|
404
|
+
| |-- dynamsoft-capture-vision-javascript
|
|
405
|
+
| |-- dynamsoft-capture-vision-react-native
|
|
406
|
+
| |-- dynamsoft-capture-vision-maui
|
|
407
|
+
| |-- dynamsoft-capture-vision-flutter
|
|
408
|
+
| |-- dynamsoft-capture-vision-spm
|
|
363
409
|
| |-- dynamic-web-twain
|
|
364
410
|
| `-- dynamsoft-document-viewer
|
|
365
411
|
|-- documentation/ # Git submodules
|
|
366
412
|
| |-- barcode-reader-docs-js
|
|
367
413
|
| |-- barcode-reader-docs-mobile
|
|
368
414
|
| |-- barcode-reader-docs-server
|
|
415
|
+
| |-- capture-vision-docs
|
|
416
|
+
| |-- capture-vision-docs-js
|
|
417
|
+
| |-- capture-vision-docs-server
|
|
418
|
+
| |-- capture-vision-docs-mobile
|
|
369
419
|
| |-- web-twain-docs
|
|
370
420
|
| `-- document-viewer-docs
|
|
371
421
|
`-- .rag-cache/
|
|
@@ -392,6 +442,7 @@ src/
|
|
|
392
442
|
`-- builders.js
|
|
393
443
|
scripts/
|
|
394
444
|
|-- sync-submodules.mjs # CLI wrapper for data:sync
|
|
445
|
+
|-- update-sdk-versions.mjs # Sync SDK versions from docs structures
|
|
395
446
|
|-- update-data-lock.mjs # Generate data-manifest from submodule HEADs
|
|
396
447
|
|-- verify-data-lock.mjs # Verify manifest matches submodule HEADs
|
|
397
448
|
`-- prebuild-rag-index.mjs # Build local RAG index cache artifacts
|
|
@@ -419,6 +470,10 @@ test/
|
|
|
419
470
|
- `npm run data:lock`
|
|
420
471
|
- Verify lock manifest matches submodule HEADs:
|
|
421
472
|
- `npm run data:verify-lock`
|
|
473
|
+
- Sync SDK versions from docs sources:
|
|
474
|
+
- `npm run data:versions`
|
|
475
|
+
- Strict source-structure verification (fail on unresolved sources):
|
|
476
|
+
- `npm run data:verify-versions:strict`
|
|
422
477
|
|
|
423
478
|
Optional startup sync:
|
|
424
479
|
- `DATA_SYNC_ON_START=true`
|
|
@@ -445,29 +500,36 @@ At startup, the server logs data mode/path to stderr:
|
|
|
445
500
|
- CI jobs:
|
|
446
501
|
- `test_fuse` on `ubuntu-latest` runs `npm run test:fuse` (stdio + HTTP gateway + package-runtime with fuse provider)
|
|
447
502
|
- `test_local_provider` on `ubuntu-latest` restores RAG caches, runs `npm run rag:prebuild`, then `npm run test:local`
|
|
503
|
+
- `test_gemini_provider` on `ubuntu-latest` (when `GEMINI_API_KEY` secret exists) prebuilds gemini RAG cache, then runs `npm run test:gemini`
|
|
448
504
|
- Daily data-lock refresh workflow: `.github/workflows/update-data-lock.yml`
|
|
449
505
|
- Refresh schedule: daily at 08:00 UTC (`0 8 * * *`) and manual trigger supported.
|
|
506
|
+
- Refresh workflow runs strict source checks (`data:versions:strict`, `data:verify-versions:strict`) to fail fast when external docs/sample structures drift.
|
|
507
|
+
- Refresh workflow creates/updates PR `chore/daily-data-refresh` and enables auto-merge when checks pass (requires repo settings support).
|
|
450
508
|
- Release workflow: `.github/workflows/release.yml`
|
|
451
509
|
- Release behavior:
|
|
452
510
|
- Creates GitHub release when `package.json` version changes on `main`
|
|
453
|
-
- Attaches `npm pack` artifact
|
|
511
|
+
- Attaches `npm pack` artifact plus separate prebuilt RAG index archives for local and gemini providers (release workflow requires `GEMINI_API_KEY` for gemini prebuild path)
|
|
454
512
|
- Publishes the package to npm from the release workflow (OIDC trusted publishing)
|
|
455
513
|
|
|
456
514
|
## Testing
|
|
457
515
|
|
|
458
516
|
- `npm test`: default test entry (currently `npm run test:fuse`)
|
|
517
|
+
- `npm run test:unit`: unit tests (retry/backoff/config helpers)
|
|
459
518
|
- `npm run test:fuse`: integration coverage for fuse provider
|
|
460
519
|
- `npm run test:local`: integration coverage for local provider
|
|
520
|
+
- `npm run test:gemini`: integration coverage for gemini provider (requires `GEMINI_API_KEY`)
|
|
461
521
|
- `npm run test:stdio`: stdio transport integration tests
|
|
462
522
|
- `npm run test:http`: streamable HTTP (supergateway) integration tests
|
|
463
523
|
- `npm run test:package`: `npm pack` + `npm exec --package` runtime test
|
|
464
524
|
- Optional env toggles:
|
|
465
525
|
- `RUN_FUSE_PROVIDER_TESTS=true|false`
|
|
466
526
|
- `RUN_LOCAL_PROVIDER_TESTS=true|false`
|
|
527
|
+
- `RUN_GEMINI_PROVIDER_TESTS=true|false`
|
|
467
528
|
|
|
468
529
|
## Using Search-Based Discovery (Recommended)
|
|
469
530
|
|
|
470
531
|
- On session start, let your client call `tools/list` and `resources/list` (pinned only, not exhaustive).
|
|
532
|
+
- Read pinned `doc://product-selection` first to choose DBR vs DCV correctly for the scenario.
|
|
471
533
|
- For any query, call `search`; it uses semantic RAG retrieval (with fuzzy fallback) and returns `resource_link` entries.
|
|
472
534
|
- Read only the links you need via `resources/read` to avoid bloating the context window.
|
|
473
535
|
- If unsure what to search, call `get_index` first to see what is available.
|
|
@@ -483,20 +545,36 @@ Key env vars:
|
|
|
483
545
|
- `RAG_FALLBACK`: `fuse` | `local` | `none`
|
|
484
546
|
- `GEMINI_API_KEY`: required for remote embeddings
|
|
485
547
|
- `GEMINI_EMBED_MODEL`: e.g. `models/embedding-001` or `models/gemini-embedding-001`
|
|
548
|
+
- `GEMINI_RETRY_MAX_ATTEMPTS`: max retry attempts for retryable errors (default `5`)
|
|
549
|
+
- `GEMINI_RETRY_BASE_DELAY_MS`: exponential backoff base delay (default `500`)
|
|
550
|
+
- `GEMINI_RETRY_MAX_DELAY_MS`: exponential backoff max delay cap (default `10000`)
|
|
551
|
+
- `GEMINI_REQUEST_THROTTLE_MS`: fixed delay between Gemini requests (default `0`)
|
|
486
552
|
- `RAG_LOCAL_MODEL`: default `Xenova/all-MiniLM-L6-v2`
|
|
487
553
|
- `RAG_CACHE_DIR`: default `data/.rag-cache`
|
|
554
|
+
- `RAG_PREBUILT_INDEX_AUTO_DOWNLOAD`: default `true`
|
|
555
|
+
- `RAG_PREBUILT_INDEX_URL`: global override for release prebuilt index asset URL
|
|
556
|
+
- `RAG_PREBUILT_INDEX_URL_LOCAL`: override for local prebuilt index asset URL
|
|
557
|
+
- `RAG_PREBUILT_INDEX_URL_GEMINI`: override for gemini prebuilt index asset URL
|
|
558
|
+
- `RAG_PREBUILT_INDEX_TIMEOUT_MS`: default `180000`
|
|
488
559
|
|
|
489
560
|
Local embeddings download the model on first run and cache under `data/.rag-cache/models`.
|
|
490
561
|
Advanced tuning:
|
|
491
562
|
- `RAG_CHUNK_SIZE`, `RAG_CHUNK_OVERLAP`, `RAG_MAX_CHUNKS_PER_DOC`, `RAG_MAX_TEXT_CHARS`
|
|
492
563
|
- `RAG_MIN_SCORE`, `RAG_INCLUDE_SCORE`, `RAG_REBUILD`, `RAG_PREWARM`, `RAG_PREWARM_BLOCK`, `RAG_LOCAL_QUANTIZED`, `GEMINI_EMBED_BATCH_SIZE`, `RAG_MODEL_CACHE_DIR`
|
|
493
564
|
|
|
565
|
+
Gemini hardening behavior:
|
|
566
|
+
- Retryable responses (`429`, `503`, transient `5xx`) use exponential backoff with jitter.
|
|
567
|
+
- Optional throttling can pace request bursts with `GEMINI_REQUEST_THROTTLE_MS`.
|
|
568
|
+
- Batch embedding adaptively downgrades batch size on repeated rate-limit responses.
|
|
569
|
+
- Index build progress is checkpointed to disk and resumes from checkpoints after failures.
|
|
570
|
+
|
|
494
571
|
For local dev, you can also use a `.env` file (see `.env.example`).
|
|
495
572
|
|
|
496
573
|
## Version Policy
|
|
497
574
|
|
|
498
|
-
- This MCP server serves only the latest major version for each product (DBR, DWT, DDV).
|
|
575
|
+
- This MCP server serves only the latest major version for each product (DCV, DBR, DWT, DDV).
|
|
499
576
|
- DBR legacy docs are linked for v9 and v10. Requests below v9 are refused.
|
|
577
|
+
- DCV has no legacy archive links in this server.
|
|
500
578
|
- DWT archived docs are available for v16.1.1+ (specific versions are hardcoded).
|
|
501
579
|
- DDV has no legacy archive links in this server.
|
|
502
580
|
|
|
@@ -513,7 +591,8 @@ Update the corresponding submodule under `data/samples/`.
|
|
|
513
591
|
|
|
514
592
|
### Update SDK Info
|
|
515
593
|
|
|
516
|
-
|
|
594
|
+
Use `npm run data:versions` (or `npm run data:versions:strict`) to refresh SDK versions from docs sources.
|
|
595
|
+
Edit `data/metadata/dynamsoft_sdks.json` manually only for non-version metadata updates (for example docs URLs, installation commands, or platform definitions).
|
|
517
596
|
|
|
518
597
|
## License
|
|
519
598
|
|
|
@@ -31,6 +31,46 @@
|
|
|
31
31
|
"commit": "6c5404429140195bd8f18f48fbc3f2d3f2524e74",
|
|
32
32
|
"archiveUrl": "https://codeload.github.com/dynamsoft-docs/barcode-reader-docs-server/zip/6c5404429140195bd8f18f48fbc3f2d3f2524e74"
|
|
33
33
|
},
|
|
34
|
+
{
|
|
35
|
+
"name": "data/documentation/capture-vision-docs",
|
|
36
|
+
"path": "documentation/capture-vision-docs",
|
|
37
|
+
"url": "https://github.com/dynamsoft-docs/capture-vision-docs.git",
|
|
38
|
+
"branch": "main",
|
|
39
|
+
"owner": "dynamsoft-docs",
|
|
40
|
+
"repo": "capture-vision-docs",
|
|
41
|
+
"commit": "8c49a13548f2beb0152dd3497993edb80ed7f53a",
|
|
42
|
+
"archiveUrl": "https://codeload.github.com/dynamsoft-docs/capture-vision-docs/zip/8c49a13548f2beb0152dd3497993edb80ed7f53a"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"name": "data/documentation/capture-vision-docs-js",
|
|
46
|
+
"path": "documentation/capture-vision-docs-js",
|
|
47
|
+
"url": "https://github.com/dynamsoft-docs/capture-vision-docs-js.git",
|
|
48
|
+
"branch": "main",
|
|
49
|
+
"owner": "dynamsoft-docs",
|
|
50
|
+
"repo": "capture-vision-docs-js",
|
|
51
|
+
"commit": "3137b83d966e795190a9681e544045a5e526c083",
|
|
52
|
+
"archiveUrl": "https://codeload.github.com/dynamsoft-docs/capture-vision-docs-js/zip/3137b83d966e795190a9681e544045a5e526c083"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"name": "data/documentation/capture-vision-docs-mobile",
|
|
56
|
+
"path": "documentation/capture-vision-docs-mobile",
|
|
57
|
+
"url": "https://github.com/dynamsoft-docs/capture-vision-docs-mobile.git",
|
|
58
|
+
"branch": "main",
|
|
59
|
+
"owner": "dynamsoft-docs",
|
|
60
|
+
"repo": "capture-vision-docs-mobile",
|
|
61
|
+
"commit": "618991bac7908e65aeb4669bcd2dd0f57c84bca3",
|
|
62
|
+
"archiveUrl": "https://codeload.github.com/dynamsoft-docs/capture-vision-docs-mobile/zip/618991bac7908e65aeb4669bcd2dd0f57c84bca3"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"name": "data/documentation/capture-vision-docs-server",
|
|
66
|
+
"path": "documentation/capture-vision-docs-server",
|
|
67
|
+
"url": "https://github.com/dynamsoft-docs/capture-vision-docs-server.git",
|
|
68
|
+
"branch": "main",
|
|
69
|
+
"owner": "dynamsoft-docs",
|
|
70
|
+
"repo": "capture-vision-docs-server",
|
|
71
|
+
"commit": "4c37a5f6c816a1e90aee4cb03267529c7d7b307e",
|
|
72
|
+
"archiveUrl": "https://codeload.github.com/dynamsoft-docs/capture-vision-docs-server/zip/4c37a5f6c816a1e90aee4cb03267529c7d7b307e"
|
|
73
|
+
},
|
|
34
74
|
{
|
|
35
75
|
"name": "data/documentation/document-viewer-docs",
|
|
36
76
|
"path": "documentation/document-viewer-docs",
|
|
@@ -151,6 +191,76 @@
|
|
|
151
191
|
"commit": "acb3ac877853f1543ff086fb15df30335b0d4cbe",
|
|
152
192
|
"archiveUrl": "https://codeload.github.com/Dynamsoft/barcode-reader-react-native-samples/zip/acb3ac877853f1543ff086fb15df30335b0d4cbe"
|
|
153
193
|
},
|
|
194
|
+
{
|
|
195
|
+
"name": "data/samples/dynamsoft-capture-vision-c-cpp",
|
|
196
|
+
"path": "samples/dynamsoft-capture-vision-c-cpp",
|
|
197
|
+
"url": "https://github.com/Dynamsoft/capture-vision-cpp-samples.git",
|
|
198
|
+
"branch": "main",
|
|
199
|
+
"owner": "Dynamsoft",
|
|
200
|
+
"repo": "capture-vision-cpp-samples",
|
|
201
|
+
"commit": "6d37fa7f16bc84cbd2b78651549cb900cf222571",
|
|
202
|
+
"archiveUrl": "https://codeload.github.com/Dynamsoft/capture-vision-cpp-samples/zip/6d37fa7f16bc84cbd2b78651549cb900cf222571"
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"name": "data/samples/dynamsoft-capture-vision-dotnet",
|
|
206
|
+
"path": "samples/dynamsoft-capture-vision-dotnet",
|
|
207
|
+
"url": "https://github.com/Dynamsoft/capture-vision-dotnet-samples.git",
|
|
208
|
+
"branch": "main",
|
|
209
|
+
"owner": "Dynamsoft",
|
|
210
|
+
"repo": "capture-vision-dotnet-samples",
|
|
211
|
+
"commit": "1ac2d63ea45d63ee7421725e351936ca5c321ce2",
|
|
212
|
+
"archiveUrl": "https://codeload.github.com/Dynamsoft/capture-vision-dotnet-samples/zip/1ac2d63ea45d63ee7421725e351936ca5c321ce2"
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"name": "data/samples/dynamsoft-capture-vision-flutter",
|
|
216
|
+
"path": "samples/dynamsoft-capture-vision-flutter",
|
|
217
|
+
"url": "https://github.com/Dynamsoft/capture-vision-flutter-samples.git",
|
|
218
|
+
"branch": "main",
|
|
219
|
+
"owner": "Dynamsoft",
|
|
220
|
+
"repo": "capture-vision-flutter-samples",
|
|
221
|
+
"commit": "7e85ffddaaf2a9b75c21538d60f64fbe733f3227",
|
|
222
|
+
"archiveUrl": "https://codeload.github.com/Dynamsoft/capture-vision-flutter-samples/zip/7e85ffddaaf2a9b75c21538d60f64fbe733f3227"
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"name": "data/samples/dynamsoft-capture-vision-java",
|
|
226
|
+
"path": "samples/dynamsoft-capture-vision-java",
|
|
227
|
+
"url": "https://github.com/Dynamsoft/capture-vision-java-samples.git",
|
|
228
|
+
"branch": "main",
|
|
229
|
+
"owner": "Dynamsoft",
|
|
230
|
+
"repo": "capture-vision-java-samples",
|
|
231
|
+
"commit": "974c436210232a8579fc68b98f610c9d46e86979",
|
|
232
|
+
"archiveUrl": "https://codeload.github.com/Dynamsoft/capture-vision-java-samples/zip/974c436210232a8579fc68b98f610c9d46e86979"
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
"name": "data/samples/dynamsoft-capture-vision-javascript",
|
|
236
|
+
"path": "samples/dynamsoft-capture-vision-javascript",
|
|
237
|
+
"url": "https://github.com/Dynamsoft/capture-vision-javascript-samples.git",
|
|
238
|
+
"branch": "main",
|
|
239
|
+
"owner": "Dynamsoft",
|
|
240
|
+
"repo": "capture-vision-javascript-samples",
|
|
241
|
+
"commit": "13f8885356247a7d369fd290f0b81b81e976a144",
|
|
242
|
+
"archiveUrl": "https://codeload.github.com/Dynamsoft/capture-vision-javascript-samples/zip/13f8885356247a7d369fd290f0b81b81e976a144"
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
"name": "data/samples/dynamsoft-capture-vision-maui",
|
|
246
|
+
"path": "samples/dynamsoft-capture-vision-maui",
|
|
247
|
+
"url": "https://github.com/Dynamsoft/capture-vision-maui-samples.git",
|
|
248
|
+
"branch": "main",
|
|
249
|
+
"owner": "Dynamsoft",
|
|
250
|
+
"repo": "capture-vision-maui-samples",
|
|
251
|
+
"commit": "5b715da9f65569171d830a12c0ba0a68c536176c",
|
|
252
|
+
"archiveUrl": "https://codeload.github.com/Dynamsoft/capture-vision-maui-samples/zip/5b715da9f65569171d830a12c0ba0a68c536176c"
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"name": "data/samples/dynamsoft-capture-vision-mobile",
|
|
256
|
+
"path": "samples/dynamsoft-capture-vision-mobile",
|
|
257
|
+
"url": "https://github.com/Dynamsoft/capture-vision-mobile-samples.git",
|
|
258
|
+
"branch": "main",
|
|
259
|
+
"owner": "Dynamsoft",
|
|
260
|
+
"repo": "capture-vision-mobile-samples",
|
|
261
|
+
"commit": "d1232caf8738560ed11f911add57ad6b84c5531b",
|
|
262
|
+
"archiveUrl": "https://codeload.github.com/Dynamsoft/capture-vision-mobile-samples/zip/d1232caf8738560ed11f911add57ad6b84c5531b"
|
|
263
|
+
},
|
|
154
264
|
{
|
|
155
265
|
"name": "data/samples/dynamsoft-capture-vision-nodejs",
|
|
156
266
|
"path": "samples/dynamsoft-capture-vision-nodejs",
|
|
@@ -161,6 +271,36 @@
|
|
|
161
271
|
"commit": "380fe5f0bc10c8776958353cd349beaec6962fcb",
|
|
162
272
|
"archiveUrl": "https://codeload.github.com/Dynamsoft/capture-vision-nodejs-samples/zip/380fe5f0bc10c8776958353cd349beaec6962fcb"
|
|
163
273
|
},
|
|
274
|
+
{
|
|
275
|
+
"name": "data/samples/dynamsoft-capture-vision-python",
|
|
276
|
+
"path": "samples/dynamsoft-capture-vision-python",
|
|
277
|
+
"url": "https://github.com/Dynamsoft/capture-vision-python-samples.git",
|
|
278
|
+
"branch": "main",
|
|
279
|
+
"owner": "Dynamsoft",
|
|
280
|
+
"repo": "capture-vision-python-samples",
|
|
281
|
+
"commit": "8fdf4c63d5e35bdcc4993a068ba4bcade30e91a2",
|
|
282
|
+
"archiveUrl": "https://codeload.github.com/Dynamsoft/capture-vision-python-samples/zip/8fdf4c63d5e35bdcc4993a068ba4bcade30e91a2"
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"name": "data/samples/dynamsoft-capture-vision-react-native",
|
|
286
|
+
"path": "samples/dynamsoft-capture-vision-react-native",
|
|
287
|
+
"url": "https://github.com/Dynamsoft/capture-vision-react-native-samples.git",
|
|
288
|
+
"branch": "main",
|
|
289
|
+
"owner": "Dynamsoft",
|
|
290
|
+
"repo": "capture-vision-react-native-samples",
|
|
291
|
+
"commit": "c00158c5f3be2716a391d2f6f1412f9c8a2ac52f",
|
|
292
|
+
"archiveUrl": "https://codeload.github.com/Dynamsoft/capture-vision-react-native-samples/zip/c00158c5f3be2716a391d2f6f1412f9c8a2ac52f"
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"name": "data/samples/dynamsoft-capture-vision-spm",
|
|
296
|
+
"path": "samples/dynamsoft-capture-vision-spm",
|
|
297
|
+
"url": "https://github.com/Dynamsoft/capture-vision-spm.git",
|
|
298
|
+
"branch": "main",
|
|
299
|
+
"owner": "Dynamsoft",
|
|
300
|
+
"repo": "capture-vision-spm",
|
|
301
|
+
"commit": "40b45edde33020d23e18a90e5ddc306ef7390ab7",
|
|
302
|
+
"archiveUrl": "https://codeload.github.com/Dynamsoft/capture-vision-spm/zip/40b45edde33020d23e18a90e5ddc306ef7390ab7"
|
|
303
|
+
},
|
|
164
304
|
{
|
|
165
305
|
"name": "data/samples/dynamsoft-document-viewer",
|
|
166
306
|
"path": "samples/dynamsoft-document-viewer",
|