MCP (Model Context Protocol) is the open standard that lets an AI assistant call external tools. The QR Code Scanner MCP Server is QR Code AI’s MIT-licensed npm package @qrcode-ai-com/qrcode-barcode-scanner-mcp. Your MCP host (such as Cursor, OpenClaw, Goose or Continue) launches it on your local machine and communicates over stdio, the server’s standard input and output. By default it exposes the scan_image tool, which accepts image bytes, plus an optional scan_file tool, disabled by default, for reading an image file by path. Your assistant receives a real decoder result rather than relying on its own visual guess.
Add the server to your MCP host
Add this entry to your host’s MCP configuration. On first launch, npx fetches the published server package and reuses that cached copy afterwards. Requires Node.js 22.19 or later on the 22 release line, or Node.js 24 or later.
12345678
{
"mcpServers": {
"qrscan": {
"command": "npx",
"args": ["--yes", "--ignore-scripts", "@qrcode-ai-com/qrcode-barcode-scanner-mcp"]
}
}
}
The mcpServers structure is a widely used client convention. Place this entry in your host’s configuration file, then verify that scan_image appears in its tool list. Cursor and other hosts that read an mcpServers JSON file accept this entry as shown. On Windows, some hosts need to launch npx via cmd.
The MCP architecture overview explains the host, client and server roles.
Browse the QR Code Scanner Integrations directory for client-specific setup guides covering Cursor, OpenClaw, Goose, Continue, GitHub Copilot, JetBrains Junie and Factory Droid.
The same local server also decodes barcodes: see the Barcode Scanner MCP Server guide.
Install a local copy
If you prefer a pinned, audited copy that never queries npm at start-up, install the server in your project and point your host to 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 installation folder where it is, as the host stores its absolute path.
Allow the server to read files by path
By default, the server accepts raw image bytes only: no file path and no URL. A second optional tool, scan_file, reads a single image file from its absolute path. It stays disabled by default and only becomes available when the person configuring the server sets the QRSCAN_MCP_ALLOWED_DIRECTORIES environment variable to the permitted folders.
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 builds on the “Install a local copy” entry with one extra env line. Separate multiple folders in the same way as PATH: a colon on macOS and Linux, or a semicolon on Windows.
scan_file accepts the absolute path of one image inside an allowed folder and returns the same structured report as scan_image, with the same two optional arguments, profile and budgetMs, covered below.
Ask your assistant to scan
Your assistant invokes scan_image on your behalf, so you do not have to write its arguments manually. For example, ask: “Read the QR code in qr-reference.png and give me the exact URL.” An assistant that works from file paths rather than raw image bytes requires the optional scan_file tool shown above.
The assistant passes imageBase64 (canonical base64 of the image 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 }
The MCP server reference documents the full tool contract, input limits and error codes.
What you get
The prompt above decodes your own image. For a reproducible reference, 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 report is returned in structuredContent, the machine-readable part of the tool response.
This excerpt is taken from the scanner’s published example report.