qrcode-mcp
v0.1.1Decode, repair and generate QR codes; safely route QR URLs and run pluggable OCR.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
qr_batch
Scan many images in one call. Accepts an explicit list of sources or a directory plus glob pattern; optionally runs OCR on every image too. Returns per-file results and aggregate counts.
| Parameter | Type | Description |
|---|---|---|
directory | string | null | Directory to scan (non-recursive) |
include_ocr | boolean | Also run OCR on each image |
max_files | integer | Hard cap on files processed |
max_variants | integer | Preprocessing variants per file |
ocr_backend | string | |
pattern | string | Glob pattern inside directory |
repair | boolean | Allow damaged-code repair per file |
sources | array | null | List of paths / base64 / data URIs |
qr_parse
Interpret a decoded QR payload. Detects URL/WiFi/vCard/phone/email/payment/text, splits URL query parameters, extracts embedded links and flags phishing-style risks.
| Parameter | Type | Description |
|---|---|---|
text * | string | Decoded payload text |
qr_decode
Decode one or more QR/2D codes from an image. Tries zxing-cpp (multiple binarizers), OpenCV, ZBar and preprocessing variants; if all fail it automatically falls back to qr_repair for glare/blur/low-resolution damage. Returns text, symbology, EC level, corner points, confidence and a parsed payload with URL risk flags.
| Parameter | Type | Description |
|---|---|---|
image * | string | Local path, base64, data URI or http(s) URL |
budget_ms | integer | null | Time budget in milliseconds |
formats | array | null | Symbologies to try, e.g. ["QRCode","DataMatrix"] |
include_parse | boolean | Attach semantic/risk analysis to each result |
max_variants | integer | Max preprocessing variants |
repair | boolean | Try damaged-code recovery when normal decoding fails |
qr_detect
Locate QR symbols in an image without decoding. Returns bounding boxes and corner points, useful for cropping before qr_repair. Deduplicates results across engines.
| Parameter | Type | Description |
|---|---|---|
image * | string | Local path, base64, data URI or http(s) URL |
max_variants | integer | How many preprocessing variants to try |
qr_generate
Generate a QR code. Supports error-correction level, fixed version/mask, scale, quiet zone, colors and PNG/SVG/ASCII output. Optionally saves to the sandbox output directory.
| Parameter | Type | Description |
|---|---|---|
text * | string | Content to encode |
border | integer | Quiet-zone width in modules |
dark | string | null | Dark module color (#RRGGBB or a CSS name) |
error | string | Error correction level |
format | string | Output format |
include_base64 | boolean | Include a PNG data URI in the result |
light | string | null | Light module color; null means transparent |
mask | integer | null | Force mask pattern 0-7, or auto |
output | string | null | File name inside QRMCP_OUTPUT_DIR (relative only) |
save | boolean | Write the file to disk |
scale | integer | Pixels per module |
version | integer | null | Force QR version 1-40, or auto |
server_health
Report server version, supported MCP protocol versions, transports, registered tools, available OCR backends and the active safety configuration.
ocr_image
Recognize text in an image with pluggable OCR backends. backend=auto tries Windows built-in OCR, then RapidOCR, then Tesseract. Returns full text, per-line boxes/confidence and word boxes when available.
| Parameter | Type | Description |
|---|---|---|
image * | string | Local path, base64, data URI or http(s) URL |
backend | string | OCR engine |
detail | boolean | Include line/word boxes; false returns text only |
language | string | null | Windows BCP-47 tag (zh-Hans-CN) or Tesseract lang (chi_sim+eng) |
priority | array | null | Override auto backend order |
upscale | boolean | Enlarge small images 2x before recognition |
qr_open
Validate and optionally open a QR-code URL in the system browser. IMPORTANT: show the URL and its risk flags to the user before calling with confirm=true. Without confirm=true this tool only validates and reports; it never opens anything. Blocks file/javascript/data schemes, private/loopback hosts (SSRF) and hosts outside QRMCP_URL_ALLOWLIST.
| Parameter | Type | Description |
|---|---|---|
allow_private | boolean | Allow hosts resolving to private/loopback IPs |
allowlist | array | null | Override QRMCP_URL_ALLOWLIST for this call |
confirm | boolean | Must be true to actually launch the browser |
dry_run | boolean | Validate only, never open even if confirm=true |
image | string | null | Decode this image and open its first URL instead |
new_tab | boolean | Open in a new tab when supported |
url | string | null | URL to open. Omit when using image=. |
qr_repair
Recover a damaged QR code (glare, blur, low resolution, partial occlusion). Fits the module grid from the finder patterns, decodes format information via BCH, then applies Reed-Solomon erasure/Chase correction. Returns the recovered text, a verification score and a rebuilt clean QR image. Supports QR versions 1-4; larger versions are reported as unsupported. hint= accepts a suspected full text to verify against the damaged modules.
| Parameter | Type | Description |
|---|---|---|
image * | string | Local path, base64, data URI or http(s) URL |
ec | string | null | Force error-correction level |
hint | string | null | Suspected complete payload; verified by regenerating the QR |
mask | integer | null | Force mask 0-7 |
max_attempts | integer | Cap on Reed-Solomon attempts |
save_clean | boolean | Write the rebuilt QR PNG to the output directory |
version | integer | null | Force QR version 1-4, or auto-detect |