Skip to main contentSkip to templates
All articles
guides··9 min read

How to Make a QR Code with ChatGPT or Claude (That Actually Scans)

Three ways to get a QR code from an AI assistant: ask it to write code, connect a QR code MCP server for styled codes with your colors and logo, or let it draft a design you finish in an editor. Why AI image generators make QR codes that do not scan.

tutorialaimcpchatgptclaudeqr-codes
A chat message asking for a heart-shaped QR code, and the pink heart-shaped QR code the assistant returned
Ozan Tunca
Ozan Tunca
Founder of Pretty QR, passionate about design and technology

An AI assistant can make a QR code that scans in two ways: it writes and runs code with a QR code library, or it calls a QR code tool through MCP. Do not use an AI image generator for the code itself. Image models draw patterns that look like a QR code but hold no link, so nothing happens when you scan them. For a styled code with your colors, shape, and logo, connect the free Pretty QR MCP server to Claude Code, Cursor, VS Code, or Claude Desktop and ask in plain words.

This guide shows all three ways, what each one is good for, and what to check before you print.

Why do AI image generators make QR codes that don't scan?

A QR code is data. Each small square (a module) is one bit, and the pattern follows the ISO/IEC 18004 standard: three finder squares in the corners, timing lines, format information, and error correction bytes calculated from your content. A scanner reads all of that and rebuilds your link.

An image model does not calculate anything. It learned what QR codes look like from millions of pictures, so it draws something with three corner squares and a lot of noise. Sometimes it even looks very good. But the modules are random, and the code decodes to nothing or to an error.

So when you type "make me a QR code for my bakery's website" into an image generator, you get a picture of a QR code. Put it on a menu and every scan fails.

The rule is simple: the code must come from a QR encoder. AI can choose the colors, write the call to action, and make the poster around it.

Way 1: How do I ask ChatGPT or Claude to write a QR code with code?

Both assistants can write a short program with a QR code library. When the assistant can also run code (ChatGPT's code tool, or Claude with code execution or an artifact), you get the image in the chat.

A prompt that works:

Write and run Python code that makes a QR code for https://example.com with the qrcode library. Use error correction level M, a 4-module quiet zone, black on white, and save it as a 1000 × 1000 px PNG. Give me the file.

What you get: a correct, plain black-and-white code. That is fine for a test or an internal label.

What you do not get easily: rounded or dotted modules, styled corner squares, a frame with "Scan me", a heart or circle shape, or a logo that the code still reads around. You can ask for these, but the assistant then writes a lot of custom drawing code, and each change is a new chance to break the quiet zone or the finder squares. Ask for one change at a time and scan after each one.

Two checks before you use a code from this route:

  1. Scan it with your phone camera and open the link. Do not trust a decoder the assistant runs on its own output only.
  2. Read the link the phone shows. Assistants sometimes "fix" a URL, drop a query string, or add www..

Way 2: How do I connect a QR code MCP server to Claude, Cursor, or VS Code?

MCP (Model Context Protocol) lets an assistant call an outside tool. The Pretty QR MCP server gives the assistant the same renderer as the design editor, so you get the same templates, shapes, frames, gradients, and logo options, and a file that scans.

The server has three tools:

ToolWhat it doesCounts towards your monthly allowance
list_templatesLists the templates with a name, description, and preview imageNo
create_qr_codeReturns the PNG (2048 px) or SVG file for your content and designYes
open_in_editorSaves the design to your account and returns a link that opens it in the editorYes

Step 1: Get a free API key

  1. Create a free account.
  2. Open API keys in the account menu (or go to /api-keys) and create a key. It starts with pqr_.
  3. Copy it now. The page shows the full key only once.

A free account gets 100 QR codes a month and up to 2 keys. The API and MCP share the same allowance. The count resets on the 1st of each month (UTC).

Step 2: Add the server to your assistant

Claude Code (terminal):

claude mcp add --transport http pretty-qr https://pretty-qr.com/api/mcp \
  --header "Authorization: Bearer $PRETTY_QR_KEY"

Cursor (.cursor/mcp.json):

{
  "mcpServers": {
    "pretty-qr": {
      "url": "https://pretty-qr.com/api/mcp",
      "headers": { "Authorization": "Bearer <your key>" }
    }
  }
}

VS Code (.vscode/mcp.json):

{
  "servers": {
    "pretty-qr": {
      "type": "http",
      "url": "https://pretty-qr.com/api/mcp",
      "headers": { "Authorization": "Bearer <your key>" }
    }
  }
}

Claude Desktop runs local servers, so it connects through the mcp-remote package (needs Node.js). In claude_desktop_config.json:

{
  "mcpServers": {
    "pretty-qr": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://pretty-qr.com/api/mcp",
        "--header",
        "Authorization:${PRETTY_QR_AUTH}"
      ],
      "env": { "PRETTY_QR_AUTH": "Bearer <your key>" }
    }
  }
}

Restart the app after you save the file.

ChatGPT and claude.ai (web): not yet. Their connectors need an OAuth sign-in, and the server accepts only an API key today. Use Way 1 there, or one of the apps above.

Step 3: Ask for the code in plain words

You do not need to know the field names. The assistant reads the tool description and fills them in. Some prompts and what the assistant does with them:

  • "Make a QR code for https://example.com/menu with the Café Menu template, as SVG." The assistant calls create_qr_code with the cafe-menu template and format: "svg".
  • "Heart-shaped QR code for our wedding page, dark pink on pale pink." It picks the heart template and sets the colors. Keep the module color dark: our QR code colors guide lists which pairs pass 4.5:1 contrast.
  • "Show me the templates, then make one with a banner that says 'Scan for Wi-Fi'." It calls list_templates first (free), then create_qr_code.
  • "Put logo.png from this folder in the middle." Claude Code, Cursor, and VS Code can read the file from your disk and send it as a data URL (PNG, JPG, WebP, or SVG). The renderer raises error correction for you, the same as the editor's Logo tab.
  • "Save it so I can change the frame myself." The assistant calls open_in_editor and gives you a pretty-qr.com/design/… link. The design also shows in My designs.

The last one is the most useful for print work. The assistant gets you most of the way in one sentence, and you move the last sliders yourself in the editor, where you see each change live.

Which route should I use?

You wantUse
A plain black-and-white code, fastWay 1 (code in the chat)
A branded code: colors, rounded dots, frame, logo, heart or circle shapeWay 2 (MCP)
Many codes from a list, or codes made by your own appThe QR API (same key, same allowance)
To design by eye with no accountThe design editor

Way 3: Can AI design the QR code and I finish it in an editor?

Yes, and for print this is often the best split. Ask the assistant for the design decisions, not the file:

I need a QR code for a coffee shop menu. Brand colors are #3b2f2f and #f5e6d3. Suggest module shape, corner style, a frame label of 3 words or fewer, and check the contrast ratio of my two colors.

Then open the design editor, start from the closest template, and type in what the assistant suggested. You get the assistant's ideas and a code from a real encoder, and you see every change before you download it.

What should I check before I print an AI-made QR code?

The same things as for any styled code. Our QR code design rules explain each one in detail. The short list:

  • Contrast: dark modules on a light background, at least 4.5:1.
  • Quiet zone: 4 modules of empty space on every side. Assistants that write their own drawing code often crop it.
  • Size: at least 2 cm wide on a business card. For a poster, minimum width ≈ scan distance ÷ 10 (scanned from 1 m → about 10 cm).
  • Content: open the link from a real scan, not from the chat.
  • Two phones: one new, one at least four years old, in normal room light.
  • Format: SVG for print, PNG for screens.

Does a code from an AI assistant expire?

That depends on what the assistant encoded, not on the assistant. A code made with a QR library or with Pretty QR is static: your link is in the pattern itself, so it works as long as the link works. No account or subscription is behind it.

Some QR tools make dynamic codes instead. The pattern holds a short link on the vendor's domain, and the vendor forwards the scan to your site. If that subscription ends, the forward stops and printed codes stop working. Our guide how to make a QR code that never expires shows how to check which kind you have.


Let the assistant choose and describe the design, and let a QR encoder make the code. Set up the MCP server or open the editor to start.

Questions? [email protected]

Frequently asked questions

Can ChatGPT make a QR code?

Yes, but not with its image generator. Image models draw patterns that look like QR codes and do not hold your link. Ask ChatGPT to write and run Python code with a QR code library instead, or connect it to a QR code tool. Scan the result with your phone before you use it.

Can Claude make a QR code?

Yes. Claude can write code that makes a plain QR code, and in Claude Code, Claude Desktop, Cursor, or VS Code it can call the Pretty QR MCP server, which returns a styled PNG or SVG with templates, colors, shapes, frames, and a logo.

Why does my AI-generated QR code not scan?

If an image generator (for example DALL·E, GPT Image, or Midjourney) drew it, it is a picture of a QR code, not an encoded one. The finder squares and modules are invented, so no scanner can read a link from them. Use code or a QR code tool to make the code, then use AI for the design around it.

What is a QR code MCP server?

MCP (Model Context Protocol) lets an AI assistant call outside tools. The Pretty QR MCP server at https://pretty-qr.com/api/mcp gives an assistant three tools: list_templates, create_qr_code (returns the PNG or SVG file), and open_in_editor (saves the design and returns an editor link).

Is the Pretty QR MCP server free?

Yes. A free account gets an API key and 100 QR codes a month, shared between the API and MCP. Listing templates does not count. The codes are static, so they keep working after you download them.

Does the Pretty QR MCP server work in ChatGPT or claude.ai?

Not yet. ChatGPT and claude.ai connectors need an OAuth sign-in, which the server does not have yet. It works today in Claude Code, Cursor, VS Code, and Claude Desktop (through mcp-remote) with an API key.