A Model Context Protocol (MCP) server that lets you generate, decorate, and decode QR codes directly from any MCP client (Claude Desktop, Cursor, VS Code via Continue.dev, etc.).
| Tool | Description |
|---|---|
generate_qr |
Generate a QR code PNG from text or a URL |
generate_qr_with_logo |
Generate a QR code with a centred logo image |
decode_qr |
Decode a QR code from a base64-encoded PNG |
# Clone or create the project directory
mkdir qr-code-mcp && cd qr-code-mcp
# Install dependencies
pip install -r requirements.txt
# (Optional) Install pyzbar for QR decoding
pip install pyzbar
Note for Windows users:
pyzbarrequires the ZBar library. Download the Windows build and ensurezbar.dllis on yourPATH, or use the Windows PyPI wheel.
python server.py
The server starts in stdio mode, ready to be connected by any MCP client.
Add to your claude_desktop_config.json:
{
"mcpServers": {
"qr-code-mcp": {
"command": "python",
"args": ["/absolute/path/to/qr-code-mcp/server.py"]
}
}
}
Add to your ~/.continue/config.json:
{
"experimental": {
"mcpServers": [
{
"name": "qr-code-mcp",
"transport": "stdio",
"command": "python",
"args": ["/absolute/path/to/qr-code-mcp/server.py"]
}
]
}
}
# Input
data = "https://example.com"
size = 400
# Returns:
# {
# "format": "png",
# "base64": "iVBORw0KGgo...",
# "mime_type": "image/png"
# }
# Input
data = "https://example.com"
logo_url = "https://example.com/logo.png"
size = 400
# Returns the same format as generate_qr with the logo centred
# on the QR code. If the logo download fails, the QR code is
# returned without the logo and an error note is provided.
# Input
image_base64 = "iVBORw0KGgo..."
# Returns:
# {
# "data": "https://example.com"
# }
Requires pyzbar. If not installed, a helpful error message with install instructions is returned instead.
generate_qr(data, size?, format?)| Parameter | Type | Default | Description |
|---|---|---|---|
data |
string | – | Text or URL to encode (required) |
size |
integer | 400 |
Width/height of the output PNG |
format |
string | "png" |
Output format (currently only "png") |
generate_qr_with_logo(data, logo_url?, size?)| Parameter | Type | Default | Description |
|---|---|---|---|
data |
string | – | Text or URL to encode (required) |
logo_url |
string | "" |
URL of the logo image to centre on the QR |
size |
integer | 400 |
Width/height of the output PNG |
decode_qr(image_base64)| Parameter | Type | Default | Description |
|---|---|---|---|
image_base64 |
string | – | Base64-encoded PNG data (required) |
This server is ready to deploy on Smithery.ai. The smithery.yaml configuration is included in this repository.
$19/month — includes:
MIT