Skip to content

GoPlausible/qrclaw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🦞 QRClaw

Instant QR code smart links with rich previews β€” powered by Cloudflare Workers.

QRClaw generates shareable QR code pages from any string or URL. Each QR code gets a smart link with full Open Graph and Twitter Card metadata for rich previews when shared on social media, messaging apps, or embedded anywhere.

Built to solve the QR code rendering problem in agentic tools like OpenClaw, Claude Code, Copilot, and other CLI/UI agents.

Features

  • Instant edge generation β€” QR codes created in milliseconds on Cloudflare Workers
  • Smart links β€” each QR gets a unique URL with rich social previews (OG + Twitter Cards)
  • UTF-8 + Image β€” dual rendering: scannable image for web, UTF-8 block characters for terminals
  • 24h TTL β€” links auto-expire, keeping things clean and ephemeral
  • Copy everything β€” one-click copy for image, UTF-8 text, source data, and smart link
  • Content negotiation β€” returns JSON for API clients (Accept: application/json), redirects browsers to the QR page

Quick Start

Browser

Visit https://qrclaw.goplausible.xyz, paste any text or URL, and hit Generate.

API / CLI

# Browser or curl β€” redirects to the smart link page
curl -L "https://qrclaw.goplausible.xyz/?q=https://example.com"

# JSON response for programmatic use
curl -H "Accept: application/json" "https://qrclaw.goplausible.xyz/?q=https://example.com"

JSON response:

{
  "link": "https://qrclaw.goplausible.xyz/q/abc123...",
  "qr": "β–ˆβ–€β–€β–€β–€β–€β–ˆ ...",
  "data": "https://example.com",
  "expires_in": "24h"
}

MCP / Agentic Tools

Any MCP-compatible agent can call QRClaw via HTTP:

GET https://qrclaw.goplausible.xyz/?q=<your-string>
Accept: application/json

The response includes a qr field with UTF-8 block characters that render directly in terminal-based agents, plus a link field for the full smart link page.

Endpoints

Method Path Description
GET /?q=<string> Generate QR code. Redirects browsers to smart link; returns JSON for API clients.
GET /q/:uuid Smart link page with image/UTF-8 toggle, copy buttons, and social preview metadata.
GET /image/:uuid.jpeg Raw QR code JPEG image.
GET / Landing page (when no q parameter).

Smart Link Page

Each generated QR code gets a dedicated page with:

  • Image view β€” high-quality scannable JPEG QR code
  • UTF-8 view β€” terminal-friendly block character rendering
  • Copy buttons β€” copy image, UTF-8 text, original data, or page link
  • Rich previews β€” Open Graph and Twitter Card meta tags for social sharing
  • 24h expiry β€” auto-cleanup via Cloudflare KV TTL

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”     GET /?q=hello     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Client  β”‚ ──────────────────▢  β”‚  Cloudflare Worker β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                       β”‚                    β”‚
                                  β”‚  1. Generate QR    β”‚
                                  β”‚     @juit/qrcode   β”‚
                                  β”‚     + @cf-wasm/    β”‚
                                  β”‚       photon       β”‚
                                  β”‚                    β”‚
                                  β”‚  2. Build HTML     β”‚
                                  β”‚     with OG meta   β”‚
                                  β”‚                    β”‚
                                  β”‚  3. Store in KV    β”‚
                                  β”‚     (24h TTL)      β”‚
                                  β”‚                    β”‚
                                  β”‚  4. Return link    β”‚
                                  β”‚     or redirect    β”‚
                                  β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                           β”‚
                                  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                  β”‚   Cloudflare KV     β”‚
                                  β”‚                     β”‚
                                  β”‚  page--<uuid>  HTML β”‚
                                  β”‚  image--<uuid> JPEG β”‚
                                  β”‚       (base64)      β”‚
                                  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Development

Prerequisites

  • Node.js (v18+)
  • Wrangler CLI (npm i -g wrangler)
  • A Cloudflare account with Workers and KV enabled

Setup

git clone https://github.com/GoPlausible/qrclaw.git
cd qrclaw
npm install

Local Development

npm run dev
# β†’ http://localhost:8787

Deploy

npm run deploy

Configuration

wrangler.toml:

name = "qrclaw"
main = "src/index.ts"
compatibility_date = "2025-03-18"
compatibility_flags = ["nodejs_compat"]

[route]
pattern = "qrclaw.yourdomain.com/*"
zone_id = "your-zone-id"

[[kv_namespaces]]
binding = "QRCLAW_KV"
id = "your-kv-namespace-id"

Environment Variables

Variable Description Default
BASE_URL Public base URL for generated links Auto-detected from request origin

Dependencies

Package Purpose
@juit/qrcode QR code generation (PNG) β€” zero-dependency, Workers-compatible
qrcode QR matrix generation for UTF-8 rendering via QRCode.create()
@cf-wasm/photon Image processing (PNG β†’ JPEG conversion) on Workers

Rate Limiting

  • 5 QR codes per minute per IP address
  • Configured via Cloudflare Dashboard β†’ Security β†’ WAF β†’ Rate limiting rules
  • Blocks at the edge before the Worker runs β€” no code changes needed
  • Exceeding the limit returns HTTP 429 (Too Many Requests)

Input Validation

  • Input is trimmed of leading/trailing whitespace
  • Empty input returns 400 with a JSON error
  • Maximum input length: 2048 characters (QR codes with high error correction can't encode more)

Install the QRClaw Skill

QRClaw includes an agent skill that teaches AI assistants (Claude Code, OpenClaw, Copilot, etc.) how to use the QRClaw API. There are several ways to install it:

Via ClawHub (OpenClaw)

npx clawhub install qrclaw

The skill will be available immediately for your OpenClaw agent to use.

Via skills.sh

npx skills add GoPlausible/qrclaw

This downloads and installs the QRClaw skill into your agent's skill directory.

Manual Installation

Copy the skill/ directory from this repo into your agent's skills folder:

# Claude Code
cp -r skill/SKILL.md ~/.claude/skills/qrclaw/SKILL.md

# Or clone and symlink
git clone https://github.com/GoPlausible/qrclaw.git
ln -s "$(pwd)/qrclaw/skill" ~/.claude/skills/qrclaw

License

MIT β€” built by GoPlausible

About

The QRCode generator for your OpenClaw with rich social and web views

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors