Scan QRCode MCP Server
MCP server that decodes QR codes from either a data URL (base64) or an HTTP(S) image URL and returns the decoded text.
Features
- Two precise tools for decoding:
decode_qrcode_data_url
— acceptsimageDataUrl
decode_qrcode_image_url
— acceptsimageUrl
- Decodes common image formats (PNG, JPEG, etc.).
- Deterministic behavior with clear errors for invalid inputs.
Getting Started
Configure this MCP server in your client using either npx
(recommended) or the global binary.
Standard config (recommended, uses npx
):
Alternative using the global binary (after npm i -g scan-qrcode-mcp
):
Follow the MCP install guide: https://modelcontextprotocol.io/quickstart/user
Use the Standard config JSON above (name it qrcode
).
Use the Claude Code CLI to add the QR MCP server:
Follow: https://code.visualstudio.com/docs/copilot/chat/mcp-servers#_add-an-mcp-server Or install via VS Code CLI (npx example):
Edit ~/.codex/config.toml
and add one of the following:
or, if you installed globally:
Settings -> MCP -> Add new MCP Server.
Name: qrcode
. Either use npx scan-qrcode-mcp@latest
or the global binary.
Notes:
- Requires Node.js 18.17+.
- If using the global binary but
scan-qrcode-mcp
is not found, ensure your global npm bin is on PATH and restart the client.
Project Structure
Scripts
npm i
: Install dependencies.npm run dev
: Start MCP server in watch mode (stdio transport).npm run build
: Compile TypeScript todist/
.npm start
: Run compiled server fromdist/
.npm test
: Run unit tests with coverage (Vitest).npm run lint
/npm run format
: Lint and format.
Usage
The server uses stdio transport and exposes two tools:
decode_qrcode_data_url
- Input:
{ imageDataUrl: string }
—data:<mime>;base64,<data>
URL for the QR image
- Input:
decode_qrcode_image_url
- Input:
{ imageUrl: string }
—http(s)
URL to the QR image
- Input:
Examples (pseudo-JSON-RPC over MCP):
Decode from data URL
Decode from image URL
Response text content contains the decoded string.
Configuration
- Requires Node.js 18.17+ for built-in
fetch
. - No environment variables are required.
Security Notes
- Only
http(s)
is allowed forimageUrl
. Data URLs must be base64-encoded. - Do not pass untrusted remote URLs without appropriate allowlisting in your environment.
License
MIT
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables decoding QR codes from images provided as either base64 data URLs or HTTP(S) image URLs. Supports common image formats and returns the decoded text content with clear error handling.