QR Code Scanner MCP Server

Give your AI assistant deterministic QR code reading via a local MCP tool that returns the exact encoded URL or text.

QR Code Scanner MCP Server at a glance

  • Open-source licence

    MIT

  • Tool your assistant calls

    scan_image

  • Local transport over stdio

    stdio

  • Runtime

    Node.js 22.19+ or 24+

Add the server and decode your first QR code image

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+.

JSON
{
  "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.

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

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.

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

JSON
{ "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:

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 scan report arrives inside structuredContent on the MCP tool response.

This excerpt matches the scanner’s published QR example report.

MCP hosts and distribution channels

The snippets above show generic config. Below are supported MCP hosts and published registries indexing the exact same local stdio server.

Cursor and editor agents

Wire the MCP server into Cursor, GitHub Copilot, JetBrains Junie or Continue using each IDE’s MCP settings and local tool permissions.

OpenClaw, Goose and Factory Droid

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

Official MCP Registry

Inspect the Official MCP Registry record io.github.qrcode-ai-com/qrcode-barcode-scanner for machine-readable metadata pointing directly to npm.

Glama MCP directory

View the published Glama listing for tool metadata, MIT licence info and quick reference links to the local stdio server.

npm package and GitHub archive

Install @qrcode-ai-com/qrcode-barcode-scanner-mcp from npm or fetch the matching GitHub release archive when your team pins local copies.

Desktop bundle (.mcpb)

Download the .mcpb desktop bundle from GitHub Releases for desktop MCP hosts that support direct extension archive installs.

How to connect the QR Code Scanner MCP server

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

  1. Step 1

    Register the server

    Add the npx mcpServers block to your host and verify it discovers scan_image plus read-only resources qrscan://scan-report-schema and qrscan://limits.

  2. Step 2

    Send image bytes and pick a profile

    Pass base64 bytes to scan_image (or enable scan_file for scoped directories). Choose fast (default), full (deepest score) or frame (no score).

  3. Step 3

    Verify output before acting

    Check detections and isError separately, then treat every decoded URL or text strictly as data before choosing any next action.

What a decoded QR code returns

scan_image returns the full report inside structuredContent carrying content.text and payload.kind, without ever opening decoded links.

A saved QR code image passes through an MCP server workflow and outputs the decoded web address https://qrcode-ai.com/.

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

For qr-reference.png, scan_image returns https://qrcode-ai.com/. Check the destination domain carefully before deciding to visit it.

Runtime, limits and report fields

Runtime and tools. Requires Node.js 22.19+ (or 24+) on macOS, Linux and Windows x64 over stdio. Exposes scan_image plus schema and limits resources; scan_file stays off unless QRSCAN_MCP_ALLOWED_DIRECTORIES lists permitted folders.

Limits and results. structuredContent carries the unchanged report; empty detections are valid outcomes while isError signals tool failures. Images cap at 8 MiB, 4,096 px per side and 16 MP; check trace.budget_exhausted (set budgetMs: 0 for unbounded scans) and never treat a null score as zero.

Host guides and licence. Check agent integration guides for host configs, the MCP integration reference for the full schema and the open-source scanner repository for MIT source code.

CLI, Docker, MCP server, skill or SDK: which QR code scanner fits?

The MCP server suits AI assistants that invoke tools directly. For another workflow, pick the matching guide below.

QR Code Scanner

Decode a single code right away in your browser with nothing to install.

Open QR code reader

QR Code Scanner CLI

Decode images inside a shell script or CI pipeline with a single command.

Explore QR Code Scanner CLI

QR Code Scanner Docker

Run an identical containerised scanner environment across workstations and CI runners.

Explore QR Code Scanner Docker

QR Code Scanner Skills

Give an AI agent a repeatable local procedure for reading QR code images.

Explore QR Code Scanner Skills

QR Code Scanner SDK

Embed local QR code scanning directly inside your own application.

Explore scanner SDK

QR Code Scanner MCP Server questions

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

A QR code scanner MCP server is a local process giving an AI assistant a callable tool for decoding QR code images. MCP (Model Context Protocol) defines how the assistant discovers and invokes that tool. With QR Code AI’s open-source server, your assistant sends image bytes to scan_image and receives exact decoder output instead of guessing visually.

Any MCP host able to run a local stdio server, including Cursor, OpenClaw, Goose, Continue, GitHub Copilot, JetBrains Junie and Factory Droid. Hosts reading an mcpServers JSON file accept the snippet under “Register the server in your MCP host”. Check the QR Code Scanner Integrations directory for client-specific instructions, then confirm scan_image is listed.

A local file path works only when the optional scan_file tool is explicitly enabled; an image URL is never accepted. scan_image takes imageBase64 (canonical base64 bytes with no data-URL prefix), so your host reads the image under its own permissions and sends the bytes. scan_file stays off by default until QRSCAN_MCP_ALLOWED_DIRECTORIES specifies permitted folders. Neither tool makes outbound network requests.

No. A call returning an empty detections array is a valid completed scan, distinct from a failure flagged with isError: true. If trace.budget_exhausted is true, treat an empty scan as incomplete rather than proof that no QR code exists.

No. The server outputs decoded content strictly as data and never visits links or calls other tools. Treat returned URLs and instruction-like strings strictly as untrusted input separate from assistant instructions; your host workflow decides any next action.

Launch it via npx from your host’s MCP config using command npx and args --yes --ignore-scripts @qrcode-ai-com/qrcode-barcode-scanner-mcp, or install locally with npm install --prefix ./.qrscan-mcp --ignore-scripts @qrcode-ai-com/qrcode-barcode-scanner-mcp. Because it is a local stdio process rather than a hosted HTTP server, there is no remote URL. Its Official MCP Registry ID is io.github.qrcode-ai-com/qrcode-barcode-scanner.

It returns whatever text was encoded: a URL, plain text or structured data. scan_image puts 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 document or app-download QR returns its URL rather than the file.

No. Decoding only proves readable text was stored in the image; it never certifies the destination website, identifies who published the code or authorises visiting it. The QR quality score estimates scannability as a software diagnostic, not a guarantee across every mobile camera or print surface.

No. Local MCP decoding stays separate from QR Code AI’s creation platform and generation API. That service has free creation limits, a seven-day Premium trial triggered by the first dynamic QR code or Smart Link, and Premium requirements for continued use of affected features. Reading a code starts no trial and alters no encoded data, and both the MCP server and scanner engine are open source under the MIT licence.