MCP server for Dynamsoft SDKs - Barcode Reader (Mobile/Python/Web), Dynamic Web TWAIN, and Document Viewer. Provides documentation, code snippets, and API guidance.
npm install simple-dynamsoft-mcpresources/read.
get_index | Compact index of products, editions, versions, samples, and docs |
search | Unified search across docs and samples; returns resource links |
list_samples | List available sample IDs and URIs for a scope |
resolve_sample | Resolve a sample_id (or sample URI) to matching sample URIs |
resolve_version | Resolve a concrete latest-major version for a product/edition |
get_quickstart | Opinionated quickstart for a target stack |
generate_project | Assemble a project structure from a sample (no AI generation) |
~/.config/opencode/opencode.json
%USERPROFILE%\.config\opencode\opencode.json
json
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"dynamsoft": {
"type": "local",
"command": [
"npx",
"simple-dynamsoft-mcp"
]
}
}
}
`
$3
Location:
- macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
- Windows: %APPDATA%\Claude\claude_desktop_config.json
Configuration:
`json
{
"mcpServers": {
"dynamsoft": {
"command": "npx",
"args": ["-y", "simple-dynamsoft-mcp"]
}
}
}
`
$3
Global Location:
- macOS: ~/Library/Application Support/Code/User/mcp.json
- Windows: %APPDATA%\Code\User\mcp.json
`json
{
"servers": {
"dynamsoft": {
"command": "npx",
"args": ["-y", "simple-dynamsoft-mcp"]
}
}
}
`
Or create workspace-specific .vscode/mcp.json:
`json
{
"servers": {
"dynamsoft": {
"command": "npx",
"args": ["-y", "simple-dynamsoft-mcp"]
}
}
}
`
$3
Location:
- macOS: ~/.cursor/mcp.json
- Windows: %USERPROFILE%\.cursor\mcp.json
Configuration:
`json
{
"mcpServers": {
"dynamsoft": {
"command": "npx",
"args": ["-y", "simple-dynamsoft-mcp"]
}
}
}
`
$3
Location:
- macOS: ~/.codeium/windsurf/mcp_config.json
- Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json
`json
{
"mcpServers": {
"dynamsoft": {
"command": "npx",
"args": ["-y", "simple-dynamsoft-mcp"]
}
}
}
`
$3
If you prefer running from source:
`json
{
"command": "node",
"args": ["/absolute/path/to/simple-dynamsoft-mcp/src/index.js"]
}
`
Supported SDKs
$3
Platforms: Android, iOS, Flutter, React Native, .NET MAUI
API Levels:
- High-Level (BarcodeScanner): Simple ready-to-use barcode scanning UI
- Low-Level (CaptureVisionRouter): Full control over the scanning pipeline
Android Samples:
- ScanSingleBarcode, ScanMultipleBarcodes, ScenarioOrientedSamples
- DecodeWithCameraEnhancer, DecodeWithCameraX, DecodeFromAnImage
- GeneralSettings, DriversLicenseScanner, TinyBarcodeDecoding, ReadGS1AI
iOS Samples:
- ScanSingleBarcode, ScanMultipleBarcodes, ScanSingleBarcodeSwiftUI
- DecodeWithCameraEnhancer, DecodeWithAVCaptureSession, DecodeFromAnImage
$3
Installation: pip install dynamsoft-barcode-reader-bundle
Samples:
- read_an_image - Decode barcodes from image files
- video_decoding - Real-time video decoding
$3
Installation: npm install dynamsoft-barcode-reader-bundle
CDN: https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader-bundle@11.2.4000/dist/dbr.bundle.min.js
Samples:
- hello-world - Basic barcode scanning from camera
- read-an-image - Decode from image files
- frameworks/ - React, Vue, Angular, Next.js, PWA samples
- scenarios/ - Multi-image reading, localize an item, driver license parsing
$3
Installation: npm install dwt
CDN: https://cdn.jsdelivr.net/npm/dwt@latest/dist/dynamsoft.webtwain.min.js
Sample Categories:
- scan - Basic document scanning (basic-scan, read-barcode, etc.)
- input-options - Load from files, URLs, local drive
- output-options - Save, upload, convert to PDF/Base64/Blob
- classification - Document classification and tagging
- UI-customization - Customize viewer and scan UI
$3
Installation: npm install dynamsoft-document-viewer
CDN: https://cdn.jsdelivr.net/npm/dynamsoft-document-viewer@latest/dist/ddv.js
Samples:
- hello-world - Basic viewer setup
- angular, react-vite, vue, next - Framework starter samples
Trial License
https://www.dynamsoft.com/customer/license/trialLicense/?product=dcv&package=cross-platform
Example AI Prompts
After connecting the MCP server, you can ask your AI assistant:
$3
- "Create an Android app that scans a single barcode"
- "Show me how to use CaptureVisionRouter in iOS Swift"
- "Get the Gradle configuration for Dynamsoft Barcode Reader"
- "How do I initialize the Dynamsoft license in Kotlin?"
$3
- "Show me how to read barcodes from an image in Python"
- "Get the Python sample for video decoding"
$3
- "Create a web page that scans barcodes from a camera"
- "Show me the web barcode reader hello world sample"
- "Get the React sample for web barcode scanning"
- "How do I decode barcodes from an image in JavaScript?"
$3
- "Create a web page that scans documents from a TWAIN scanner"
- "Show me how to save scanned documents as PDF"
- "Get the DWT sample for reading barcodes from scanned documents"
- "Search the DWT docs for how to load images from files"
- "Get the DWT documentation about OCR"
- "How do I configure the PDF rasterizer in DWT?"
SDK Documentation
- Mobile Android: https://www.dynamsoft.com/barcode-reader/docs/mobile/programming/android/user-guide.html
- Mobile iOS: https://www.dynamsoft.com/barcode-reader/docs/mobile/programming/objectivec-swift/user-guide.html
- Python: https://www.dynamsoft.com/barcode-reader/docs/server/programming/python/user-guide.html
- Web JavaScript: https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/index.html
- Dynamic Web TWAIN: https://www.dynamsoft.com/web-twain/docs/introduction/index.html
Code Snippet Structure
`
code-snippet/
├── dynamsoft-barcode-reader/
│ ├── android/
│ │ ├── BarcodeScannerAPISamples/ # High-level API
│ │ └── FoundationalAPISamples/ # Low-level API
│ ├── ios/
│ │ ├── BarcodeScannerAPISamples/
│ │ └── FoundationalAPISamples/
│ ├── python/
│ │ └── Samples/
│ └── web/
└── dynamic-web-twain/
├── scan/
├── input-options/
├── output-options/
├── classification/
└── UI-customization/
data/
├── dynamsoft_sdks.json # SDK registry with versions and docs
└── web-twain-api-docs.json # Full DWT API documentation (50+ articles)
`
Using Search-Based Discovery (Recommended)
- On session start, let your client call tools/list and resources/list (pinned only, not exhaustive).
- For any query, call search; it uses semantic RAG retrieval (with fuzzy fallback) and returns resource_link entries.
- Read only the links you need via resources/read to avoid bloating the context window.
- If unsure what to search, call get_index first to see what is available.
RAG Configuration
Search providers are selected at runtime via environment variables (safe for public npm packages). Defaults to auto -> gemini if GEMINI_API_KEY is set, otherwise local, with fuse fallback on failure.
To keep the legacy fuzzy search (no model download), set RAG_PROVIDER=fuse.
Key env vars:
- RAG_PROVIDER: auto | gemini | local | fuse
- RAG_FALLBACK: fuse | local | none
- GEMINI_API_KEY: required for remote embeddings
- GEMINI_EMBED_MODEL: e.g. models/embedding-001 or models/gemini-embedding-001
- RAG_LOCAL_MODEL: default Xenova/all-MiniLM-L6-v2
- RAG_CACHE_DIR: default data/.rag-cache
Local embeddings download the model on first run and cache under data/.rag-cache/models.
Advanced tuning:
- RAG_CHUNK_SIZE, RAG_CHUNK_OVERLAP, RAG_MAX_CHUNKS_PER_DOC, RAG_MAX_TEXT_CHARS
- RAG_MIN_SCORE, RAG_INCLUDE_SCORE, RAG_REBUILD, RAG_PREWARM, RAG_PREWARM_BLOCK, RAG_LOCAL_QUANTIZED, GEMINI_EMBED_BATCH_SIZE, RAG_MODEL_CACHE_DIR
For local dev, you can also use a .env file (see .env.example).
Version Policy
- This MCP server serves only the latest major versions (DBR v11, DWT v19).
- Requests for older major versions are refused. For select legacy versions, the server returns official archived documentation links.
Extending the Server
$3
Place new sample projects in the appropriate folder under code-snippet/.
$3
Edit data/dynamsoft_sdks.json` to update versions, docs URLs, or add new platforms.