# Agent QR — QR Code Generator for AI Agents

## Overview

Agent QR provides QR code generation via MCP server, CLI, and REST API. Designed for AI agents (Claude, ChatGPT, Cursor, custom agents) to generate QR codes programmatically with zero friction.

## Quick Start

### Option 1: REST API (no installation)

Call the API directly. First call auto-provisions an API key — no signup needed.

```
POST https://api.agentqr.tools/v1/qr
Content-Type: application/json

{"data": "https://example.com", "format": "png", "size": 300}
```

Store the returned `api_key` for future calls (1,000 free codes/month).

### Option 2: MCP Server

Install the MCP server for Claude Code, Cursor, or any MCP-compatible client:

```json
{
  "mcpServers": {
    "agent-qr": {
      "command": "npx",
      "args": ["-y", "@agent-qr/mcp"]
    }
  }
}
```

Available tools:
- `generate_qr_code` — Generate a single QR code
- `generate_qr_batch` — Generate multiple QR codes at once

### Option 3: CLI

```bash
npx @agent-qr/cli generate --url "https://example.com" -o qr.png
npx @agent-qr/cli generate --text "Hello World" --format svg
npx @agent-qr/cli generate --url "..." --color-dark "#FF0000" --size 500
```

## API Reference

### POST /v1/qr

Generate a QR code. On first call without an API key, one is auto-provisioned.

**Request:**
```json
{
  "data": "https://example.com",
  "format": "png",
  "size": 300,
  "errorCorrectionLevel": "M",
  "colorDark": "#000000",
  "colorLight": "#FFFFFF"
}
```

**Response:**
```json
{
  "image": "data:image/svg+xml;base64,...",
  "metadata": { "qr_id": "qr_abc123", "format": "png", "size": 300 },
  "tier": "free",
  "remaining": 999,
  "api_key": "qr_live_xxx",
  "upgrade_hint": "Store this API key..."
}
```

### POST /v1/qr/batch

Generate multiple QR codes. Requires `X-API-Key` header.

## Pricing

| Tier | Price | Limit | Features |
|------|-------|-------|----------|
| Free | $0 | 1,000/mo | All generation features, auto-provisioned key |
| Pro | $10/mo | 10,000/mo | Dynamic codes, analytics, webhooks |

## Links

- Website: https://agentqr.tools
- API: https://api.agentqr.tools
- OpenAPI: https://agentqr.tools/openapi.json
- GitHub: https://github.com/patrickjrs/agent-qr