MCP (Model Context Protocol) lets an AI assistant discover and invoke external tools cleanly. QR Code Scanner MCP Server is QR Code AI’s MIT-licensed npm package @qrcode-ai-com/qrcode-barcode-scanner-mcp. Your host app (such as Cursor, OpenClaw, Goose or Continue) launches it locally over stdio (standard input and output). It exposes scan_image for base64 image bytes and an optional scan_file tool (disabled by default) for reading local files by path, giving your assistant exact decoder output instead of a visual guess.
Register the server in your MCP host
Add this block to your host’s MCP settings. npx fetches the published package on first launch and reuses it on subsequent runs. Requires Node.js 22.19+ on the 22 release line, or Node.js 24+.
12345678
{
"mcpServers": {
"qrscan": {
"command": "npx",
"args": ["--yes", "--ignore-scripts", "@qrcode-ai-com/qrcode-barcode-scanner-mcp"]
}
}
}
Most desktop and editor clients accept the mcpServers JSON shape. Place it in your host’s config file and verify that scan_image appears. On Windows, some hosts need to launch npx via cmd.
See the MCP architecture documentation for how host, client and server roles fit together.
Check the QR Code Scanner Integrations directory for client-specific setups across Cursor, OpenClaw, Goose, Continue, GitHub Copilot, Junie and Factory Droid.
The same server also decodes barcodes: check the Barcode Scanner MCP Server guide.
Install a pinned local copy
To run an audited local copy that never touches npm at startup, install the package inside your workspace and point your host config at its absolute paths.
1
npm install --prefix ./.qrscan-mcp --ignore-scripts @qrcode-ai-com/qrcode-barcode-scanner-mcp
{
"mcpServers": {
"qrscan": {
"command": "/absolute/path/to/node",
"args": ["/absolute/path/to/.qrscan-mcp/node_modules/@qrcode-ai-com/qrcode-barcode-scanner-mcp/src/cli.mjs"]
}
}
}
Leave the install folder in place because your host config references its absolute path.
Allow reading local files by path
By default the server accepts raw image bytes only, never file paths or URLs. A second optional tool, scan_file, decodes one image by absolute path. It stays disabled until the operator configures QRSCAN_MCP_ALLOWED_DIRECTORIES with the exact directories allowed for reading.
123456789
{
"mcpServers": {
"qrscan": {
"command": "/absolute/path/to/node",
"args": ["/absolute/path/to/.qrscan-mcp/node_modules/@qrcode-ai-com/qrcode-barcode-scanner-mcp/src/cli.mjs"],
"env": { "QRSCAN_MCP_ALLOWED_DIRECTORIES": "/absolute/path/to/images" }
}
}
}
This extends the “Install a pinned local copy” entry with an env block. Separate multiple folders just like PATH: colons on macOS and Linux, semicolons on Windows.
scan_file takes the absolute path to one image inside an allowed folder and outputs the identical report format as scan_image, with the same optional profile and budgetMs arguments.
Prompt your assistant to scan
Your assistant invokes scan_image on your behalf rather than asking you to type JSON. For instance, ask: “Read the QR code in qr-reference.png and give me the exact URL.” Assistants that pass file paths instead of image bytes require scan_file enabled above.
The assistant passes imageBase64 (canonical base64 bytes with no whitespace or data-URL prefix), an optional profile (fast by default, or frame or full) and an optional budgetMs time limit in milliseconds where 0 removes the cap.
1
{ "imageBase64": "<canonical base64 image>", "profile": "full", "budgetMs": 0 }
Read the MCP integration reference for the complete tool schema, file limits and error codes.
Expected output
To compare against your own scan, here is the first detection returned for the public clean QR sample image:
123456789101112
{
"symbology": "qr_code",
"content": {
"text": "https://qrc-ai.com/76xMa",
"raw": "aHR0cHM6Ly9xcmMtYWkuY29tLzc2eE1h",
"charset": "utf8"
},
"payload": {
"kind": "url",
"url": "https://qrc-ai.com/76xMa"
}
}
The complete scan report arrives inside structuredContent on the MCP tool response.
This excerpt matches the scanner’s published QR example report.