QR Code Scanner MCP Server

Give your AI assistant dedicated QR image decoding. It invokes a local scanner tool and retrieves the exact URL or text.

QR Code Scanner MCP Server: quick summary

  • Open-source licence

    MIT

  • Tool exposed to your assistant

    scan_image

  • Local stdio transport over standard input and output

    stdio

  • Runtime

    Node.js 22.19+ or 24+

Register the server and decode your first QR code image

MCP (Model Context Protocol) is an open protocol enabling AI assistants to call local or remote tools. QR Code Scanner MCP Server ships as 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 locally and communicates over stdio (standard input and output). It registers scan_image for image bytes plus an optional scan_file tool, disabled by default, for reading local files by path. Your assistant gets direct decoder output rather than guessing visually.

Register the server in your MCP host

Place this snippet inside your host’s MCP config file. npx fetches the npm package on the first launch and caches it locally afterwards. Requires Node.js 22.19+ on the 22 branch, or Node.js 24+.

JSON
{
  "mcpServers": {
    "qrscan": {
      "command": "npx",
      "args": ["--yes", "--ignore-scripts", "@qrcode-ai-com/qrcode-barcode-scanner-mcp"]
    }
  }
}

Most desktop and IDE hosts adopt the mcpServers JSON schema. Put this block into your client’s active config path and confirm scan_image appears in its tool list. Cursor and similar clients accept it as shown; on Windows, certain hosts require invoking npx via cmd.

Refer to the MCP architecture overview to see how host, client and server roles fit together.

Check the QR Code Scanner Integrations directory for step-by-step setups covering Cursor, OpenClaw, Goose, Continue, GitHub Copilot, Junie and Factory Droid.

The same MCP server decodes barcodes as well: see the Barcode Scanner MCP Server guide.

Keep a pinned local install

If you want an audited local copy that never reaches out to npm at startup, install the package inside a project folder and configure absolute paths in your host.

npm install --prefix ./.qrscan-mcp --ignore-scripts @qrcode-ai-com/qrcode-barcode-scanner-mcp

Do not move the install directory afterwards, because your host points directly to its absolute path.

Enable file-path scanning (optional)

Out of the box, the server accepts image bytes only and rejects file paths or URLs. To let it read local images by path, opt into the second tool, scan_file, by setting the QRSCAN_MCP_ALLOWED_DIRECTORIES environment variable to the specific directories it may access.

JSON
{
  "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 “Keep a pinned local install” by adding an env block. Separate multiple folders just like PATH: colons on macOS and Linux, semicolons on Windows.

scan_file expects the absolute path to one image inside an allowed folder and outputs the identical report format as scan_image, accepting the same optional profile and budgetMs fields explained below.

Prompt your assistant to decode an image

Your assistant constructs the scan_image call automatically, so you do not need to write JSON manually. For instance, ask: “Decode the QR code in qr-reference.png and give me the exact URL.” Assistants that pass file paths instead of image bytes need scan_file enabled as shown above.

The tool accepts imageBase64 (canonical base64 of the image bytes without whitespace or a data-URL prefix), an optional profile (fast by default, or frame / full) and an optional budgetMs time budget in milliseconds (0 removes the time limit).

JSON
{ "imageBase64": "<canonical base64 image>", "profile": "full", "budgetMs": 0 }

Consult the MCP reference for the complete tool schema, input caps and error codes.

Expected output

The snippet above targets your own file. As a concrete baseline, here is the first detection returned for the public clean QR sample image:

JSON
{
  "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 JSON report is delivered inside structuredContent on the MCP tool response.

This sample matches the scanner’s published sample report.

Supported MCP hosts and package channels

The config blocks above cover generic setups. Below are compatible MCP hosts and public registries distributing the same local stdio server.

Cursor and editor agents

Hook the MCP server into Cursor, GitHub Copilot, JetBrains Junie or Continue through each editor’s MCP settings and local tool permissions.

OpenClaw, Goose and Factory Droid

Bring local QR decoding to OpenClaw, Goose, Factory Droid, Pi agent and other stdio MCP agents via the shared plugin repo or the mcpServers config above.

Official MCP Registry

Review the Official MCP Registry record io.github.qrcode-ai-com/qrcode-barcode-scanner for machine-readable metadata linking to the npm package.

Glama MCP directory

Check the published Glama listing for tool definitions, MIT licence metadata and quick links to the local stdio server.

npm package and GitHub archive

Fetch @qrcode-ai-com/qrcode-barcode-scanner-mcp from npm or grab the matching GitHub release archive when your team pins local dependencies.

Desktop bundle (.mcpb)

Download the .mcpb desktop bundle from GitHub Releases for desktop MCP apps that support direct extension bundle installation.

Step-by-step setup for QR Code Scanner MCP Server

Add the stdio server to your MCP host, invoke scan_image with an image payload and inspect the structured report.

  1. Step 1

    Register the server

    Insert the npx mcpServers block into your host and verify it discovers scan_image alongside the read-only resources qrscan://scan-report-schema and qrscan://limits.

  2. Step 2

    Pass image bytes and profile

    Send base64 image data to scan_image (or turn on scan_file for specific directories). Choose fast (default), full (deepest score) or frame (no scoring).

  3. Step 3

    Verify output before acting

    Check detections and isError separately, then review the returned URL or text strictly as data before performing any next action.

What a decoded QR code outputs

scan_image puts the full scan report inside structuredContent with content.text and payload.kind, never opening decoded URLs.

A saved QR code image passes through the MCP server workflow to return the decoded value https://qrcode-ai.com/.

Extract https://qrcode-ai.com/ from qr-reference.png

On qr-reference.png, scan_image returns https://qrcode-ai.com/. Always verify the domain before visiting any decoded link.

Runtime requirements, input limits and report fields

Runtime and exposed tools. Runs over stdio on Node.js 22.19+ (or 24+) across macOS, Linux and Windows x64. Registers scan_image plus schema and limits resources; scan_file stays off unless QRSCAN_MCP_ALLOWED_DIRECTORIES specifies allowed folders.

Caps and error semantics. structuredContent carries the unmodified scan report; an empty detections array is valid whereas isError marks tool errors. Input files cap at 8 MiB, 4,096 px per side and 16 MP; check trace.budget_exhausted (set budgetMs: 0 for no cap) and never read a null score as zero.

Host setups and open-source licence. Browse agent integration guides for editor configs, read the MCP reference for the exact protocol contract and visit the scanner repository for MIT source code.

CLI, Docker, MCP server, skill or SDK: choosing the right QR code scanner

Use the MCP server when an AI assistant needs direct tool calls. For other workflows, pick the right guide below.

QR Code Scanner

Scan a single code immediately in your browser with zero installation.

Open the QR code reader

QR Code Scanner CLI

Decode images inside a terminal script or CI job using one binary.

Explore QR Code Scanner CLI

QR Code Scanner Docker

Keep an identical scanner environment across developer laptops and CI runners.

Explore QR Code Scanner Docker

QR Code Scanner Skills

Supply an AI agent with a consistent step-by-step image scanning workflow.

Explore QR Code Scanner Skills

QR Code Scanner SDK

Embed local scanning directly inside your app in your chosen language.

Explore the scanner SDK

QR Code Scanner MCP Server: common questions

Compatible hosts, image inputs, empty scans, setup and licensing.

A QR code scanner MCP server is a local utility that gives an AI assistant a structured tool to decode QR images via Model Context Protocol (MCP). With QR Code AI’s open-source server, your assistant sends image bytes to scan_image and gets back the exact decoded text directly from the scanner engine rather than guessing visually.

Any MCP client capable of running a local stdio server works, including Cursor, OpenClaw, Goose, Continue, GitHub Copilot, JetBrains Junie and Factory Droid. Clients supporting mcpServers JSON can paste the block under “Register the server in your MCP host”. Check the QR Code Scanner Integrations directory for client-specific steps, then verify scan_image appears.

A local file path works only if you enable the optional scan_file tool; remote image URLs are never fetched. By default, scan_image accepts imageBase64 (canonical base64 of the file bytes without any data-URL prefix), so your host reads the image under its own permissions and sends the bytes. To enable scan_file for absolute file paths, configure QRSCAN_MCP_ALLOWED_DIRECTORIES with the folders the server is permitted to read. Neither tool makes outbound HTTP requests.

No. Returning an empty detections array is a valid completed scan and is distinct from a tool error signalled by isError: true. If trace.budget_exhausted is true, treat an empty list as an incomplete scan rather than proof that no QR code exists.

No. The MCP server only returns decoded strings as structured data and never visits destination URLs. Keep decoded links or prompt-like strings separate from system instructions, and leave opening links or invoking further tools entirely to your host workflow.

Launch it via npx inside your host’s MCP configuration using command npx and arguments --yes --ignore-scripts @qrcode-ai-com/qrcode-barcode-scanner-mcp. For a pinned local install instead, run npm install --prefix ./.qrscan-mcp --ignore-scripts @qrcode-ai-com/qrcode-barcode-scanner-mcp. Because it communicates locally over stdio, there is no remote URL. Its Official MCP Registry ID is io.github.qrcode-ai-com/qrcode-barcode-scanner.

It returns the exact encoded string: a URL, plain text or structured payload. scan_image places the full report in structuredContent so your assistant can quote it verbatim. For example, a plain-text QR holding Meeting point: North entrance returns those exact words, while a QR pointing to a PDF or app download returns the URL rather than the file.

No. Decoding a QR code only shows that readable data exists in the image. It never verifies that the target domain is trustworthy, establishes who placed the code or authorises visiting the link. The QR quality score is a software scannability metric, not a guarantee across every camera or print surface.

No. Decoding an existing QR image is completely independent of the QR Code AI creation service and its generation API. The creation service has free creation limits, a seven-day Premium trial triggered when you create your first dynamic QR code or Smart Link, and Premium requirements for ongoing use of affected features. Reading a code never activates that trial or alters its payload. Both the MCP server and scanner engine are open source under the MIT licence.