QR Code Scanner MCP Server

Let your AI assistant decode QR code images on your local machine. It calls a local scanner tool and 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 standard input and output

    stdio

  • Runtime

    Node.js 22.19+ or 24+

Add the server and scan your first QR code image

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.

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

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

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.

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

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

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 report is returned in structuredContent, the machine-readable part of the tool response.

This excerpt is taken from the scanner’s published example report.

MCP hosts and distribution options

The snippets above show the generic setup. Below are the supported MCP clients and published registries that distribute the same local stdio server.

Cursor and editor agents

Connect the MCP server to Cursor, GitHub Copilot, JetBrains Junie or Continue using each editor’s MCP settings and local tool permissions.

OpenClaw, Goose and Factory Droid

Add local QR code scanning to OpenClaw, Goose, Factory Droid, Pi agent and other stdio MCP agents via the shared plugin repository or the mcpServers entry above.

Official MCP Registry

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

Glama MCP directory

Browse the published Glama server listing for tool metadata, MIT licence information 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 download the matching GitHub release archive when your environment pins local copies.

Desktop bundle (.mcpb)

Download the .mcpb desktop extension archive attached to GitHub Releases for desktop MCP hosts that install extension bundles directly.

How to connect the QR Code Scanner MCP server

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

  1. Step 1

    Connect the server

    Add the npx mcpServers entry to your host and check that it discovers scan_image alongside the read-only resources qrscan://scan-report-schema and qrscan://limits.

  2. Step 2

    Request a scan and pick a profile

    Send base64 image bytes to scan_image (or enable scan_file for permitted folders). Choose fast (default), full (deepest score) or frame (decode only, no score).

  3. Step 3

    Review the result before acting

    Inspect detections and isError separately, then treat the decoded URL or text as data before deciding on any follow-up step.

What a decoded QR code gives you

scan_image returns the full scanner report in structuredContent with content.text and payload.kind, and never opens decoded links automatically.

Diagram of a QR code image passing through the MCP server workflow to produce the decoded address https://qrcode-ai.com/.

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

For qr-reference.png, scan_image returns https://qrcode-ai.com/. Inspect the domain before choosing whether to open the address.

Runtime, limits and result 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 disabled unless QRSCAN_MCP_ALLOWED_DIRECTORIES lists permitted folders.

Limits and results. structuredContent carries the unmodified scan report; an empty detections list is a valid outcome while isError flags tool failures. Images cap at 8 MiB, 4,096 px per side and 16 MP; check trace.budget_exhausted (set budgetMs: 0 for no cap) and never treat a null score as zero.

Host setup and licence. Browse the agent integration guides for host-specific configurations, the MCP server reference for the complete contract and the scanner repository for the MIT-licensed source code.

CLI, Docker, MCP server, skill or SDK: which QR code scanner tool do you need?

The MCP server is built for AI assistants that call tools. For another workflow, pick the matching guide below.

QR Code Scanner

Read a QR code directly in your browser, with nothing to install and no account needed.

Open the QR code reader

QR Code Scanner CLI

Decode images in a terminal script or CI pipeline with a single command.

Explore QR Code Scanner CLI

QR Code Scanner Docker

Run the same containerised scanner environment across every machine and CI runner.

Explore QR Code Scanner Docker

QR Code Scanner Skills

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

Explore QR Code Scanner Skills

QR Code Scanner SDK

Embed local QR code scanning directly into your own application, in your language.

Explore the scanner SDK

QR Code Scanner MCP Server questions

Hosts, tool input, empty results, installation and licensing.

A QR code scanner MCP server is a local program that gives an AI assistant a dedicated tool for decoding QR code images. MCP (Model Context Protocol) is the standard the assistant uses to discover and call that tool. With QR Code AI’s open-source server, the assistant sends image bytes to the scan_image tool and receives the decoded content from a real decoder rather than making a visual guess about the image.

Any AI assistant or code editor that can launch a local MCP server over stdio, including Cursor, OpenClaw, Goose, Continue, GitHub Copilot, JetBrains Junie and Factory Droid. Hosts that read an mcpServers JSON file accept the entry shown under “Add the server to your MCP host”. Browse the QR Code Scanner Integrations directory for client-specific setups, then verify that your host lists scan_image.

You can pass a local file path only through the optional scan_file tool, and you can never pass an image URL. By default, scan_image accepts imageBase64, the canonical base64 of the image bytes without a data-URL prefix: your host reads the chosen image within its own permissions and forwards the bytes. The optional scan_file tool reads a single image by its absolute path; it stays disabled by default and appears only when the person configuring the server sets QRSCAN_MCP_ALLOWED_DIRECTORIES to the permitted folders. Neither tool fetches remote URLs.

No. An empty detections list is a valid completed result when no supported code is detected, and it differs from a tool error flagged with isError: true. If the report indicates that its time budget was exhausted, treat an empty result as incomplete evidence rather than proof that no code exists in the image.

No. The MCP server returns decoded content strictly as data and never follows a destination. Keep any returned URL or instruction-like text separate from the assistant’s own instructions. Any decision to open a link or invoke another tool remains under your host workflow’s control.

Both are shown in the setup section above. To launch the server with npx from your host’s MCP configuration, set the command to npx with the arguments --yes --ignore-scripts @qrcode-ai-com/qrcode-barcode-scanner-mcp. To pin a local copy instead, run npm install --prefix ./.qrscan-mcp --ignore-scripts @qrcode-ai-com/qrcode-barcode-scanner-mcp and point your mcpServers entry to the absolute paths. Because it runs as a local stdio server rather than a hosted HTTP endpoint, there is no remote server URL; the Official MCP Registry lists it under io.github.qrcode-ai-com/qrcode-barcode-scanner.

Scanning returns the exact data encoded in the symbol: a web address, plain text or structured data. scan_image places the scanner report in structuredContent so your assistant can quote it directly. For example, a plain-text QR code containing “Meeting point: North entrance” returns those words, while a code linking to a document or an app download returns its URL rather than the underlying file.

No. Successful decoding confirms only that content could be read from the image. It does not verify the linked website, establish who placed the code or authorise a visit. The QR quality score describes how reliably a design reads; it is a software diagnostic, not a guarantee across every mobile phone camera or printed code.

No. Local MCP scanning is completely separate from the QR Code AI creation service and its generation API. That creation service has free creation limits and a seven-day Premium trial triggered by creating the first dynamic QR code or Smart Link; Premium is required for continued use of affected features. Reading an existing code uses no generation credits, does not start a free trial and never alters what is encoded in the symbol. Both the MCP server and the scanner engine are open source under the MIT licence.