qrcode-mcp

v0.1.1
io.github.xiaobinger/qrcode-mcp Checked 1 day ago Published 10 days ago

Decode, 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.

ParameterTypeDescription
directorystring | nullDirectory to scan (non-recursive)
include_ocrbooleanAlso run OCR on each image
max_filesintegerHard cap on files processed
max_variantsintegerPreprocessing variants per file
ocr_backendstring
patternstringGlob pattern inside directory
repairbooleanAllow damaged-code repair per file
sourcesarray | nullList 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.

ParameterTypeDescription
text *stringDecoded 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.

ParameterTypeDescription
image *stringLocal path, base64, data URI or http(s) URL
budget_msinteger | nullTime budget in milliseconds
formatsarray | nullSymbologies to try, e.g. ["QRCode","DataMatrix"]
include_parsebooleanAttach semantic/risk analysis to each result
max_variantsintegerMax preprocessing variants
repairbooleanTry 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.

ParameterTypeDescription
image *stringLocal path, base64, data URI or http(s) URL
max_variantsintegerHow 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.

ParameterTypeDescription
text *stringContent to encode
borderintegerQuiet-zone width in modules
darkstring | nullDark module color (#RRGGBB or a CSS name)
errorstringError correction level
formatstringOutput format
include_base64booleanInclude a PNG data URI in the result
lightstring | nullLight module color; null means transparent
maskinteger | nullForce mask pattern 0-7, or auto
outputstring | nullFile name inside QRMCP_OUTPUT_DIR (relative only)
savebooleanWrite the file to disk
scaleintegerPixels per module
versioninteger | nullForce 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.

ParameterTypeDescription
image *stringLocal path, base64, data URI or http(s) URL
backendstringOCR engine
detailbooleanInclude line/word boxes; false returns text only
languagestring | nullWindows BCP-47 tag (zh-Hans-CN) or Tesseract lang (chi_sim+eng)
priorityarray | nullOverride auto backend order
upscalebooleanEnlarge 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.

ParameterTypeDescription
allow_privatebooleanAllow hosts resolving to private/loopback IPs
allowlistarray | nullOverride QRMCP_URL_ALLOWLIST for this call
confirmbooleanMust be true to actually launch the browser
dry_runbooleanValidate only, never open even if confirm=true
imagestring | nullDecode this image and open its first URL instead
new_tabbooleanOpen in a new tab when supported
urlstring | nullURL 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.

ParameterTypeDescription
image *stringLocal path, base64, data URI or http(s) URL
ecstring | nullForce error-correction level
hintstring | nullSuspected complete payload; verified by regenerating the QR
maskinteger | nullForce mask 0-7
max_attemptsintegerCap on Reed-Solomon attempts
save_cleanbooleanWrite the rebuilt QR PNG to the output directory
versioninteger | nullForce QR version 1-4, or auto-detect