QRnegie Reference
Make QR codes with an image URL or an MCP tool call. Both use the same renderer and take the same content and design choices.
On This Page
Image URLs
| Request | Response |
|---|---|
GET /qr.svg | SVG image (image/svg+xml) |
GET /qr.png | PNG image (image/png) |
Add query parameters to either address. This example encodes www.cmu.edu in Mosaic Scotty at 1024 pixels:
https://qrnegie.andrew.cmu.edu/qr.svg?text=https%3A%2F%2Fwww.cmu.edu%2F&style=mosaic&width=1024
Parameters
| Parameter | Accepted Value | Default |
|---|---|---|
text | Text or a link, up to 1024 UTF-8 bytes. URL-encode the complete value. | Required |
style | A value from the style table. | scotty |
width | The width of the whole image in pixels, including the QR code's margin and design: a whole number up to 2048. The minimum depends on the style and content. | 512 |
above, below | One line above or below the code, up to 40 characters each. Letters, numbers, spaces and common punctuation; other characters return an error. Leave it blank for no line. | None |
icon | A
Bootstrap Icons
name, like wifi or calendar-event. Used only with
style=icon. /icons.json lists
the available names. The Builder picks an icon for the content type unless you
choose one. | link-45deg |
Supply each parameter once. Unknown parameter names are rejected.
Style Values
| Style | Value | Error Correction | Minimum Pixels per Module |
|---|---|---|---|
| Basic Scotty | scotty | High | 3 |
| Mosaic Scotty | mosaic | High | 6 |
| Kraus Campo | kraus-campo | High | 6 |
| Wean Hall | wean | High | 5 |
| Binary Heart | binary-heart | High | 6 |
| Block Monogram | block-monogram | Medium | 3 |
| Tilted Square | tilted-square | Medium | 3 |
| Basic Black | plain | Medium | 3 |
| Center Icon | icon | High | 3 |
| Engineering Paper | engineering-paper | High | 4 |
| Minefield | minefield | High | 5 |
| Scantron | scantron | High | 5 |
| Basic Dragon | dragon | High | 3 |
| Mosaic Dragon | mosaic-dragon | High | 6 |
| Terminal | terminal | Medium | 4 |
| Punch Card | punch-card | High | 3 |
| Basic Carnival | carnival-tent | High | 3 |
| Go Board | go-board | High | 5 |
| Sea Battle | sea-battle | High | 5 |
| Tic-Tac-Toe | tic-tac-toe | High | 5 |
| Basic Tartan | tartan-logo | High | 3 |
| Mosaic Tartan | mosaic-tartan | High | 6 |
The module limit is the minimum number of pixels for one cell in the QR code's grid. It's a rendering limit, not a recommended print size. The required image width also depends on the content, border and artwork; a width error reports the minimum for that request. Each style sets its own error correction.
Content Payloads
An image URL encodes the text value as supplied. A contact card, event
or network is a formatted text payload, not a separate image parameter. The Builder's
content fields assemble those payloads for you.
| Content Type | Payload Form |
|---|---|
| Link or Text | A complete destination URL or the text to display |
| Contact Card | A vCard, beginning with BEGIN:VCARD |
| Event | An event, beginning with BEGIN:VEVENT |
A mailto: address, optionally with a subject and message | |
| Phone Call | A tel: address |
| Map Location | A map link for the chosen map app (Google Maps, Apple Maps or OpenStreetMap) |
| Wi-Fi Network | A WIFI: payload or a connection-instructions URL, depending on the
network |
URL-encode the whole payload, including its own ampersands, question marks and line breaks. The 1024-byte limit applies to the decoded UTF-8 payload, not the longer percent-encoded query string. An image URL contains that payload, just as the QR code does.
In JavaScript, use URLSearchParams to encode the values:
const query = new URLSearchParams({
text: "https://www.cmu.edu/",
style: "icon",
icon: "calendar-event",
width: "1024",
above: "Visit CMU",
});
const imageUrl = `https://qrnegie.andrew.cmu.edu/qr.svg?${query}`;
Embedding and Downloads
Use an image URL directly in HTML. Escape its query separators as
&:
<img src="https://qrnegie.andrew.cmu.edu/qr.svg?text=https%3A%2F%2Fwww.cmu.edu%2F&style=plain&width=512"
alt="QR code for the Carnegie Mellon website" width="512">
The example leaves the height unset so the image keeps its natural proportions. If your layout requires both dimensions, use the exported image's actual width and height. Include a normal link beside a QR code on a web page so someone can open the destination without scanning.
To keep a file with your project, download the response. This command URL-encodes the text values and stops on an HTTP error:
curl --fail --show-error --get 'https://qrnegie.andrew.cmu.edu/qr.png' \
--data-urlencode 'text=https://www.cmu.edu/' \
--data 'style=icon' \
--data 'icon=calendar-event' \
--data 'width=1024' \
--data-urlencode 'above=Visit CMU' \
--output qrnegie.png
A downloaded file stays exactly as it was. An image URL always uses QRnegie's current designs, so its look can change when a design does, though never what it encodes. Browsers and other caches can keep a copy for up to a day.
MCP Server
Connect an AI agent to QRnegie's MCP server with these settings:
| Connection | Value |
|---|---|
| Server Name | qrnegie |
| Endpoint | https://qrnegie.andrew.cmu.edu/mcp |
| Transport | Streamable HTTP, without sign-in |
It offers these tools:
| Tool | Input | Result |
|---|---|---|
get_guide | No arguments | Image parameters and integration guidance |
generate_qr | text; optional style, width,
above, below and icon | A PNG image, SVG and PNG URLs, and HTML with the image's dimensions |
For generate_qr, use the same parameter meanings and defaults as image
URLs. Pass width as an integer from 96 to 2048; a style or payload may
require a higher minimum. These are tool arguments, not a query string:
{
"text": "https://www.cmu.edu/",
"style": "icon",
"icon": "calendar-event",
"width": 1024,
"above": "Visit CMU"
}
A generation failure returns a tool result marked isError with an
explanatory message. MCP protocol errors are separate from image errors; check the
tool result as well as the connection.
To set up an agent, start with the prompt on the home page.
Errors
| Status | Meaning | What to Check |
|---|---|---|
| 400 | QRnegie can't make that image. | Read the plain-text response. Check parameter names, repeated values, content length, style, width, text characters and icon name. A width error gives the required minimum; artwork may also require shorter content or a different style. |
| 500 | Something went wrong making the image. | Check the response before saving it as an image. Try again; if it keeps happening, report it on GitHub with a made-up example. |
Successful image requests return image data. Error responses are plain text, so integrations should check the HTTP status and content type before using the body. A successful image doesn't replace the checks on the finished layout.