Quality QRQuality QR
  • Features
  • Use Cases
  • Pricing
  • Docs
  • Blog
Back to Blog
Tutorials

QR Code API and MCP: A Developer's Guide

Two ways to generate QR codes programmatically: a REST API for traditional integrations and an MCP server for AI assistants like Claude and Cursor. Auth, examples, and rate limits.

February 17, 202613 min readBy Quality QR Team
Developer screen showing QR code API integration code and response

On this page

  • Why Use a QR Code API?
  • Two Ways to Integrate
  • Getting Started with the REST API
  • Authentication
  • Base URL
  • Rate Limits
  • Creating QR Codes via REST
  • Code Examples
  • cURL
  • JavaScript (Node.js)
  • Python
  • The MCP Server: Natural Language QR Management
  • What the MCP Server Exposes
  • Setup in 30 Seconds
  • Example Prompts
  • MCP Rate Limits
  • REST API vs. MCP: Which to Use
  • Best Practices

Quality QR offers two ways to create and manage QR codes programmatically: a REST API for traditional integrations, and an MCP (Model Context Protocol) server that lets Claude, Cursor, and other AI assistants do it in natural language. This guide covers both: when to use each, how to authenticate, and runnable examples in cURL, JavaScript, and Python.

Why Use a QR Code API?

A dashboard is fine for creating a handful of codes. Programmatic generation is essential when you need to:

  • Automatically create QR codes when new products, orders, or users are added
  • Generate codes from a database or CRM at scale
  • Embed QR generation directly into your application
  • Trigger creation from workflows or CI/CD pipelines
  • Let an AI assistant create and manage codes through conversation

Two Ways to Integrate

REST API. Standard HTTPS plus JSON. Best when you're embedding QR generation into your own app, automating bulk creation from a database, or wiring it into Zapier, n8n, or CI pipelines.

MCP Server. A Model Context Protocol endpoint that exposes 6 tools (create, list, get, update, delete, analytics) to AI assistants. Best when you want Claude, Cursor, or any MCP client to manage QR codes through prompts. No SDK, no fetch calls. Just ask.

Both use the same API key from your dashboard, so you can mix and match across projects.

Getting Started with the REST API

Authentication

All API requests require an API key passed in the Authorization header. Generate your key from the Dashboard → API Keys page.

Authorization: Bearer your_api_key_here

Base URL

All endpoints use the base URL:

https://quality-qr.app/api/v1

Rate Limits

API rate limits are monthly, not per-minute: 100 requests/month on Free, 1,000 on Pro, and 10,000 on Business. Every response includes X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset headers so you can track usage. See the full rate limit documentation.

Creating QR Codes via REST

The core endpoint is POST /api/v1/qr. Send a JSON body describing the code you want:

POST /api/v1/qr

{
  "type": "url",
  "content": "https://example.com",
  "name": "Homepage Link",
  "isDynamic": true
}

Response:

{ "success": true, "dataUrl": "data:image/png;base64,...", "qrCode": { "id": "qr_8xK2mNp3", "shortUrl": "https://quality-qr.app/q/8xK2mN" } }

Supported types include URL, WiFi, vCard, Email, Phone, SMS, Event, PDF, Menu, App Store, Social, and Plain Text. See the QR codes endpoint reference for the full schema, including design options for colors, patterns, and logos.

Code Examples

cURL

curl -X POST https://quality-qr.app/api/v1/qr \
  -H "Authorization: Bearer $QUALITY_QR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"type": "url", "content": "https://example.com", "isDynamic": true}'

JavaScript (Node.js)

const response = await fetch('https://quality-qr.app/api/v1/qr', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${process.env.QUALITY_QR_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    type: 'url',
    content: 'https://example.com',
    isDynamic: true,
  }),
});

const data = await response.json();
console.log(data.qrCode.shortUrl);

Python

import os, requests

response = requests.post(
    'https://quality-qr.app/api/v1/qr',
    headers={'Authorization': f'Bearer {os.environ["QUALITY_QR_API_KEY"]}'},
    json={'type': 'url', 'content': 'https://example.com', 'isDynamic': True},
)

data = response.json()
print(data['qrCode']['shortUrl'])

The MCP Server: Natural Language QR Management

If you're building with Claude, Cursor, or any MCP-compatible AI tool, the MCP server is the fastest path to QR automation. Instead of writing fetch calls, you give your assistant a prompt and it picks the right tool.

Endpoint: https://quality-qr.app/api/mcp

Auth: Bearer token (same API key as REST)

Protocol: JSON-RPC 2.0 over HTTP

What the MCP Server Exposes

Six tools cover the full QR lifecycle:

  • `quality_qr_create`: create any of the 12 supported types (URL, WiFi, vCard, and more) and return inline SVG
  • `quality_qr_list`: list your codes with optional type filter and pagination
  • `quality_qr_get`: fetch full details including destination, styling, and status
  • `quality_qr_update`: update a dynamic code's destination URL, name, or enabled state
  • `quality_qr_delete`: permanently delete a code and free up your plan quota
  • `quality_qr_analytics`: total scans, daily trends, device breakdown, and top countries

These tools also cover the lifecycle operations beyond creation. REST handles create and list (POST /api/v1/qr and GET /api/v1/qr); update, delete, and analytics are exposed through MCP rather than additional REST endpoints today, so MCP is the recommended path when you need full lifecycle management from code.

Setup in 30 Seconds

Claude Desktop or Cursor. Add this to your MCP config (claude_desktop_config.json or ~/.cursor/mcp.json):

{
  "mcpServers": {
    "quality-qr": {
      "url": "https://quality-qr.app/api/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}

Claude Code (CLI):

claude mcp add quality-qr \
  --transport http \
  https://quality-qr.app/api/mcp \
  --header "Authorization: Bearer YOUR_API_KEY"

Smithery. Install in one click from the Smithery registry. Smithery handles the authorization header automatically.

The server is open source: github.com/silly-geese/quality-qr-mcp.

Example Prompts

Once connected, you can drive QR creation entirely through conversation:

  • "Create a QR code for https://example.com"
  • "Make a WiFi QR code for network MyWiFi with password guest123"
  • "Show me analytics for my QR codes"
  • "Disable QR code abc123"
  • "Create a vCard QR for John Doe, john@example.com"

MCP Rate Limits

Tool calls count against the same monthly API quota as REST: 100/month on Free, 1,000 on Pro, and 10,000 on Business. Protocol messages like initialize and tools/list are free. Analytics history depth scales with your plan: 7 days on Free, 30 days on Pro, 1 year on Business.

Full setup details live on the MCP docs page.

REST API vs. MCP: Which to Use

Reach for REST when you need deterministic server-to-server automation, bulk generation from a database, integration with CI/CD or workflow tools, or any context where an LLM isn't in the loop.

Reach for MCP when you want an AI assistant to create and manage codes on your behalf, you're prototyping quickly inside Claude or Cursor, or you need list, update, delete, and analytics in addition to create without writing client code.

Best Practices

  • Cache responses. Don't re-fetch QR data that hasn't changed.
  • Watch the rate-limit headers. Implement exponential backoff on 429 responses, using the Retry-After value.
  • Store QR code IDs. Save the returned ID so you can update or delete the code later.
  • Restrict your API key. chmod 600 your config files, rotate keys via the dashboard, and never commit them to git.
  • Revoke compromised keys instantly. Revocation takes effect immediately on the dashboard.

Check current usage and limits on the API rate limits page. Upgrade your plan if you need higher limits.

Get started by generating a free API key from the dashboard, then pick the path that fits your stack: the REST API for code, or the MCP server for AI assistants.

Frequently Asked Questions

What's the difference between the REST API and the MCP server?

The REST API is a traditional HTTPS plus JSON interface for server-to-server integrations and bulk automation. The MCP server is a JSON-RPC endpoint designed for AI assistants like Claude and Cursor. They call its tools (create, list, update, delete, analytics) in response to natural language prompts. Both authenticate with the same API key, so you can use both from the same account.

What are the API rate limits?

Rate limits are monthly, not per-minute: 100 requests/month on Free, 1,000 on Pro, and 10,000 on Business. MCP tool calls draw from the same per-API-key quota, so REST and MCP usage share one budget. Every response includes X-RateLimit-Remaining and Retry-After headers so you can back off cleanly.

What programming languages does the API support?

The REST API works with any language that can make HTTP requests. We provide examples for cURL, JavaScript/Node.js, and Python. The MCP server is consumed by AI clients like Claude Desktop, Claude Code, Cursor, and Smithery rather than client libraries, so the language you write your prompts in is what matters.

Can I create dynamic QR codes through the API?

Yes. Set isDynamic: true in the REST request body, or just ask the MCP server to create a dynamic code. Dynamic codes get a trackable short URL, full scan analytics, and an editable destination, and they count against your plan's dynamic-code allowance.

How do I list, update, or delete QR codes via the API?

Listing is available via REST (`GET /api/v1/qr` with pagination). Update, delete, and analytics are exposed through the MCP server today (quality_qr_update, quality_qr_delete, quality_qr_analytics), so MCP is the recommended path when you need full lifecycle management from code. Connect Claude or any MCP client and call them by name, or just describe what you want in plain English.

How do I handle API rate limit errors?

When you exceed the limit, the API returns a 429 status with a Retry-After header indicating seconds to wait. Implement exponential backoff (1s, 2s, 4s, and so on) and watch X-RateLimit-Remaining proactively. Spread requests over time rather than bursting.

Is the MCP server open source?

Yes. The implementation lives at github.com/silly-geese/quality-qr-mcp and you can install it directly from the Smithery registry for one-click setup. The hosted endpoint at quality-qr.app/api/mcp is what most users connect to.

View all FAQs

Related Quality QR Features

Put the ideas in this article into practice with these features:

API Access

REST endpoints with bearer-token auth, 100 free requests per month

Dynamic QR Codes

Generate codes programmatically with editable destinations

Bulk Creation

Batch generation from CSV, also exposed via the API

Related Articles

How to Create a QR Code for Your Etsy Shop with Quality QR
Tutorials

How to Create a QR Code for Your Etsy Shop with Quality QR

Step-by-step tutorial for creating, customizing, and tracking QR codes for your Etsy shop using Quality QR. Boost repeat customers and reviews with dynamic codes on your packaging.

How to Create an Instagram QR Code with Quality QR
Tutorials

How to Create an Instagram QR Code with Quality QR

Create custom Instagram QR codes with tracking using Quality QR. Link to your profile, posts, or Reels with branded designs and scan analytics.

How to Add QR Codes to Invoices and Payment Pages
Tutorials

How to Add QR Codes to Invoices and Payment Pages

Add QR codes to your invoices for faster payments. Learn how to create invoice QR codes with Quality QR that link to payment pages, reducing payment delays.

QQT

Written by

Quality QR Team

The Quality QR team brings together experts in QR technology, marketing, and software development. We're passionate about helping businesses create effective QR code strategies.

Ready to get started?

Create your first QR code in seconds. No credit card required.

Create Free QR Code
QR Code Tracking: Monitor Scans & Measure SuccessQR Code Generator Pricing: How to Avoid Hidden Fees in 2026
Quality QRQuality QR

Create beautiful, trackable QR codes with transparent pricing and a free tier that never expires.

Review us on Trustpilot

Product

  • Features
  • Pricing
  • API
  • Demo
  • QR Generator

QR Types

  • Use Cases
  • URL QR Code
  • WiFi QR Code
  • vCard QR Code
  • Email QR Code

Resources

  • Documentation
  • Guides
  • Knowledge Base
  • Alternatives
  • Blog

Company

  • About
  • Privacy Policy
  • Cookie Settings
  • Terms of Service
  • Contact

© 2026 Quality QR. All rights reserved. · Sitemap