<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: QR Suisse</title>
    <description>The latest articles on DEV Community by QR Suisse (@qr_suisse_82ff9b63dd564e6).</description>
    <link>https://dev.to/qr_suisse_82ff9b63dd564e6</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4239943%2F4ff0947f-9a54-45b6-bc7b-34ae2e9f9dac.png</url>
      <title>DEV Community: QR Suisse</title>
      <link>https://dev.to/qr_suisse_82ff9b63dd564e6</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/qr_suisse_82ff9b63dd564e6"/>
    <language>en</language>
    <item>
      <title>Let your AI agent read the QR Suisse docs over MCP, then create a dynamic QR code with the API</title>
      <dc:creator>QR Suisse</dc:creator>
      <pubDate>Wed, 11 Nov 2026 22:31:39 +0000</pubDate>
      <link>https://dev.to/qr_suisse_82ff9b63dd564e6/let-your-ai-agent-read-the-qr-suisse-docs-over-mcp-then-create-a-dynamic-qr-code-with-the-api-32ch</link>
      <guid>https://dev.to/qr_suisse_82ff9b63dd564e6/let-your-ai-agent-read-the-qr-suisse-docs-over-mcp-then-create-a-dynamic-qr-code-with-the-api-32ch</guid>
      <description>&lt;p&gt;AI coding assistants write better integration code when they can read the real documentation instead of guessing from memory. In this tutorial you will:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;connect an MCP client (Claude Code or VS Code) to a &lt;strong&gt;public, read-only MCP server&lt;/strong&gt; that serves the QR Suisse API documentation;&lt;/li&gt;
&lt;li&gt;check what that server exposes, with nothing more than &lt;code&gt;curl&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;create a &lt;strong&gt;dynamic QR code&lt;/strong&gt; with the QR Suisse REST API, change its destination, and download it as SVG.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;QR Suisse is a dynamic QR code generator hosted in Switzerland: the printed code points to a short redirect address, so you can change the destination later without reprinting. (It is not a generator for the Swiss QR-bill payment slip.)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What you need&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For part 1 and 2: nothing. The documentation server needs no account and no key.&lt;/li&gt;
&lt;li&gt;For part 3: a QR Suisse account on a &lt;strong&gt;Pro or Entreprise&lt;/strong&gt; plan (the API is not available on the Free plan), and an API key with the &lt;code&gt;QR_CREATE&lt;/code&gt; and &lt;code&gt;QR_READ&lt;/code&gt; rights.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;curl&lt;/code&gt; and &lt;code&gt;jq&lt;/code&gt;, or Node.js 18+ for the JavaScript version.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Part 1: connect your agent to the documentation server
&lt;/h2&gt;

&lt;p&gt;The server lives at:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://www.qrsuisse.ch/mcp/docs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It speaks MCP over Streamable HTTP, is stateless, and only accepts &lt;code&gt;POST&lt;/code&gt;. It has no access to any QR Suisse account: it only searches and returns documentation pages.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Claude Code&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;claude mcp add --transport http qr-suisse-docs https://www.qrsuisse.ch/mcp/docs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Visual Studio Code&lt;/strong&gt;: add this to &lt;code&gt;.vscode/mcp.json&lt;/code&gt; in your project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"servers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"qr-suisse-docs"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"http"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"https://www.qrsuisse.ch/mcp/docs"&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Other MCP clients that support remote HTTP servers work the same way: give them the URL.&lt;/p&gt;

&lt;p&gt;The server exposes two tools:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;Input&lt;/th&gt;
&lt;th&gt;What it returns&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;qr_suisse_search_docs&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;query&lt;/code&gt;: English keywords, 1 to 200 characters&lt;/td&gt;
&lt;td&gt;Up to 5 matching pages, best match first, each with &lt;code&gt;page&lt;/code&gt;, &lt;code&gt;title&lt;/code&gt;, &lt;code&gt;url&lt;/code&gt; and an &lt;code&gt;excerpt&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;qr_suisse_get_page&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;page&lt;/code&gt;: an identifier from the search results&lt;/td&gt;
&lt;td&gt;The full Markdown text of the page&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Page identifiers come from a closed list: &lt;code&gt;llms-txt&lt;/code&gt;, &lt;code&gt;agents-md&lt;/code&gt;, &lt;code&gt;auth-md&lt;/code&gt;, &lt;code&gt;pricing-md&lt;/code&gt;, and &lt;code&gt;api/&amp;lt;operationId&amp;gt;&lt;/code&gt; for each operation of the REST API (for example &lt;code&gt;api/createQrCode&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;Now ask your agent something concrete, for example:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Using the qr-suisse-docs tools, find how to create a URL QR code with the QR Suisse API, and write a Node.js script that reads the API key from the &lt;code&gt;QRSUISSE_API_KEY&lt;/code&gt; environment variable.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A well-behaved agent will call &lt;code&gt;qr_suisse_search_docs&lt;/code&gt; with keywords such as "create QR code", then &lt;code&gt;qr_suisse_get_page&lt;/code&gt; with &lt;code&gt;api/createQrCode&lt;/code&gt;, and base its code on that page rather than on a guess.&lt;/p&gt;

&lt;h2&gt;
  
  
  Part 2: look under the hood with curl
&lt;/h2&gt;

&lt;p&gt;You do not need an MCP client to see what the server returns. Every request is a single JSON-RPC message in a &lt;code&gt;POST&lt;/code&gt;. Two details matter:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;send &lt;code&gt;Accept: application/json, text/event-stream&lt;/code&gt; (required by the Streamable HTTP transport);&lt;/li&gt;
&lt;li&gt;do &lt;strong&gt;not&lt;/strong&gt; send an &lt;code&gt;Origin&lt;/code&gt; header: the server rejects requests from web pages.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;List the tools:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -sS https://www.qrsuisse.ch/mcp/docs \
  -H &lt;span class="s1"&gt;'Content-Type: application/json'&lt;/span&gt; \
  -H &lt;span class="s1"&gt;'Accept: application/json, text/event-stream'&lt;/span&gt; \
  -d &lt;span class="s1"&gt;'{"jsonrpc":"2.0","id":1,"method":"tools/list"}'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; jq &lt;span class="s1"&gt;'.result.tools[].name'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Search the documentation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -sS https://www.qrsuisse.ch/mcp/docs \
  -H &lt;span class="s1"&gt;'Content-Type: application/json'&lt;/span&gt; \
  -H &lt;span class="s1"&gt;'Accept: application/json, text/event-stream'&lt;/span&gt; \
  -d &lt;span class="s1"&gt;'{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"qr_suisse_search_docs","arguments":{"query":"create dynamic QR code"}}}'&lt;/span&gt; \
  &lt;span class="o"&gt;|&lt;/span&gt; jq &lt;span class="s1"&gt;'.result.structuredContent.results[] | {page, title}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read one page:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -sS https://www.qrsuisse.ch/mcp/docs \
  -H &lt;span class="s1"&gt;'Content-Type: application/json'&lt;/span&gt; \
  -H &lt;span class="s1"&gt;'Accept: application/json, text/event-stream'&lt;/span&gt; \
  -d &lt;span class="s1"&gt;'{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"qr_suisse_get_page","arguments":{"page":"api/createQrCode"}}}'&lt;/span&gt; \
  &lt;span class="o"&gt;|&lt;/span&gt; jq -r &lt;span class="s1"&gt;'.result.structuredContent.content'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The server allows 60 requests per minute per IP address, which leaves plenty of room for an agent session.&lt;/p&gt;

&lt;h2&gt;
  
  
  Part 3: create a dynamic QR code with the API
&lt;/h2&gt;

&lt;p&gt;The REST API lives at &lt;code&gt;https://app.qrsuisse.ch/api/v1&lt;/code&gt;. Its OpenAPI specification is public at &lt;code&gt;https://www.qrsuisse.ch/openapi.json&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.1 Create a key and keep it out of the chat
&lt;/h3&gt;

&lt;p&gt;In the QR Suisse dashboard, a member with the "Manager of API keys" permission (or an administrator) creates the key and picks its rights. For this tutorial: &lt;code&gt;QR_CREATE&lt;/code&gt; and &lt;code&gt;QR_READ&lt;/code&gt;. The full key is shown &lt;strong&gt;once&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Give it to your shell without leaving it in your history:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;read&lt;/span&gt; -rs QRSUISSE_API_KEY &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="kd"&gt;export&lt;/span&gt; QRSUISSE_API_KEY
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Never paste the key into a conversation with an assistant: the agent should read it from its environment or configuration.&lt;/p&gt;

&lt;p&gt;Quick check, with no key needed: the API index.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -sS https://app.qrsuisse.ch/api/v1 &lt;span class="o"&gt;|&lt;/span&gt; jq
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3.2 Create the QR code
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -sS -X POST https://app.qrsuisse.ch/api/v1/qr-codes \
  -H &lt;span class="s2"&gt;"Authorization: Bearer $QRSUISSE_API_KEY"&lt;/span&gt; \
  -H &lt;span class="s1"&gt;'Content-Type: application/json'&lt;/span&gt; \
  -H &lt;span class="s2"&gt;"Idempotency-Key: $(uuidgen)"&lt;/span&gt; \
  -d &lt;span class="s1"&gt;'{"type":"URL","label":"Spring flyer","destinationUrl":"https://www.example.ch/spring"}'&lt;/span&gt; \
  &lt;span class="o"&gt;|&lt;/span&gt; tee qr.json &lt;span class="o"&gt;|&lt;/span&gt; jq &lt;span class="s1"&gt;'{id, slug, publicUrl, destinationUrl}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The response (&lt;code&gt;201&lt;/code&gt;) is the QR code. Abridged, with illustrative values:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"cm2f8k3qz0001xyz9abcd1234"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"slug"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"AbC123_-xy"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"publicUrl"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"https://app.qrsuisse.ch/r/AbC123_-xy"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"destinationUrl"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"https://www.example.ch/spring"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;publicUrl&lt;/code&gt; is what the image encodes; &lt;code&gt;destinationUrl&lt;/code&gt; is where people land.&lt;/p&gt;

&lt;p&gt;Why the &lt;code&gt;Idempotency-Key&lt;/code&gt;: if the request times out and you send it again &lt;strong&gt;with the same value and the same body&lt;/strong&gt; within 24 hours, you get the same QR code back (header &lt;code&gt;Idempotent-Replayed: true&lt;/code&gt;) instead of a duplicate. That matters because API creations count against a monthly quota.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.3 Download the image
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;QR_ID&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$(&lt;/span&gt;jq -r .id qr.json&lt;span class="o"&gt;)&lt;/span&gt;
curl -sS -H &lt;span class="s2"&gt;"Authorization: Bearer $QRSUISSE_API_KEY"&lt;/span&gt; \
  -o qr.svg &lt;span class="s2"&gt;"https://app.qrsuisse.ch/api/v1/qr-codes/$QR_ID/image?format=svg"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;SVG is the format to use for print. For PNG, use &lt;code&gt;format=png&amp;amp;size=512&lt;/code&gt; (128 to 1024 pixels).&lt;/p&gt;

&lt;h3&gt;
  
  
  3.4 Change the destination after printing
&lt;/h3&gt;

&lt;p&gt;This is the point of a dynamic QR code: the printed image stays the same.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -sS -X PATCH &lt;span class="s2"&gt;"https://app.qrsuisse.ch/api/v1/qr-codes/$QR_ID"&lt;/span&gt; \
  -H &lt;span class="s2"&gt;"Authorization: Bearer $QRSUISSE_API_KEY"&lt;/span&gt; \
  -H &lt;span class="s1"&gt;'Content-Type: application/json'&lt;/span&gt; \
  -d &lt;span class="s1"&gt;'{"destinationUrl":"https://www.example.ch/summer"}'&lt;/span&gt; \
  &lt;span class="o"&gt;|&lt;/span&gt; jq &lt;span class="s1"&gt;'{publicUrl, destinationUrl}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This call needs the &lt;code&gt;QR_UPDATE&lt;/code&gt; right, so add it to your key if you want to try it. An update does not use any creation from the quota.&lt;/p&gt;

&lt;h3&gt;
  
  
  The same flow in Node.js
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// create-qr.mjs (Node.js 18+, no dependency)&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;randomUUID&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s2"&gt;"node:crypto"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;writeFile&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s2"&gt;"node:fs/promises"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="no"&gt;API&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"https://app.qrsuisse.ch/api/v1"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;QRSUISSE_API_KEY&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Set QRSUISSE_API_KEY in your environment."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;auth&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nc"&gt;Authorization&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sb"&gt;`Bearer ${key}`&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;created&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nb"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`${API}/qr-codes`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"POST"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;auth&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"application/json"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Idempotency-Key"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;randomUUID&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"URL"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;label&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Spring flyer"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;destinationUrl&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"https://www.example.ch/spring"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;created&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ok&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;error&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;created&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c1"&gt;// Branch on error.error (stable code), never on error.message.&lt;/span&gt;
  &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`${created.status} ${error.error}`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;qr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;created&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;qr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;publicUrl&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;image&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nb"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`${API}/qr-codes/${qr.id}/image?format=svg`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;auth&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ok&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`Image: ${image.status}`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;writeFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"qr.svg"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Buffer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;arrayBuffer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run it with &lt;code&gt;node create-qr.mjs&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limits worth knowing
&lt;/h2&gt;

&lt;p&gt;At the time of writing (API version 1.3.0, November 2026):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Creations per calendar month (UTC)&lt;/strong&gt;: 5 with Pro, 100 with Entreprise, then optional one-off creation packs. &lt;code&gt;GET /api/v1/usage&lt;/code&gt; shows the balance (it needs the &lt;code&gt;QR_CREATE&lt;/code&gt; right). Reading, updating and downloading use nothing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rate limits per key&lt;/strong&gt;: 30 requests per minute overall, 8 creations per minute, and 10 PNG renders per minute per account. Responses carry &lt;code&gt;RateLimit&lt;/code&gt; and &lt;code&gt;RateLimit-Policy&lt;/code&gt; headers; on &lt;code&gt;429&lt;/code&gt;, wait for &lt;code&gt;Retry-After&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Errors&lt;/strong&gt; share one shape, &lt;code&gt;{ "error": "&amp;lt;code&amp;gt;", "message": "&amp;lt;text&amp;gt;" }&lt;/code&gt;. Code against &lt;code&gt;error&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keys&lt;/strong&gt; can be rotated or revoked from the dashboard at any time. A key sent over plain HTTP is refused, and should be rotated.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Recap
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Point your agent at &lt;code&gt;https://www.qrsuisse.ch/mcp/docs&lt;/code&gt; so it reads the real documentation, without any account or key.&lt;/li&gt;
&lt;li&gt;Keep the API key in the environment, never in the chat.&lt;/li&gt;
&lt;li&gt;Create with an &lt;code&gt;Idempotency-Key&lt;/code&gt;, download as SVG for print, and update the destination whenever the target page changes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Server documentation and client configurations: &lt;a href="https://www.qrsuisse.ch/en/api-documentation/mcp-server" rel="noopener noreferrer"&gt;QR Suisse MCP server&lt;/a&gt; · API reference: &lt;a href="https://www.qrsuisse.ch/en/api-documentation" rel="noopener noreferrer"&gt;QR Suisse API documentation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Published by the team behind QR Suisse (Skyday Sàrl).&lt;/em&gt;&lt;/p&gt;

</description>
      <category>mcp</category>
      <category>ai</category>
      <category>api</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
